Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Dynamic report::how to display report output in a frameset
Dynamic report::how to display report output in a frameset [message #637967] Tue, 09 November 2010 13:53 Go to next message
bhanu prakash is currently offline bhanu prakash
Messages: 3
Registered: July 2009
Junior Member
Hi,

I hope this is right forum to ask my question. As per my requirement I need to generate dynamic reports using BIRT 2.6.1 API, In Servlet when I run the report using IRunAndRenderTask.run() method report output is displayed without a frameset in browser. Please let me know the steps or API methods/parameters to display the report in a BIRT default frameset. Below is a snapshot of my code thanks in advances.



public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

//get report name and launch the engine
response.setContentType("text/html");
String reportName = request.getParameter("ReportName");
String[] cols = (String[])request.getParameterMap().get("dyna1");
ServletContext sc = request.getSession().getServletContext();
this.birtReportEngine = BirtEngine.getBirtEngine(sc);

IReportRunnable design;
try
{
//Open report design
design = birtReportEngine.openReportDesign(reportName );
ReportDesignHandle report = (ReportDesignHandle) design.getDesignHandle();
buildReport( cols, report );

//create task to run and render report
IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask( design);
task.setAppContext(new HashMap());

//set output options
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML) ;
options.setOutputStream(response.getOutputStream());
task.setRenderOption(options);

//run report
task.run();
task.close();
}catch (Exception e){
throw new ServletException( e );
}
}

Re: Dynamic report::how to display report output in a frameset [message #637985 is a reply to message #637967] Tue, 09 November 2010 14:47 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

The frameset is actually built into the viewer using jsp fragments and
AJAX and is a lot of code. Why not include the viewer in your app?

Jason

On 11/9/2010 8:53 AM, bhanu prakash wrote:
> Hi,
>
> I hope this is right forum to ask my question. As per my requirement I
> need to generate dynamic reports using BIRT 2.6.1 API, In Servlet when I
> run the report using IRunAndRenderTask.run() method report output is
> displayed without a frameset in browser. Please let me know the steps or
> API methods/parameters to display the report in a BIRT default frameset.
> Below is a snapshot of my code thanks in advances.
>
>
> public void doGet(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException {
>
> //get report name and launch the engine
> response.setContentType("text/html");
> String reportName = request.getParameter("ReportName");
> String[] cols = (String[])request.getParameterMap().get("dyna1");
> ServletContext sc = request.getSession().getServletContext();
> this.birtReportEngine = BirtEngine.getBirtEngine(sc);
>
> IReportRunnable design;
> try
> {
> //Open report design
> design = birtReportEngine.openReportDesign(reportName );
> ReportDesignHandle report = (ReportDesignHandle)
> design.getDesignHandle(); buildReport( cols, report );
>
> //create task to run and render report
> IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask( design);
> task.setAppContext(new HashMap());
>
> //set output options
> HTMLRenderOption options = new HTMLRenderOption();
> options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML) ;
> options.setOutputStream(response.getOutputStream());
> task.setRenderOption(options);
>
> //run report
> task.run();
> task.close();
> }catch (Exception e){
> throw new ServletException( e );
> }
> }
>
>
Re: Dynamic report::how to display report output in a frameset [message #638222 is a reply to message #637985] Wed, 10 November 2010 14:59 Go to previous message
bhanu prakash is currently offline bhanu prakash
Messages: 3
Registered: July 2009
Junior Member
Hi Jason,

Thanks for the response.

The reason for using the BIRT API is that report columns and there data content will be dynamically coming from the database so I need to add the respective information in the report.In my application reports can be a letter type or simple grid type and user can export data in different formats (PDF,word,excel ).I can use the frameset viewer but the problem is I need to populate data dynamically to the reports before it renders to the user.

Please let me know your thoughts on the above requirement.

-Bhanu

[Updated on: Wed, 10 November 2010 15:04]

Report message to a moderator

Previous Topic:Input text field on birt report
Next Topic:Scaling Multiple Bar Charts
Goto Forum:
  


Current Time: Sun Oct 26 08:49:51 GMT 2014

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

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