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

How to use a XML String as a source of Report in JasperServer?


guibernardi

Recommended Posts

Hi,

I'm trying to use a XML String as a source of a report which is published in a JasperServer. First of all I'm using Jasper 6.5.1, and my application is JSF.

I have an report which receives an xPath as source, but the only way that I'd work was:

- I create a webservice where I select the entity in database (the xml field is in this entity), so I return the Response.ok and the method produces a XML.
- Then in the print calling I create the URL pointing to my own WS and I pass the URL as parameter net.sf.jasperreports.xml.source, but I think is a code smell because in the print calling method I already have the entity and the XML String, but I need to build an URL send to the report and the report call the webservice to get the same XML as a source.

So now I'm have a similar situation but I don't have the entity yet so I couldn't use that workaround, so I need to pass the XML to the report as String, as Document, as InputStream or whatever.

But it didn't work. Is there any example or way that I could do this?

Now I'm trying to do like this:

..parameters.put("XML_DATA_DOCUMENT", JRXmlUtils.parse(new InputSource(new StringReader(nfe.getSisXml())), true));..[/code]

But I'm getting:

..Caused by: java.lang.IllegalArgumentException: Infinite recursion (StackOverflowError) (through reference chain: org.apache.xerces.dom.DeferredDocumentImpl["firstChild"]->org.apache.xerces.dom.DeferredElementNSImpl["ownerDocument"]..[/code]

Thanks in advance

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...