jgladden Posted December 12, 2007 Share Posted December 12, 2007 How do I pass XML with the report service request to JasperServer? (rather than predefining a datasource) I would like to construct XML on the fly, pass it to JasperServer in the request, and receive a PDF. I have JRXML reports (created by iReport) in my repository already -- they are configured to an XML datasource. Thoughts? Code:<request operationName="runReport" locale="en"> <argument name="RUN_OUTPUT_FORMAT">PDF</argument> <resourceDescriptor name="" wsType="" uriString="XMLReport" isNew="false"> <label>null</label> </resourceDescriptor></request> thanks in advance, johnjohngladden1978@gmail.com Link to comment Share on other sites More sharing options...
gkuehnberger Posted December 21, 2009 Share Posted December 21, 2009 john, (elder question I know, but),were you able to solve the described task? how?I'm interested in a solution eigther passing the xml-data within the request or referring to an external url which provides the xml.thanks upfrontregards georg Link to comment Share on other sites More sharing options...
swood Posted December 21, 2009 Share Posted December 21, 2009 You would need to create a custom data source to do this. ShermanJaspersoft Link to comment Share on other sites More sharing options...
gkuehnberger Posted December 21, 2009 Share Posted December 21, 2009 Sherman,Thanks for your reply;Except for the official documentation shipped with jasperserver, and the offficial documentation we bought (all J-ultimate Guides), studied in depth, which however "only" show, cite, state examples of custom datasources, I were not able to locate any ressources, like downloadable code-examples of or ready to use custom datasources for the described specific task?Could you point me towards such a ressource?I feel such add-on downloads (supported or not) would add an incredible benefit supporting the proliferation of the product.Me feels that iReport with its wast datasources, meanwhile is way ahead of JS, which IMHO should not necessary be the case.Suggestion: setup a wiki-page describing howto "migrate" iReport DataSources to JasperServer?Thanks upfront,regards Georg Link to comment Share on other sites More sharing options...
gkuehnberger Posted December 27, 2009 Share Posted December 27, 2009 Sherman,I solved the task, without the need of a new custom datasource, the following way.hth someone searching the archives later on;regards Georga) added xpath2 functionality to jasperserver 3.5 see:see http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=68744b) used a java.lang.String input parameter, which ist then taken over by the org.w3c.dom.Document XML_DATA_DOCUMENT;within the main report I used something like:<parameter name="XML_DATA" class="java.lang.String"> <defaultValueExpression><![CDATA["<data><node1>node1-text</node1><node2>node2-text</node2></data>"]]></defaultValueExpression></parameter><parameter name="XML_DATA_DOCUMENT" class="org.w3c.dom.Document" isForPrompting="false"> <defaultValueExpression><![CDATA[net.sf.jasperreports.engine.util.JRXmlUtils.parse(new org.xml.sax.InputSource(new java.io.StringReader($P{XML_DATA})))]]></defaultValueExpression></parameter><queryString language="xpath2"> <![CDATA[/data]]></queryString> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now