Excel Sheet Generation [message #156008] |
Tue, 25 April 2006 12:54 |
Eclipse User |
|
|
|
Originally posted by: mujahid_basha.rediffmail.com
Hi,
I could able to generate HTML and PDF reports for my web application using
BIRT Report Engine API.
Could any one explain me how to generate Excel sheets using BIRT Report
Engine.
The following is the code I used to generate my report in PDF. I tried
changing the contentType in response.setContentType() also, but, no use.
****************** Code Starts HERE *********************************
Engine Configuration - set and get temp dir, BIRT home, Servlet context
EngineConfig config = new EngineConfig();
config.setEngineHome(context.getRealPath("WEB-INF"));
// Create the report engine
ReportEngine engine = new ReportEngine(config);
// Open a report design - use design to modify design, retrieve
embedded images etc.
IReportRunnable design = null;
try {
design =
engine.openReportDesign(context.getRealPath("config/MY_Report.rptdesign "));
} catch (EngineException e1) {
e1.printStackTrace();
}
// Create task to run the report - use the task to execute and run the
report,
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
// set content type
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment;
filename=\"Unbillable.pdf;");
// Set rendering options - such as file or stream output,
// output format, whether it is embeddable, etc
HTMLRenderOption options = new HTMLRenderOption();
try {
outputStream = response.getOutputStream();
options.setOutputFormat("pdf");
options.setOutputStream(outputStream);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
task.setRenderOption(options);
// run the report
try {
task.run();
} catch (EngineException e) {
e.printStackTrace();
}
// Shut down the engine.
engine.destroy( );
****************** Code Ends HERE *********************************
|
|
|
Re: Excel Sheet Generation [message #193922 is a reply to message #156008] |
Tue, 03 October 2006 18:26 |
Krishna Venkatraman Messages: 1476 Registered: July 2009 |
Senior Member |
|
|
Hi Mujahid,
BIRT currently does not support Excel output from a BIRT report. If it
did, how do you envision using the Excel after it has been emitted?
* How important is the formatting in the Excel output?
* Do you expect all tables in a report to be dumped out in Excel?
* How about multiple work sheets from the report?
* Any other thoughts on the use case?
* Do you expect to be doing a lot of calculations and other traditional
Excel like manipulations of data?
Thanks much!
Krishna
Mujahid wrote:
> Hi,
> I could able to generate HTML and PDF reports for my web application
> using BIRT Report Engine API.
> Could any one explain me how to generate Excel sheets using BIRT Report
> Engine.
> The following is the code I used to generate my report in PDF. I tried
> changing the contentType in response.setContentType() also, but, no use.
>
>
> ****************** Code Starts HERE *********************************
> Engine Configuration - set and get temp dir, BIRT home, Servlet context
> EngineConfig config = new EngineConfig();
> config.setEngineHome(context.getRealPath("WEB-INF"));
>
> // Create the report engine
> ReportEngine engine = new ReportEngine(config);
>
> // Open a report design - use design to modify design, retrieve
> embedded images etc. IReportRunnable design = null;
> try {
> design =
> engine.openReportDesign(context.getRealPath("config/MY_Report.rptdesign "));
> } catch (EngineException e1) {
> e1.printStackTrace();
> }
>
> // Create task to run the report - use the task to execute and
> run the report,
> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
> // set content type
> response.setContentType("application/pdf");
>
>
> response.setHeader("Content-Disposition", "attachment;
> filename=\"Unbillable.pdf;");
> // Set rendering options - such as file or stream output,
> // output format, whether it is embeddable, etc
> HTMLRenderOption options = new HTMLRenderOption();
> try {
> outputStream = response.getOutputStream();
> options.setOutputFormat("pdf");
> options.setOutputStream(outputStream);
> } catch (IOException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
> task.setRenderOption(options);
>
> // run the report
> try {
> task.run();
> } catch (EngineException e) {
> e.printStackTrace();
> }
>
> // Shut down the engine.
>
> engine.destroy( );
> ****************** Code Ends HERE *********************************
>
>
|
|
|
Re: Excel Sheet Generation [message #193938 is a reply to message #193922] |
Tue, 03 October 2006 18:35 |
Mauro R. Ubeda Messages: 33 Registered: July 2009 |
Member |
|
|
Hi, i will give my opnion too for this topic.
* How important is the formatting in the Excel output?
Very!!! Sales & Administration Department on my company use excel
very very often.
* Do you expect all tables in a report to be dumped out in Excel?
Yes.
* How about multiple work sheets from the report?
Mmm, i am not sure about it.
* Any other thoughts on the use case?
I am thinking on charts but is not a critical issue, because i can do it
on excel.
* Do you expect to be doing a lot of calculations and other traditional
Excel like manipulations of data?
Yes, data on Excel is easy to manipulate and customize.
Thanks,
Mauro Ubeda
Krishna Venkatraman wrote:
> Hi Mujahid,
>
> BIRT currently does not support Excel output from a BIRT report. If it
> did, how do you envision using the Excel after it has been emitted?
>
> * How important is the formatting in the Excel output?
>
> * Do you expect all tables in a report to be dumped out in Excel?
>
> * How about multiple work sheets from the report?
>
> * Any other thoughts on the use case?
>
> * Do you expect to be doing a lot of calculations and other traditional
> Excel like manipulations of data?
>
> Thanks much!
>
> Krishna
>
>
>
>
> Mujahid wrote:
>> Hi,
>> I could able to generate HTML and PDF reports for my web application
>> using BIRT Report Engine API.
>> Could any one explain me how to generate Excel sheets using BIRT
>> Report Engine.
>> The following is the code I used to generate my report in PDF. I tried
>> changing the contentType in response.setContentType() also, but, no use.
>>
>>
>> ****************** Code Starts HERE *********************************
>> Engine Configuration - set and get temp dir, BIRT home, Servlet context
>> EngineConfig config = new EngineConfig();
>> config.setEngineHome(context.getRealPath("WEB-INF"));
>>
>> // Create the report engine
>> ReportEngine engine = new ReportEngine(config);
>>
>> // Open a report design - use design to modify design, retrieve
>> embedded images etc. IReportRunnable design = null;
>> try {
>> design =
>> engine.openReportDesign(context.getRealPath("config/MY_Report.rptdesign "));
>>
>> } catch (EngineException e1) {
>> e1.printStackTrace();
>> }
>>
>> // Create task to run the report - use the task to execute and
>> run the report,
>> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
>> // set content type
>> response.setContentType("application/pdf");
>>
>> response.setHeader("Content-Disposition", "attachment;
>> filename=\"Unbillable.pdf;");
>> // Set rendering options - such as file or stream output,
>> // output format, whether it is embeddable, etc
>> HTMLRenderOption options = new HTMLRenderOption();
>> try {
>> outputStream = response.getOutputStream();
>> options.setOutputFormat("pdf");
>> options.setOutputStream(outputStream); }
>> catch (IOException e1) {
>> // TODO Auto-generated catch block
>> e1.printStackTrace();
>> }
>> task.setRenderOption(options);
>> // run the report
>> try {
>> task.run(); } catch (EngineException e)
>> { e.printStackTrace();
>> }
>>
>> // Shut down the engine.
>> engine.destroy( );
>> ****************** Code Ends HERE *********************************
>>
|
|
|
Powered by
FUDForum. Page generated in 0.02563 seconds