Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Render while report is generated(Render while report is generated)
Render while report is generated [message #791333] Sun, 05 February 2012 17:10 Go to next message
harip kaligo is currently offline harip kaligoFriend
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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #867213 is a reply to message #792367] Tue, 01 May 2012 07:17 Go to previous messageGo to next message
sam va is currently offline sam vaFriend
Messages: 121
Registered: July 2011
Senior Member
We have achieved this with custom code.
Re: Render while report is generated [message #870768 is a reply to message #792367] Wed, 09 May 2012 15:05 Go to previous messageGo to next message
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
Registered: April 2012
Member
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 #870773 is a reply to message #867213] Wed, 09 May 2012 15:24 Go to previous messageGo to next message
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
Registered: April 2012
Member
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 #870808 is a reply to message #870768] Wed, 09 May 2012 18:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #871036 is a reply to message #870808] Thu, 10 May 2012 15:22 Go to previous messageGo to next message
ivkina Mising name is currently offline ivkina Mising nameFriend
Messages: 44
Registered: April 2012
Member
got it, thanks!
Re: Render while report is generated [message #932454 is a reply to message #871036] Thu, 04 October 2012 05:45 Go to previous messageGo to next message
Vijay Patel is currently offline Vijay PatelFriend
Messages: 3
Registered: October 2012
Junior Member
hi,

please mention where to change the code, and add this single line of code.
is it rptdesign file or any java file.

please reply, I need this information.

thank you very much.
Re: Render while report is generated [message #932980 is a reply to message #932454] Thu, 04 October 2012 16:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

That is Java code when using the BIRT report engine APIs

Jason
Re: Render while report is generated [message #957626 is a reply to message #791333] Thu, 25 October 2012 11:17 Go to previous messageGo to next message
Saurabh Puri is currently offline Saurabh PuriFriend
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 #989237 is a reply to message #791333] Wed, 05 December 2012 10:23 Go to previous messageGo to next message
Saurabh Puri is currently offline Saurabh PuriFriend
Messages: 10
Registered: February 2012
Junior Member
Hi,

I am rendering the pdf file to a location on server.

Is there any way to avoid rendering the report to pdf file again & again while one scroll through different pages of report on birtviewer?

Thanks

Saurabh
Re: Render while report is generated [message #1077325 is a reply to message #989237] Thu, 01 August 2013 14:39 Go to previous message
Rahul KumarFriend
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
Previous Topic:barcode via Dynamic Image
Next Topic:Building the designer, Nullpointer in DEUtil.java
Goto Forum:
  


Current Time: Tue Mar 19 04:31:19 GMT 2024

Powered by FUDForum. Page generated in 0.02954 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top