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

genx

Members
  • Posts

    10
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by genx

  1. Sorry I just noticed that this was a really old post..
  2. Hi, Can you check if you have xerces somewhere in your classpath? I have the same linkage problem and I am trying to confirm if the 2 are connected. Thanks
  3. Thanks Nitin, I tried it and unfortunately it does not work. I think the problem is due to xerces in classpath. I created a sample app just to check this out and xerces is causing this. This is a major show stopper for me. Now I have to either figure out how to work around this (cause I cannot delete/remove xerces from classpath) or ditch the whole idea of using xmldatasource :(( Thanks anyway. Let me know if you think of something I can try.
  4. I have been researching this further and looks like this could be due to xerxes parser in ihe classpath. I don't know how to resolve this yet cause I cannot delete xerces which is already being used. Just put this in..in case it helps someone else.
  5. Hi, Were you able to resolve this? I get the same linkage error - inspite of the xml being valid, the document is null.
  6. Have a look at xmldatasource sample for a start. There is another example of addressbook online if you google. HTH
  7. I have the following xml structure: <ROOT> <INFO> <ID>1</ID> <!-- more nested nodes --> <DATA> <VALUE>x</VALUE> <RESULT>blah</RESULT> </DATA> <COMMENTS> <TYPE>infotype</TYPE> <COMMENT>Commentid1</COMMENT> </COMMENTS> </INFO> <INFO> <ID>2</ID> <!-- more nested nodes --> <DATA> <VALUE>y</VALUE> <RESULT>blah y</RESULT> </DATA> <COMMENTS> <TYPE>infotype</TYPE> <COMMENT>Commentid2</COMMENT> </COMMENTS> </INFO> <COMMENTS> <TYPE>atype</TYPE> <COMMENT>Comment1</COMMENT> <COMMENT>Comment2</COMMENT> <!--Could have more comments --> </COMMENTS> </ROOT> I have a INFO subreport which has a COMMENTS subreport. INFO subreport has : Parameter ID (passed from master report) : Report Query : /ROOT/INFO[iD=$P{ID}]/DATA : COMMENTS subreport - Datasource expression : ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/ROOT/ INFO[iD=$P{ID}]/COMMENTS/COMMENT") This does not display the comments. However if I hardcode the ID ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/ROOT/ INFO[iD=1]/COMMENTS/COMMENT"), the comments are displayed. Is passing parameter to datasource expression allowed? If not how can I pass a parameter to the nested subreport? Appreciate all help Thanks
  8. Hi, I have a Servlet which reads the .jasper files and the data xml file. I know the file is valid and being read, cause I have printed the entire data file contents and also tested the reports with the same datafile from a sample (non-web) regular java application. However in the sevlet code "Document document = JRXmlUtils.parse(dataFile)" returns a null. I tried passing stream, file name and none of them work. Any pointers as to why this is happenning? Here is my code snippet: //Read all Subreports.. InputStream sub1Stream = context.getResourceAsStream("/reports/subreport1.jasper"); JasperReport subreport1 = (JasperReport) JRLoader.loadObject(sub1Stream); params.put("SUBREPORT_1", subreport1); System.out.println("Subrepoprt1 " + sub1Stream); //Read Data to populate the report String path = context.getRealPath("/data/report.xml"); System.out.println("path" + path); //This is verified and valid File dataFile = new File(path); //this is fine too.. Document document = JRXmlUtils.parse(dataFile); System.out.println("document " +document); //printsnull params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document); Appreciate any help/suggestions Thanks
  9. That worked. Thanks for your help. I have another quick question regarding passing parameter in Datasource expression. <ROOT> <INFO> <ID>1</ID> <!-- more nested nodes --> <DATA> <VALUE>x</VALUE> <RESULT>blah</RESULT> </DATA> <COMMENTS> <TYPE>infotype</TYPE> <COMMENT>Commentid1</COMMENT> </COMMENTS> </INFO> <INFO> <ID>2</ID> <!-- more nested nodes --> <DATA> <VALUE>y</VALUE> <RESULT>blah y</RESULT> </DATA> <COMMENTS> <TYPE>infotype</TYPE> <COMMENT>Commentid2</COMMENT> </COMMENTS> </INFO> <COMMENTS> <TYPE>atype</TYPE> <COMMENT>Comment1</COMMENT> <COMMENT>Comment2</COMMENT> <!--Could have more comments --> </COMMENTS> </ROOT> I have a INFO subreport which has a COMMENTS subreport. INFO subreport has :parameter ID (passed from master report) :Report Query : /ROOT/INFO[iD=$P{ID}]/DATA :COMMENTS subreport - Datasource expression : ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/ROOT/INFO[iD=$P{ID}]/COMMENTS/COMMENT") This does not display the comments. However if I hardcode the ID ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/ROOT/INFO[iD=1]/COMMENTS/COMMENT"), the comments are displayed. Is passing parameter allowed? If not how can I pass a parameter to the nested subreport? Thanks Ivy
  10. I have the following xml: <ROOT> <INFO> </INFO> <!--Whole bunch of other nodes --> <!--and then this is the problem area --> <COMMENTS> <TYPE>atype</TYPE> <COMMENT>Comment1</COMMENT> <COMMENT>Comment2</COMMENT> <!--Could have more comments --> </COMMENTS> </ROOT> I have a master report and a subreport for the COMMENTS. In the Subreports I have the following settings Connection/DataSource expression - ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/ROOT/COMMENTS") Subreport expression - "Comments.jasper". In the Comments.jrxml, I have a single textfield pointing to FieldName:COMMENT, Type:java.lang.String and Description:COMMENT With these settings the report displays just the first comment. I tried changing the DataSource expression to "/ROOT/COMMENTS//COMMENT", the subreport shows 2 rows but with values as null. Appreciate any help! Thanks in advance.
×
×
  • Create New...