|
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 |
|
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 |
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
|
|
|
Powered by
FUDForum. Page generated in 0.02590 seconds