问题描述:

I am generating ad-hoc reports on the fly in a servlet. I see how to send a report back as HTML or PDF. Does the BIRT API support other formats? The BIRT runtime app performs these exports, but I don't see anything in the API.

网友答案:

Yes, Word and Excel are both supported(either 2003 and 2007) by birt engine.

You can set it into Report engine options :

HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat("xls");

task.setRenderOption(options);
网友答案:

From tomcat, you can render it in these outputs by setting the url format parameter:

html:

http://server:8080/birt/output?__report=myReport.rptdesign&__format=html

pdf:

http://server:8080/birt/output?__report=myReport.rptdesign&__format=pdf

word doc:

http://server:8080/birt/output?__report=myReport.rptdesign&__format=doc

excel:

http://server:8080/birt/output?__report=myReport.rptdesign&__format=xls

The last two (doc and xls) don't render in-line on the page, it downloads the word .doc or .xls to the client computer.

相关阅读:
Top