Jump to content

Parameterizable remote XML-source in JasperServer 6.0.1


Go to solution Solved by stefan.beukmann,

Recommended Posts

Posted

Hi!

I am trying to publish a report to JasperServer 6.0.1 with remote XML datasource that can be changed via a report parameter.

I've tried the following solutions so far:

I followed this guide:

http://community.jaspersoft.com/wiki/remote-xml-datasource

I edited my jrxml so that it contains the following parameters:

    <parameter name="NAME" class="java.lang.String"/>

    <parameter name="XML_URL" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["http://server-ip-address/rest_v1/items/" + $P{NAME}]]></defaultValueExpression>
    </parameter>

  • at first I tried copying the com.jaspersoft.studio.data_6.0.1.final to the WEB-INF/lib and edit the jasperserver.properties. After a restart I got an java.lang.ClassNotFoundException: com.jaspersoft.studio.utils.XMLUtils.
  • So i also copied the com.jaspersoft.studio_6.0.1.final (which seems a bit overkill since it's 30 megabytes large!). The effect was, that I couldn't open any more reports in the jasperserver webinterface. I guess there are some classloader related issues, but I didn't look any further into it because integrating half of jasperstudios code into the server just for an remote xml seems a bit harsh

So I tried locating the other mentioned jar (jasperreports-extensions-3.5.3.jar) and removed the aforementioned two from the server

The report executed, but with no data. I looked into the server logs and found the warning

WARN JRXPathQueryExecuter - No XML source was provided.

After that, I stumbled across this post: http://community.jaspersoft.com/questions/824553/i-have-question-about-xml-datasource-and-xml-remote-datasource

It seems like a totally different solution, but it doesn't seem to be parameterizable.

 

So, now my questions is:

which one of my previous attempts was the correct one and what did I do wrong?

 

Thanks a lot in advance

 

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution
Posted

I finally got it!

I was using xpath as query syntax, because xPath2 was throwing a "unknown query language" error. changing the language in querystring to xpath2 (all in lowercase) solved the issue.

I am using the jasperreports-extensions-3.5.3.jar

  • 2 months later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...