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

Compile xml byte array


2004 IR Help

Recommended Posts

By: chris gamble - cgamble

Compile xml byte array

2005-03-31 18:40

I am trying to store a report in XML format in a database, and compile it at run-time. I have taken the report and compiled it using jasper api from a file and it worked. I have also taken the report after i loaded it from the database, put it back into a file, and it worked. However, when I use jaspermanager.loadXml, it errors out. I have posted the code that i am using to compile, and the errors below. any thoughts? i would post the report, but it happens with any report i use.. also, this code worked prior to upgrading from .5 to .6...

 

thanks,

 

byte[] invbuffer = Application.getInstance().currentCompany.invoice;

ByteBuffer buf = ByteBuffer.wrap( invbuffer );

InputStream is = newInputStream(buf);

 

JasperDesign jasperDesign = JasperManager.loadXmlDesign(is);

net.sf.jasperreports.engine.design.JRBshCompiler theCompiler = new net.sf.jasperreports.engine.design.JRBshCompiler();

JasperReport report = theCompiler.compileReport(jasperDesign);

 

Mar 31, 2005 8:24:08 PM org.apache.commons.digester.Digester fatalError

SEVERE: Parse Fatal Error at line 2157 column 1: Content is not allowed in trailing section.

org.xml.sax.SAXParseException: Content is not allowed in trailing section.

at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)

at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.commons.digester.Digester.parse(Digester.java:1514)

at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:357)

at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:341)

at net.sf.jasperreports.engine.JasperManager.loadXmlDesign(JasperManager.java:981)

at com.spn.business.ReportMgr.printInvoice(ReportMgr.java:236)

at com.spn.forms.InvoiceSetup.printInvoice(InvoiceSetup.java:1004)

at com.spn.forms.InvoiceSetup.jbtnPrintAMouseClicked(InvoiceSetup.java:1751)

at com.spn.forms.InvoiceSetup.access$1400(InvoiceSetup.java:24)

at com.spn.forms.InvoiceSetup$16.mouseClicked(InvoiceSetup.java:1503)

at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)

at java.awt.Component.processMouseEvent(Component.java:5103)

at java.awt.Component.processEvent(Component.java:4897)

at java.awt.Container.processEvent(Container.java:1569)

at java.awt.Component.dispatchEventImpl(Component.java:3615)

at java.awt.Container.dispatchEventImpl(Container.java:1627)

at java.awt.Component.dispatchEvent(Component.java:3477)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3207)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)

at java.awt.Container.dispatchEventImpl(Container.java:1613)

at java.awt.Window.dispatchEventImpl(Window.java:1606)

at java.awt.Component.dispatchEvent(Component.java:3477)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

ReportMgr::printInvoice net.sf.jasperreports.engine.JRException: Content is not allowed in trailing section.

>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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