Jump to content
We've recently updated our Privacy Statement, available here ×

JasperServer: Remote XML Data Source as Parameter


gkuehnberger

Recommended Posts

Hello,

My target is to generate reports based on an external XML-Datasource, which should be handed over as parameter during runtime.

I've succeeded doing so with iReport, however fail to do so with Jasper-Server.

I understood that one could use a custom datasource, however I'm wondering wether this is really needed.

Anyone already solved the above task with or without a custom datasource, and how?

Thanks upfront
regards Georg
 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic


FYI I solved the above.
Apparently I misunderstood the queryexecuters logic a bit, and I especially stumbled upon jasperserver missing the xpath2 queryexector.

Anyway, as for reference, please find my solution below;
hth someone later on
regards Georg

### adding xpath2 query executer to jasperserver 3.5 without using a custom datasource

a) extended
/opt/jasperserver-3.5.0/apache-tomcat/webapps/jasperserver/WEB-INF/classes/jasperreports.properties
with
# addition for xpath2 queries
net.sf.jasperreports.query.executer.factory.xpath2=com.jaspersoft.jrx.query.JRXPathQueryExecuterFactory

b) copied jasperreports-extensions-3.5.3.jar (from iReport) to
/opt/jasperserver-3.5.0/apache-tomcat/webapps/jasperserver/WEB-INF/lib/jasperreports-extensions-3.5.3.jar

c) restarted jasperserver

d) within the main report I used something like:
<parameter name="p_xml_url" class="java.lang.String">
    <defaultValueExpression><![CDATA["http://mydomain/generate_xml.php"]]></defaultValueExpression>
</parameter>
<parameter name="XML_URL" class="java.lang.String" isForPrompting="false">
    <defaultValueExpression><![CDATA[$P{p_xml_url}]]></defaultValueExpression>
</parameter>
 

Link to comment
Share on other sites

  • 1 month later...
  • 8 months later...
  • 2 weeks 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...