mathewrond Posted August 28, 2006 Share Posted August 28, 2006 Hi,This is my java code public static void main(String args[]){ try { Map params = new HashMap(); params.put("ReportTitle", "Orders Report"); Document document = JRXmlUtils.parse(new File("D:\eclipse\workspace\JasperPOC\config\sample.xml")); params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document); System.out.println("3"); JasperReport jasperReport = (JasperReport)JRLoader.loadObject("D:\eclipse\workspace\JasperPOC\config\land_report_1.jasper"); System.out.println("33"); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params); System.out.println("4"); jasperPrint = moveTableOfContents(jasperPrint); File destFile = new File("D:\eclipse\workspace\JasperPOC\config\land_report_1.jrprint"); JRSaver.saveObject(jasperPrint, destFile.toString()); JasperExportManager.exportReportToPdfFile("D:\eclipse\workspace\JasperPOC\config\land_report_1.jrprint"); }catch(Exception e){ e.printStackTrace(); }} and I get the following message Aug 28, 2006 6:23:27 PM net.sf.jasperreports.engine.query.JRXPathQueryExecuter <init>WARNING: The supplied org.w3c.dom.Document object is null. And the problem is at this lineJasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params); Can someone help me out with what the problem could be? Mathew Link to comment Share on other sites More sharing options...
Alexander Merz Posted August 29, 2006 Share Posted August 29, 2006 I guess document is null. You can easily check it via the debugger in Eclipse.Post edited by: Alexander Merz, at: 2006/08/28 19:41 Link to comment Share on other sites More sharing options...
mathewrond Posted August 29, 2006 Author Share Posted August 29, 2006 I have printed the XML file using Document object and it prints me all the information in the XML file. I have also got the PDF file generated with the data. What I was trying to achieve is to generate a PDF file with summary page on the first page. I have got 4 .jrxml files. e.g.main.jrxmlsummary.jrxmlheader.jrxmldetail.jrxml main.jrxml includes both header.jasper and summary.jasper. Is this creating any problem? Please give me some ideas. Link to comment Share on other sites More sharing options...
Alexander Merz Posted August 29, 2006 Share Posted August 29, 2006 I'm not sure why you want the summary section at the top of the report. Could it be possible, that you just want to set the evalutionTime attribute of a <textField> to the value "Report"? Then the expression in <textFieldExpression> is evaluated when reaching the end of the report. Link to comment Share on other sites More sharing options...
mathewrond Posted August 29, 2006 Author Share Posted August 29, 2006 Yes its possible to have summary page on top of the report. There is an example of Table of contents provided with jasper reports software. I have the current problem while implementing the logic. Link to comment Share on other sites More sharing options...
Alexander Merz Posted August 29, 2006 Share Posted August 29, 2006 Nitpick: It is not possible to move the summary *section* at the top. But you can move a page having a specific text to another position. But this is not the problem here, the exception is thrown before moveTableOfContents() is called. I feel a little out of context. The warning does occur in your real application? The given code is only a demonstration? In your demo you don't provide any references to the sub reports. I guess JasperReports can successfully load main.jrxml, but fails while trying to load the files for the sub reports. Link to comment Share on other sites More sharing options...
mathewrond Posted August 29, 2006 Author Share Posted August 29, 2006 I guess you are true. I have searched the forums and found a solution to implement what I am actually looking at. Thank you for your support. 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