Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Loading Report Designs from a string
sowelie
What I'm trying to do is store my report designs in a database rather than on the file system. Database rows are much easier to deal with than files...especially seeing as I'm giving my users the option of choosing report templates to use. I cannot for the life of me figure out how to load a report design from a string. Here's what I'm trying to do:
engine.openReportDesign(new ByteArrayInputStream(this.reportDesign.getBytes()));
The report design string is copied directly from eclipse's report designer...and I'm getting this in my logs:
Apr 7, 2009 8:28:10 AM org.eclipse.birt.report.model.parser.ModuleReader readModule
SEVERE: Line Number:3 Error Code:Error.XMLParserException.SAX_ERROR Exception:org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup. Message:SAX detected an error with the basic XML syntax of the file.
Apr 7, 2009 8:28:10 AM org.eclipse.birt.report.engine.api.impl.ReportEngineHelper openReportDesign
SEVERE: invalid design file <stream>
09/04/07 08:28:10:99 WARN logging.ApplicationLog: Exception parsing report fields: The design file <stream> has error and can not be run.
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:258)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:181)
at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:158)
at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:388)
at com.verani.common.backPage.reporting.BirtManager.getReportDesign(BirtManager.java:117)
at com.verani.common.backPage.reporting.BirtManager.getParameters(BirtManager.java:53)
at com.verani.common.backPage.reporting.ReportTemplate.getGroups(ReportTemplate.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.verani.common.dwr.H3SmartBeanConverter.getPropertyMapFromObject(H3SmartBeanConverter.java:93)
at org.directwebremoting.convert.BasicObjectConverter.convertOutbound(BasicObjectConverter.java:181)
at org.directwebremoting.dwrp.DefaultConverterManager.convertOutbound(DefaultConverterManager.java:192)
at org.directwebremoting.convert.CollectionConverter.convertOutbound(CollectionConverter.java:206)
at org.directwebremoting.dwrp.DefaultConverterManager.convertOutbound(DefaultConverterManager.java:192)
at org.directwebremoting.extend.ScriptBufferUtil.createOutput(ScriptBufferUtil.java:56)
at org.directwebremoting.dwrp.BaseCallMarshaller$CallScriptConduit.addScript(BaseCallMarshaller.java:512)
at org.directwebremoting.extend.EnginePrivate.remoteHandleCallback(EnginePrivate.java:56)
at org.directwebremoting.dwrp.BaseCallMarshaller.marshallOutbound(BaseCallMarshaller.java:330)
at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:53)
at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.verani.common.web.servlets.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:33)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
I've searched around online and I'm surprised by the fact that NOBODY else wants to load report designs this way! Dealing with the file system is a pain and I try and avoid this (especially in the context of a web application) at all costs.
Find more posts tagged with
Comments
sowelie
As it turns out the XML was invalid...
Eclipse generates a "createdBy" property and near the build number there was a '>', which is obviously invalid XML. Why would the designer generate invalid XML??
SmokesMom
I've been trying to do this as well. Did you finally get it to work?<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="'sowelie'" data-cid="46045" data-time="1239121821" data-date="07 April 2009 - 09:30 AM"><p>
As it turns out the XML was invalid...<br />
<br />
<br />
Eclipse generates a "createdBy" property and near the build number there was a '>', which is obviously invalid XML. Why would the designer generate invalid XML??<br /></p></blockquote>
A_Fejer
<blockquote class='ipsBlockquote' data-author="'sowelie'" data-cid="46045" data-time="1239121821" data-date="07 April 2009 - 09:30 AM"><p>
As it turns out the XML was invalid...<br />
<br />
<br />
Eclipse generates a "createdBy" property and near the build number there was a '>', which is obviously invalid XML. Why would the designer generate invalid XML??<br /></p></blockquote>
That '>' should be a '<' (lower than) symbol. <br />
The correct line should look the following way:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'><property name="createdBy">Eclipse BIRT Designer Version 2.2.1.r221_v20070924 Build < 2.2.0.v20070924-1550></property></pre>
<br />
I guess somewhere during the loading process the '<' string was replaced with the '>' character.