Render while report is generated [message #791333] |
Sun, 05 February 2012 17:10 |
harip kaligo Messages: 74 Registered: July 2011 |
Member |
|
|
Hi,
We need to render report while report is being generated. For example, we have some 100 pages of report and first three pages are rendered, we need to display the three pages rendered and the rest as they are rendered. We need this as the customer need not wait for the entire report to be rendered.
we are using report tag to display the rptdocument.We also use run and then render options to generate reports.
Environment:
Jdk:1.5
BIRT3.7
Weblogic 10.0.2
Any ideas or sample program on how to implement this would be of great help.
Also, what does task.enableProgressiveViewing() does?
Thanks,
KKP
[Updated on: Mon, 06 February 2012 11:19] Report message to a moderator
|
|
|
Re: Render while report is generated [message #792367 is a reply to message #791333] |
Mon, 06 February 2012 23:15 |
|
Currently the open source viewer does not have that feature. Actuate's
commercial viewer does though.
Jason
On 2/5/2012 12:10 PM, kkp Mising name wrote:
> Hi,
>
> We need to render report while report is being generated. For example,
> we have some 100 pages of report and first three pages are rendered, we
> need to display the three pages rendered and the rest as they are
> rendered. We need this as the customer need not wait for the entire
> report to be rendered.
>
> we are using report tag to display the rptdocument.We also use run and
> then render options to generate reports.
>
> Environment:
> Jdk:1.5
> BIRT3.7
> Weblogic 10.0.2
>
> Any ideas or sample program on how to implement this would be of great
> help.
>
> Thanks,
> KKP
|
|
|
|
|
|
Re: Render while report is generated [message #870808 is a reply to message #870768] |
Wed, 09 May 2012 18:30 |
|
Aleksey,
That feature has not changed. That reply was in relation to the viewer
framework I believe.
Jason
On 5/9/2012 11:06 AM, ivkina Mising name wrote:
> Jason,
> Viewing report while it is still being built works for us in 3.7.1. It
> is achieved by this line of code called on IRunTask:
> task.enableProgressiveViewing(true);
>
> Are you saying that this feature is not supported anymore in 3.7.2 and
> going forward and only Actuate BIRT supports that? This is
> important...could you please confirm 100%?
>
> Thanks,
> Aleksey
>
> IReportRunnable design = engine.openReportDesign(rox);
> // change design time settings via Birt Designer API
> BirtDesignHandle designHandle = new BirtDesignHandle(design);
> // tables - comment for now as this changes the sort order
> // designHandle.processTables();
> // pages
> designHandle.processPages(buildReq);
> // create run task
> IRunTask task = engine.createRunTask(design);
> // locale
> task.setLocale(Utils.buildLocaleInstance(buildReq.getString(buildReq.LOCALE)));
>
> // set report execution parameters in report bean so these can be
> // accessed by BIRT runtime on start report build.
> setReportExecutionParmsInRptEJB(buildReq);
> task.setParameterValue(APP_DATA_PARM,
> buildReportExcecutionParms(buildReq));
> // progressive view -> true for preview; false for print
> task.enableProgressiveViewing(buildReq.getboolean(buildReq.PRGR_VIEW));
> // page handler
> task.setPageHandler(new BirtPageHandler(buildReq, logger));
> // task info
> BirtTaskInfo taskInfo = new BirtTaskInfo(roi);
> taskInfo.setRunTask(task);
> res.set(res.VIEW_STATE_INFO, taskInfo);
> res.set(res.JOB_ID, new Integer(task.getID()));
> // run task
> WorkManager workManager = birtEngine.getWorkManager();
> workManager.startWork(new BirtTaskRunnable(taskInfo));
|
|
|
|
|
|
Re: Render while report is generated [message #957626 is a reply to message #791333] |
Thu, 25 October 2012 11:17 |
Saurabh Puri Messages: 10 Registered: February 2012 |
Junior Member |
|
|
Hi..
I am trying to display the report on report viewer and at the same time i am trying to render the report as pdf to save automatically to a folder on server....
My report extends to multiple pages and the problem is that when i press next button on Birtviewer, it renders again to create another copy of pdf. (so if my report has 10 pages, it creates 10 copies of same report in pdf in that folder)
I tried setting a global variable which i can use in the if condition to run the beforerender() code once, but somehow it doesnt seem to be working fine.
Please let me know the way out of this.
This is the code i am using to render as pdf (placed under beforeRender function)
if(reportContext.getPersistentGlobalVariable('g_var').equals("1"))
{
reportContext.setPersistentGlobalVariable("g_var","2");
mmap = reportContext.getHttpServletRequest().getAttribute("attributeBean").getModuleOptions();
rptdoc = reportContext.getHttpServletRequest().getAttribute("attributeBean").getReportDocumentName();
importPackage(Packages.org.eclipse.birt.report.engine.api);
importPackage(Packages.java.io)
var re = reportContext.getReportRunnable().getReportEngine();
var mdocument = re.openReportDocument(null,rptdoc, mmap);
var options = new PDFRenderOption();
baos = new ByteArrayOutputStream();
options.setOutputFormat("pdf");
options.setOutputStream(baos);
var ntask = re.createRenderTask(mdocument);
ntask.setRenderOption(options);
ntask.render();
ntask.close();
mdocument.close();
str = "blabla";
success1 = (new File("../webapps/ReportGen/BIRTReports")).mkdir(); //create directory
var path = "myreport_" + str;
fout = new FileOutputStream("../webapps/ReportGen/BIRTReports/"+path); //This name needs to be dynamic
fout.write(baos.toByteArray());
fout.flush();
fout.close();
//g_var = "2";
}
Thanks
[Updated on: Thu, 25 October 2012 11:18] Report message to a moderator
|
|
|
|
Re: Render while report is generated [message #1077325 is a reply to message #989237] |
Thu, 01 August 2013 14:39 |
Rahul Kumar Messages: 8 Registered: December 2012 |
Junior Member |
|
|
BIRT 4.2.1
I have added the below piece of code in the constructor of RunTask class to achieve the progressive viewing..
executionContext.enableProgressiveViewing(true);
Will this achieve the progressive viewing ?
I am also facing problems while deploying jar back into my project. Though the jar file is imported successfully into the project, BIRT Execption is being thrown.
Any suggestions please
Regards
Rahul
|
|
|
Powered by
FUDForum. Page generated in 0.04069 seconds