Community
Participate
Working Groups
Build Identifier: 2.5.2 I use BIRT report engine API to generate MS word, when I upgrade to BIRT 2.5.2 release(org.eclipse.birt.report.engine_2.5.2.v20100210.jar), BIRT always hangs when render rptdocument to MS word. I used to use BIRT org.eclipse.birt.report.engine_2.2.2.r22x_v20080107.jar, it works fine for us. I will upload rptdocument file for your debugging. Reproducible: Always
Created attachment 176661 [details] The rptdocument file
(In reply to comment #1) > Created an attachment (id=176661) [details] > The rptdocument file Hi, I can not reproducing this issue using ReportEngine 2.5.2 release. Commandline I was using: E:\test\Release Build\2_5_2\ReportEngine>genReport.bat -m render -f doc -o test. doc "Config A.rptdocument" The document was rendered into 10 doc files successfully.
Created attachment 176877 [details] the patch
Created attachment 176878 [details] the patch
Hi Xiaoying, Thanks very much for your quickly response! Where did you get genReport.bat? can I download it from BIRT site? Actually, I use a 2.5.2 BIRT engine with two patches by ourselves 1. https://bugs.eclipse.org/bugs/show_bug.cgi?id=316239 2. https://bugs.eclipse.org/bugs/show_bug.cgi?id=316240 I will upload those patches, and source/binary BIRT engine patched with those two patches. 1. bugzilla-316239-patch.txt 2. bugzilla-316240-patch.txt 3. org.eclipse.birt.report.engine.zip : the source code of BIRT report engine, patched with those two patches. 4. org.eclipse.birt.report.engine_2.5.2.v20100805.jar : the binary one we use. Thanks again, --Alex
Hi Xiaoying, The last two source/binary of BIRT engine are two big for bugzilla, I can't upload them as attachment. I will send you by email, thanks for understanding. Thanks, --Alex
I can generate ms doc success with my own binary patched BIRT report engine using BIRT runtime, so I think the hanging issue maybe cause by some options I use in our render code. Seems this bug relate to: https://bugs.eclipse.org/bugs/show_bug.cgi?id=308155 Thanks, --Alex
(In reply to comment #5) > Where did you get genReport.bat? can I download it from BIRT site? genReport.bat is shipped in birt-runtime package. You can find it under ReportEngine directory.
Alex, Can you show us the render options you set? Can you reproduce this problem on latest BIRT?
Hi, Below is the code I used to render rptdocument, but unfortunately, I still hangs during render even I comment out all those doubtable options. Thanks, --Alex public void doPresentation(IProgressMonitor monitor){ if(status == IStatus.ERROR) return; IReportDocument doc = null; try { // doc = engine.openReportDocument(docFile); doc = ReportDocument.getInstance(engine, docFile, toc); } catch (EngineException e1) { PublishDocPlugin.getDefault().getLogger().logError(e1); } renderTask = engine.createRenderTask(doc); RenderOption option = new RenderOption(); // option.setOption(PDFRenderOption.FIT_TO_PAGE, true); // option.setOption(PDFRenderOption.PAGEBREAK_PAGINATION_ONLY, false); // option.setOption(PDFRenderOption.HTML_PAGINATION, false); output = options.getOutputFilename(); option.setOutputFileName(output); if(options.getOutputFormat()==PublishDocOptions.OUTPUT_FORMAT_PDF) option.setOutputFormat(IRenderOption.OUTPUT_FORMAT_PDF); else if(options.getOutputFormat()==PublishDocOptions.OUTPUT_FORMAT_MSWORD) option.setOutputFormat("doc"); //$NON-NLS-1$ option.setSupportedImageFormats("JPG;PNG;BMP;SVG"); //$NON-NLS-1$ // option.setOption("htmlPagination", Boolean.TRUE); //$NON-NLS-1$ renderTask.setRenderOption(option); monitor.subTask(PublishingDocResource.renderingReport); renderTask.setAppContext(new HashMap()); Runnable runnable = new Runnable(){ public void run() { try { // Context.enter(); renderTask.render(); // Context.exit(); } catch (EngineException e) { PublishDocPlugin.getDefault().getLogger().logError(e); } } }; Thread th = new Thread(runnable); th.start(); while(renderTask.getStatus()==IEngineTask.STATUS_NOT_STARTED || renderTask.getStatus()==IEngineTask.STATUS_RUNNING){ if(monitor.isCanceled()){ renderTask.cancel(); } try { Thread.sleep(100); } catch (InterruptedException e) { PublishDocPlugin.getDefault().getLogger().logError(e); } } // renderTask.close(); doc.close(); if(renderTask.getStatus()==IEngineTask.STATUS_SUCCEEDED) status = IStatus.OK; renderTask = null; }
Hi Xiaoying/Jun, Use the function I provide to render the rptdocument I attached, BIRT always hangs. Please test it. Thanks much, --Alex
1. Use the method I provided, BIRT render will hang at: Class: /org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/html/HTMLPageLM.java lines: boolean hasNextPage = layoutNodes( ); ******************************************************** public boolean layout( ) throws BirtException { if ( context.getCancelFlag( ) ) { close( ); isLastPage = true; return false; } start( isFirstPage ); boolean hasNextPage = layoutNodes( ); if ( isChildrenFinished( ) ) { isLastPage = true; } isFirstPage = false; end( isLastPage ); context.initilizePage( ); return hasNextPage; } ********************************************************* 2. If open the comment in my method line: option.setOption(PDFRenderOption.HTML_PAGINATION, false); Then the render will be OK. 3. Could you please explain the HTML_PAGINATION to me? and is it a BIRT bug? Thanks, --Alex
Sorry, the above item 2 should be: 2. If open the comment in my method line: option.setOption("htmlPagination", Boolean.TRUE); Then the render will be OK.
option.setOption(PDFRenderOption.HTML_PAGINATION, false); and option.setOption("htmlPagination", Boolean.TRUE); are the same thing. If I set option.setOption(PDFRenderOption.HTML_PAGINATION, true); Then I can render ms doc correctly, but I still failed on render to pdf. Could you guys help me on this? Thanks, --Alex
I check the different between /org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/api/ReportRunner.java and my code, the different is ReportRunner only create doc/pdf page by page, but my code generate a whole doc/pdf. For example: try { renderTask.setPageRange(1); renderTask.render(); } catch (EngineException e) { e.printStackTrace(); } works for me, both pdf and doc. but try { renderTask.setPageRange("ALL"); renderTask.render(); } catch (EngineException e) { e.printStackTrace(); } didn't work. If I set option.setOption(PDFRenderOption.HTML_PAGINATION, true), then doc works, but pdf still doesn't work. Thanks, --Alex
The onRender( ) script of text item( id="1427114657") causes the endless loop.
sorry, the text item id is 1427112705.
Hi Albert, Thanks for response, do you have any idea on how to fix it? since I can generate rptdocument correctly, I don't think it's an issue of our report design, right? Cheers, --Alex
Also, this is an regression issue, because it works well on Eclipse 3.3.2 , and right now we upgrade our product to Eclipse 3.5.2. --Alex
Alert, Which statement in the onRender causes the endless loop? Is it a BIRT API or call or user's scripts? If it is BIRT API, we need fixed in 2.6.1. If it is the user's script, can you investigate what changes cause the issue?
It's the user's script leads the endless loop. It seems it occurs around here: while(itor!=""){ for(var i=0;i<count;i++){ if(itor==guids[i]){ sortedResult[c]=PNames[i]==""?names[i]:PNames[i]; c++; activityNum=c; itor=superActivities[i]; } } } Alex, could you check the logic of the script? Because the same report document works well if you try to render it page by page.
Hi Albert, 1. I will check our rptlibrary. 2. Could you please explain why the option below will cause different result when render to ms doc? option.setOption(PDFRenderOption.HTML_PAGINATION, true); ---> success option.setOption(PDFRenderOption.HTML_PAGINATION, false); ---> fail 3. why the render works well under Eclipse 3.3.2? Thanks, --Alex
(In reply to comment #21) > It's the user's script leads the endless loop. > > It seems it occurs around here: > > while(itor!=""){ > for(var i=0;i<count;i++){ > if(itor==guids[i]){ > sortedResult[c]=PNames[i]==""?names[i]:PNames[i]; > c++; > activityNum=c; > itor=superActivities[i]; > } > } > } > > Alex, could you check the logic of the script? Because the same report document > works well if you try to render it page by page. Hi Albert, I've removed the row from our report library which contains the script you indicated, but the pdf generating still hangs. Please see the attached report library and report document. thanks, --Alex
Created attachment 177294 [details] the new report document
Created attachment 177295 [details] the report library which removed script
Created attachment 177296 [details] The original report library
This time it hangs at the onRender script of text item 1427112717. Actually, this section of script has many copies in the report. Since it will not cause endless loop if the report is rendered page by page, is the pagination affects the value of the variables in the script? Could you debug into the two cases, and find out the difference of the variable value?
(In reply to comment #27) > This time it hangs at the onRender script of text item 1427112717. > > Actually, this section of script has many copies in the report. Since it will > not cause endless loop if the report is rendered page by page, is the > pagination affects the value of the variables in the script? Could you debug > into the two cases, and find out the difference of the variable value? Thanks Albert, I will investigate and post you the result. Cheers, --Alex
Hi BIRT guys, This issue has been fixed, it caused by the endless loop in javascript code of our report library. thank very much for all of your help!! --Alex
Since the issue is resolved, close the bug.