burferd Posted June 27, 2011 Share Posted June 27, 2011 I am attempting to run the 4.0.1 demo report "TableReport.jrxml" from http://jasperreports.sourceforge.net/sample.reference/table/index.htmlWhen attempting to execute JasperCompileManager.compileReport() I get the following exceptiion:Parse Error at line 9 column 66: Document root element "jasperReport", must match DOCTYPE root "null".I'm using the TableReport.jrxml file that is in the demo example - attached below.I have modified the compile step to match my application - the code for that is included below. I think it is correct, since I can make it work with simple jrxml files from an older iReport test.I believe it is a problem with the syntax in the first <jasperReport> definition, but I do not know what the proper syntax should be.Can anyone point me to a table example that will work?I am using JR 4.0.2 libraries.Thanks. Code: public boolean createAccountInfoRpt() { JasperPrint jp = null; JasperReport rptFile = null; try { Map parameters = new HashMap(); parameters.put("TableDataSource", new JREmptyDataSource(50)); rptFile = JasperCompileManager.compileReport("C:/Reports/Greenville/Source/TableReport.jrxml"); System.out.println( "<SessionBean1.createAccountInfoRpt> Compiled Jasper Report "+rptFile ); jp = JasperFillManager.fillReport( rptFile, parameters, new JREmptyDataSource() ); if( doPdf )doPdfReport( jp, "AccountInformation"); if( doExcel )doExcelReport( jp, "AccountInformation" ); } catch( Exception e ) { e.printStackTrace(); System.out.println( "<SessionBean1.createAccountInfoRpt> Error: "+ e.toString());// setMessage( "Error creating report."); return false; } return true; } 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