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

phuongkimngo

Members
  • Posts

    2
  • Joined

  • Last visited

phuongkimngo's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I try fill my report using the following code from the Customers data example code: public void fill() throws JRException{ long start = System.currentTimeMillis(); Map params = new Hashmap(): Document document = JRXmlUtils.parse(JRLoader.getLocationInputStream("C:\data\dataExtraction.xml")); params.put(JRXpathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document); params.put(JRXpathQueryExecuterFactory.XML_DATA_DOCUMENT, "yyyy-MM-dd"); . . . . JasperFillManager.fillReportToFile("/build/reports/MyDataReport.jasper", params); } The JRLoader.getLocationInputStream method always failed to read the input file. I could not find any answers from searching the site. Could the versions of my environment be a problem? Thanks, Kim Here are my environment details: java version: jdk1.6.0_45; tomcat version: 5.5.7; jasper reports version: 5.0.0; ireport version: 5.0.4. Jrxml files are complied with ireport version 5.0.4. When trying to do the fill from Eclipse, I've got the following exception: net.sf.jasperreports.engine.JRException: Failed to parse the xml document at net.sf.jasperreports.engine.util.JRXmlUtils.parse(JRXmlUtils.java:80) at net.sf.jasperreports.engine.util.JRXmlUtils.parse(JRXmlUtils.java:149) at net.sf.jasperreports.engine.util.JRXmlUtils.parse(JRXmlUtils.java:136). . . . . Caused by: java.net.MalformedURLException at java.net.URL.<init>(URL.java:601) at java.net.URL.<init>URL.java:464). . . . at net.sf.jasperreports.engine.util.JRXmlUtils.parse(JRXmlUtils.java:72) . . .. . .55 more
  2. Hi, I have created three reports using XML DataSource. One is master report and two are subreports. The main report has the date which needs to be sorted. Without sorting, the data in main report including subreports are displayed correctly. When specifying the date to be sorted in the main report, although date is not a parameter to be passed to subreports, the system gives this following error: Error fillng print . . . Error evaluating expression: . . .Source text : ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//OSRpt"). . . . . Caused by: java.lang.ClassCastException: net.sf.jasperreports.engine.fill.SortedDataSource cannot be cast to net.sf.jasperreports.engine.data.JRXmlDataSource at OSRpt_1374067410320_765742.evaluate(OSRpt_1374067410320_765742:457) at net.sf.jasperreprots.engine.fill.JREvaluator.evaluate(JREvaluator.java:190) . . . 19 more Print not filled. Try to use an EmptyDataSource .... I couldn't find any answers out there. Does any one have any suggestions on how to fix this problem? Thank you very much!
×
×
  • Create New...