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)
Disappearing columns
ypetrov
Hello,<br />
<br />
The report I work on is rendered fine to HTML, but the number of columns disappear when the report is rendered to xls. The attached images show the problem.<br />
<br />
The report is processed in Java servlet with separate run and render tasks. Servlet's doget() method runs report using FileArchiveWriter and renders the prepared document to HTML immediately after that. Servlet's dopost() gets the desired output format and renders the document to this format. Nothing special here...<br />
<br />
All columns of the table have exactly the same settings except explicit width setting for "AVG..." columns<br />
<br />
All cells in the table header row have exactly the same settings and have only one label item in each cell. All settings of these labels are the same.<br />
<br />
The code below is how I do the rendering:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>...
IReportDocument theRDoc = engine.openReportDocument(RPTDOC_FILENAME);
IRenderTask ret = engine.createRenderTask(theRDoc);
IRenderOption ro = null;
switch (pFmt) {
case HTML:
ro = new HTMLRenderOption();
ro.setOption(HTMLRenderOption.HTML_ENABLE_METADATA, Boolean.TRUE);
ro.setOption(HTMLRenderOption.HTML_PAGINATION, Boolean.FALSE);
ro.setOutputFormat(RenderOption.OUTPUT_FORMAT_HTML);
((HTMLRenderOption)ro).setBaseImageURL("birt-images");
((HTMLRenderOption)ro).setImageDirectory(this.getServletContext().getRealPath("/birt-images"));
ro.setImageHandler(new MyImgHandler(this.getServletContext()));
pResp.setContentType("text/html");
break;
case XLS:
ro = new EXCELRenderOption();
ro.setOutputFormat("xls");
((EXCELRenderOption)ro).setWrappingText(true);
pResp.setContentType("x-application/msexcel");
break;
case PDF:
ro = new PDFRenderOption();
ro.setOutputFormat(RenderOption.OUTPUT_FORMAT_PDF);
ro.setOption(PDFRenderOption.PAGE_OVERFLOW, PDFRenderOption.FIT_TO_PAGE_SIZE);
pResp.setContentType("x-application/pdf");
break;
default:
break;
}
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ro.setOption(RenderOption.OUTPUT_STREAM, bos);
ret.setRenderOption(ro);
ret.render();
ret.close();
...</pre>
<br />
If anyone can give me some clue on what's wrong, it would be great.<br />
<br />
Thanks.
Find more posts tagged with
Comments
JasonW
Can you post the report? When you say it is losing columns I assume you mean like Branch no etc in the above example? Also what version of BIRT?
Jason
ypetrov
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="65353" data-time="1275932920" data-date="07 June 2010 - 10:48 AM"><p>
Can you post the report?</p></blockquote>Unfortunately I can NOT.<br />
<blockquote class='ipsBlockquote' ><p>When you say it is losing columns I assume you mean like Branch no etc in the above example?</p></blockquote>Correct<br />
<blockquote class='ipsBlockquote' ><p>Also what version of BIRT?</p></blockquote>Separately installed 2.5.2 RT Engine. The app.server - Websphere 6.1.<br />
Interesting thing is that when I view the report in Eclipse (more precisely - WebSphere Integration Developer 6.2) and then export the report to Excel - everything is fine, all columns are at place.
JasonW
Can you set the log level to warning and post the log? Also can you close the report document after using it?
theRDoc.close();
ret.close();
Jason
ypetrov
First, thanks for noticing the unclosed document
Second - log.
I've set the FINEST level for the loggers org.eclipse.birt.core.* and org.eclipse.birt.report.*
I didn't touch org.eclipse.birt.chart.* and org.eclipse.birt.data.*
Below is what I get. Strange thing that I see there is that html emitter honestly traces its activity, but not even a single word from excel emitter, though org.eclipse.birt.report.emitter.excel.* loggers are set to FINEST. So, here is the log (slightly trimmed - I deleted 99% of the traced data fetch)
[6/7/10 14:36:28:687 EDT] 0000002b ReportEngine 1 ReportEngine.openReportDesign: designStream=java.io.FileInputStream@11361136
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 ReportEngine.createGetParameterDefinitionTask: reportRunnable=org.eclipse.birt.report.engine.api.impl.ReportRunnable@14a214a2
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 EngineTask.setAppContext: context=
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 ReportEngine.createRunTask: reportRunnable=org.eclipse.birt.report.engine.api.impl.ReportRunnable@14a214a2
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 EngineTask.setAppContext: context=
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: DateFrom=1/1/10 12:00 AM [java.sql.Date]
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: DateTo=12/1/10 12:00 AM [java.sql.Date]
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: UnitNumber=0101 [java.lang.String]
[6/7/10 14:36:29:031 EDT] 0000002b ReportEngine 1 Running the report with paramters: Scope:r
UnitNumber:0101
DateFrom:2010-01-01
DateTo:2010-12-01
[6/7/10 14:36:30:640 EDT] 0000002b ModelAdapter W handle type: org.eclipse.birt.report.model.api.OdaDataSetHandle
...
ypetrov - Data fetch trace was here
...
[6/7/10 14:36:31:093 EDT] 00000120 Connection 1 org.eclipse.birt.report.data.oda.jdbc.Connection close Connection closed.
[6/7/10 14:36:31:093 EDT] 0000002b ReportEngine 1 ReportEngine.openReportDocument: fileName=c:/temp/rep.rptdoc
[6/7/10 14:36:31:093 EDT] 0000002b ReportEngine 1 ReportEngine.createRenderTask: reportDocument=org.eclipse.birt.report.engine.api.impl.ReportDocumentReader@33dc33dc
[6/7/10 14:36:31:093 EDT] 0000002b ReportEngine 1 EngineTask.setAppContext: context=
[6/7/10 14:36:31:093 EDT] 0000002b ReportEngine 1 ReportEngine.openReportDesign: name=<stream>, designStream=org.eclipse.birt.core.archive.compound.ArchiveEntryInputStream@4a9a4a9a, options={3}
[6/7/10 14:36:31:312 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: DateFrom=1/1/10 12:00 AM [java.sql.Date]
[6/7/10 14:36:31:312 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: DateTo=12/1/10 12:00 AM [java.sql.Date]
[6/7/10 14:36:31:312 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: UnitNumber=0101 [java.lang.String]
[6/7/10 14:36:31:327 EDT] 0000002b ModelAdapter W handle type: org.eclipse.birt.report.model.api.OdaDataSetHandle
[6/7/10 14:36:31:359 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start emitter.
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start table
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start foreign
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] End table
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start table
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:827 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start foreign
[6/7/10 14:36:31:843 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start foreign
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start table
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:859 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] Start cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] Start text
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] End table
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End cell.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLTableEmitter] End table
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End page.
[6/7/10 14:36:31:874 EDT] 0000002b HTMLReportEmi 1 [HTMLReportEmitter] End body.
[6/7/10 14:37:21:390 EDT] 0000002b ReportEngine 1 ReportEngine.openReportDocument: fileName=c:/temp/rep.rptdoc
[6/7/10 14:37:21:406 EDT] 0000002b ReportEngine 1 ReportEngine.createRenderTask: reportDocument=org.eclipse.birt.report.engine.api.impl.ReportDocumentReader@19d019d0
[6/7/10 14:37:21:406 EDT] 0000002b ReportEngine 1 EngineTask.setAppContext: context=
[6/7/10 14:37:21:406 EDT] 0000002b ReportEngine 1 ReportEngine.openReportDesign: name=<stream>, designStream=org.eclipse.birt.core.archive.compound.ArchiveEntryInputStream@308e308e, options={3}
[6/7/10 14:37:21:609 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: DateFrom=1/1/10 12:00 AM [java.sql.Date]
[6/7/10 14:37:21:609 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: DateTo=12/1/10 12:00 AM [java.sql.Date]
[6/7/10 14:37:21:609 EDT] 0000002b ReportEngine 1 EngineTask.setParameterValue: UnitNumber=0101 [java.lang.String]
[6/7/10 14:37:21:625 EDT] 0000002b ModelAdapter W handle type: org.eclipse.birt.report.model.api.OdaDataSetHandle
JasonW
I do not see anything obvious. There is nothing wrong with your code, I ran the same code on one of my examples and everthing came trough. Do you have any visibility expressions set in the report? Can you try with another report? Also can you try runandrender task?
Jason
ypetrov
Solved by downgrading to BIRT 2.3.2.