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

warning message


mathewrond

Recommended Posts

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 line

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params);

 

Can someone help me out with what the problem could be?

 

Mathew

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

summary.jrxml

header.jrxml

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

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

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