Re: DownloadLink, BIRT report
Hi, I already wrote to you in private and didn't noticed you were also posting to the list... Here is the transcript of my last two private e-mails . You have to download the BIRT runtime from http://download.eclipse.org/birt/downloads/ This is what you have to deploy with your WEB application. The runtime is like an eclipse (an equinox OSGi runtime) but stripped of all the GUI thing and containing just the minimal functionality to execute BIRT reports: the designer but without the design part. That way the footprint is small as you have to distribute it with your WEB application. The code I showed you on the list was to instantiate this runtime from within your WEB application. Then you use that runtime to build your reports. In my experience, it is better if this runtime is the same version as the designer you used to build your reports (otherwise you might find unpleasant surprises). newbieabc wrote: > Thank you for your reply... > I am sorry to sound redundant... > I had started off by downloading the birt-all-in-one (came bundled with the > full Eclipse SDK). > Created a maven project( wicket quickstart) , then designed the birt > rptdesign (all within the eclipse platform) I run it outside eclipse, (mvn > jetty:run) > > Now, I have downloaded the birt runtime engine, and copied files from the > birtrunttime\ReportEngine\plugins to the eclipse\plugins > > But when I try to use "org.eclipse.birt.report.engine.api.ReportEngine" i > get "org.eclipse cannot be resolved" > > This error is because you have to copy some of the jar files on runtime/plugins to your classpath (and/or the WEB-INF/lib folder depending on how you setup your project). I have the following: /WEB-INF/lib/birt-chartengineapi-2.3.jar /WEB-INF/lib/birt-com.ibm.icu_3.8.1.v20080530.jar /WEB-INF/lib/birt-coreapi-2.3.jar /WEB-INF/lib/birt-crosstabcoreapi-2.3.jar /WEB-INF/lib/birt-dataadapterapi-2.3.jar /WEB-INF/lib/birt-dataaggregationapi-2.3.jar /WEB-INF/lib/birt-dteapi-2.3.jar /WEB-INF/lib/birt-emitter.prototype.excel_2.3.0.v20080606.jar /WEB-INF/lib/birt-engineapi-2.3.jar /WEB-INF/lib/birt-flute-2.3.jar /WEB-INF/lib/birt-js-2.3.jar /WEB-INF/lib/birt-modelapi-2.3.jar /WEB-INF/lib/birt-modelodaapi-2.3.jar /WEB-INF/lib/birt-odadesignapi-2.3.jar /WEB-INF/lib/birt-org.apache. commons.codec_1.3.0.v20080530-1600.jar /WEB-INF/lib/birt-org.eclipse.birt.report.engine.dataextraction_2.3.0.v20080611.jar /WEB-INF/lib/birt-org.eclipse.emf.common_2.4.0.v200806091234.jar /WEB-INF/lib/birt-org.eclipse.emf.ecore_2.4.0.v200806091234.jar /WEB-INF/lib/birt-org.eclipse.emf.ecore.xmi_2.4.0.v200806091234.jar /WEB-INF/lib/birt-org.w3c.css.sac_1.3.0.v200805290154.jar /WEB-INF/lib/birt-scriptapi-2.3.jar But maybe I'm missing in this list some related jars... Some of the jars on previous list have shortened names, not the names they have on the runtime/plugins folder, but I guess you will have no problems in finding them. If you don't add these jars then your IDE (eclipse?) won't be able to compile the "Birt" class of my first e-mail. Once the class compiles then try something simple (like building a hello world report). I forgot to mention this on my previous e-mails... Best, Ernesto > Not sure what I should do for this. > Thank you for your help..and again sorry to sound redundant, I am really new > to this. > > > reiern70 wrote: > >> Hi, >> >> For the BIRT part you need to install somewhere a BIRT runtime. >> Essentially, this an equinox OSGi runtime with a folder structure like: >> >> {root}-configuration` >> -plugins >> >> If you have extended BIRT by adding your own ODA extensions then you have >> to drop them on the plugins folder. There is also a folder (e.g. >> plugins/org.eclipse.birt.report.data.oda.jdbc_2.3.0.v20080610/drivers) >> where you have to drop any JDBC drivers you need to connect to your >> database (in case you are using standard ODA drivers). I usually install >> the BIRT runtime under WEB-INF... >> >> The next step is to have instantiate this runtime and use it to generate >> your reports. I do this via a class like the following: >> >> >> public class Birt { >> >> . >> >> private static IReportEngine engine; >> >> >> public static final void startEngine() { >> try { >> if(engine != null) >> return; >> >> EngineConfig engCnf = new EngineConfig(); >> >> >> engCnf.setEngineHome(ConfigGlobal.i.resuelveRuta("WEB-INF/birt").toString()); >> >> engCnf.setLogConfig(ConfigGlobal.i.resuelveRuta("../logs").toString(), >> Level.ALL); >> Platform.startup(engCnf); >> IReportEngineFactory factory = (IReportEngineFactory) >> Platform >> .createFactoryObject( >> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY ); >>
RE: DownloadLink, BIRT report
You should not need to copy anything to the eclipse\plugins since you downloaded Eclipse with Birt support. You will need to add the birt runtime jars into your eclipse project. They can be found in \ReportEngine\lib There are a couple ways to do this in eclipse: 1. Go to Build Path --> Configure Build Path --> Libraries. You can manually add jars with the Add External Jars button. You need at least 2 of the birt jars - engineapi.jar and coreapi.jar. You may need more depending on what functions you are using within birt. 2. If you want Maven to handle this, then you will need to add the artifacts manually to your local repository. The latest birt runtime 2.3.1 is not in a central repository. I added all the jars that you see in the \lib directory; a few where already there from the central repository. I then created a birt-2.3.1 artifact with a pom.xml that has all of the jars as dependencies. All I need to do then is add the birt-2.3.1 artifact to my project and all of the birt jars are automatically added. There may be other ways to do this too. I am new to Maven also. It took quite a bit of research to get this far. Good luck! --Tim -Original Message- From: newbieabc [mailto:newbie...@yahoo.com] Sent: Monday, January 05, 2009 11:16 AM To: users@wicket.apache.org Subject: Re: DownloadLink, BIRT report Thank you for your reply... I am sorry to sound redundant... I had started off by downloading the birt-all-in-one (came bundled with the full Eclipse SDK). Created a maven project( wicket quickstart) , then designed the birt rptdesign (all within the eclipse platform) I run it outside eclipse, (mvn jetty:run) Now, I have downloaded the birt runtime engine, and copied files from the birtrunttime\ReportEngine\plugins to the eclipse\plugins But when I try to use "org.eclipse.birt.report.engine.api.ReportEngine" i get "org.eclipse cannot be resolved" Not sure what I should do for this. Thank you for your help..and again sorry to sound redundant, I am really new to this. reiern70 wrote: > > Hi, > > For the BIRT part you need to install somewhere a BIRT runtime. > Essentially, this an equinox OSGi runtime with a folder structure like: > > {root}-configuration` > -plugins > > If you have extended BIRT by adding your own ODA extensions then you have > to drop them on the plugins folder. There is also a folder (e.g. > plugins/org.eclipse.birt.report.data.oda.jdbc_2.3.0.v20080610/drivers) > where you have to drop any JDBC drivers you need to connect to your > database (in case you are using standard ODA drivers). I usually install > the BIRT runtime under WEB-INF... > > The next step is to have instantiate this runtime and use it to generate > your reports. I do this via a class like the following: > > > public class Birt { > > . > > private static IReportEngine engine; > > > public static final void startEngine() { > try { > if(engine != null) > return; > > EngineConfig engCnf = new EngineConfig(); > > engCnf.setEngineHome(ConfigGlobal.i.resuelveRuta("WEB-INF/birt").toString()); > > engCnf.setLogConfig(ConfigGlobal.i.resuelveRuta("../logs").toString(), > Level.ALL); > Platform.startup(engCnf); > IReportEngineFactory factory = (IReportEngineFactory) > Platform > .createFactoryObject( > IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY ); > engine = factory.createReportEngine(engCnf); > engine.changeLogLevel( Level.OFF ); > } catch (Throwable ex) { > log.fatal("", ex); > } > } > > public static final void stopEngine() { > try { > engine.destroy(); > engine = null; > } catch (Exception e) { > } > } > > public static IReportEngine getEngine() { > if(engine == null) { > startEngine(); > } > return engine; > } > > > public static void generateBirtReport(String file, > String fmt, > OutputStream out, > IdSql area, > ReportInfo petA, > JSONObject parametros_Reporte, Locale locale, boolean > autoPageBreaking) > throws Exception { > Attachment attachment = Attachment.loadFromTable(file, area); > File tmpDir = > ConfigGlobal.i.resuelveRuta(LectorConfig.i.get()
Re: DownloadLink, BIRT report
Thank you for your reply... I am sorry to sound redundant... I had started off by downloading the birt-all-in-one (came bundled with the full Eclipse SDK). Created a maven project( wicket quickstart) , then designed the birt rptdesign (all within the eclipse platform) I run it outside eclipse, (mvn jetty:run) Now, I have downloaded the birt runtime engine, and copied files from the birtrunttime\ReportEngine\plugins to the eclipse\plugins But when I try to use "org.eclipse.birt.report.engine.api.ReportEngine" i get "org.eclipse cannot be resolved" Not sure what I should do for this. Thank you for your help..and again sorry to sound redundant, I am really new to this. reiern70 wrote: > > Hi, > > For the BIRT part you need to install somewhere a BIRT runtime. > Essentially, this an equinox OSGi runtime with a folder structure like: > > {root}-configuration` > -plugins > > If you have extended BIRT by adding your own ODA extensions then you have > to drop them on the plugins folder. There is also a folder (e.g. > plugins/org.eclipse.birt.report.data.oda.jdbc_2.3.0.v20080610/drivers) > where you have to drop any JDBC drivers you need to connect to your > database (in case you are using standard ODA drivers). I usually install > the BIRT runtime under WEB-INF... > > The next step is to have instantiate this runtime and use it to generate > your reports. I do this via a class like the following: > > > public class Birt { > > . > > private static IReportEngine engine; > > > public static final void startEngine() { > try { > if(engine != null) > return; > > EngineConfig engCnf = new EngineConfig(); > > > engCnf.setEngineHome(ConfigGlobal.i.resuelveRuta("WEB-INF/birt").toString()); > > engCnf.setLogConfig(ConfigGlobal.i.resuelveRuta("../logs").toString(), > Level.ALL); > Platform.startup(engCnf); > IReportEngineFactory factory = (IReportEngineFactory) > Platform > .createFactoryObject( > IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY ); > engine = factory.createReportEngine(engCnf); > engine.changeLogLevel( Level.OFF ); > > } catch (Throwable ex) { > log.fatal("", ex); > } > } > > public static final void stopEngine() { > try { > engine.destroy(); > engine = null; > } catch (Exception e) { > } > } > > public static IReportEngine getEngine() { > if(engine == null) { > startEngine(); > } > return engine; > } > > > public static void generateBirtReport(String file, > String fmt, > OutputStream out, > IdSql area, > ReportInfo petA, > JSONObject parametros_Reporte, Locale locale, boolean > autoPageBreaking) > throws Exception { > Attachment attachment = Attachment.loadFromTable(file, area); > File tmpDir = > ConfigGlobal.i.resuelveRuta(LectorConfig.i.get().getChild("dirs").getChild("tmp").getValue()); > // creating a resource locator that is capable of retrieving > libraries > // or images from the database... > DataBaseResourceLocator dataBaseResourceLocator = new > DataBaseResourceLocator(area); > IReportRunnable design = > getEngine().openReportDesign("test",attachment.getAsInputStream(), > dataBaseResourceLocator); > > updateDataSources((ReportDesignHandle)design.getDesignHandle().getModuleHandle(), > petA); > IRunAndRenderTask renderTask = > getEngine().createRunAndRenderTask(design); > RenderOption opcRend; > if ("pdf".equals(fmt)) { > PDFRenderOption opc = new PDFRenderOption(); > opc.setOutputFormat("pdf"); > //ReportDesignHandle designHandle = > (ReportDesignHandle)design.getDesignHandle().getModuleHandle(); > > //designHandle.setDisplayName(null); > // para reducir la pagina tal como sale desde el > diseñador BIRT > opc.setOption(PDFRenderOption.PAGEBREAK_PAGINATION_ONLY, > autoPageBreaking); > opc.setOption(PDFRenderOption.FIT_TO_PAGE, > autoPageBreaking); > > opcRend = opc; > } else if ("excel".equals(fmt)){ > // TODO: find if there is
Re: DownloadLink, BIRT report
Another thing: if your excel is not very complex you could also consider using [1] to generate it. Best, Ernesto 1-http://jexcelapi.sourceforge.net/ newbieabc wrote: > > The generation of the excel report. > I am really new to BIRT and wicket.. > I've created the BIRT report (report.rptdesign)(in eclipse) but need it to > be output as xls. > I'd really appreciate some help. > Thank you > > > reiern70 wrote: >> >> Sure you can... Which part is giving you problems? The generation of the >> excel report with BIRT? Or the creation of the link? >> >> Best, >> >> Ernesto >> >> newbieabc wrote: >>> Hello.. >>> How can create a download link on a webpage, that converts a BIRT report >>> to >>> excel format and downloads to client machine? >>> >>> Thank you. >>> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- View this message in context: http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21240273.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DownloadLink, BIRT report
Hi, For the BIRT part you need to install somewhere a BIRT runtime. Essentially, this an equinox OSGi runtime with a folder structure like: {root}-configuration` -plugins If you have extended BIRT by adding your own ODA extensions then you have to drop them on the plugins folder. There is also a folder (e.g. plugins/org.eclipse.birt.report.data.oda.jdbc_2.3.0.v20080610/drivers) where you have to drop any JDBC drivers you need to connect to your database (in case you are using standard ODA drivers). I usually install the BIRT runtime under WEB-INF... The next step is to have instantiate this runtime and use it to generate your reports. I do this via a class like the following: public class Birt { . private static IReportEngine engine; public static final void startEngine() { try { if(engine != null) return; EngineConfig engCnf = new EngineConfig(); engCnf.setEngineHome(ConfigGlobal.i.resuelveRuta("WEB-INF/birt").toString()); engCnf.setLogConfig(ConfigGlobal.i.resuelveRuta("../logs").toString(), Level.ALL); Platform.startup(engCnf); IReportEngineFactory factory = (IReportEngineFactory) Platform .createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY ); engine = factory.createReportEngine(engCnf); engine.changeLogLevel( Level.OFF ); } catch (Throwable ex) { log.fatal("", ex); } } public static final void stopEngine() { try { engine.destroy(); engine = null; } catch (Exception e) { } } public static IReportEngine getEngine() { if(engine == null) { startEngine(); } return engine; } public static void generateBirtReport(String file, String fmt, OutputStream out, IdSql area, ReportInfo petA, JSONObject parametros_Reporte, Locale locale, boolean autoPageBreaking) throws Exception { Attachment attachment = Attachment.loadFromTable(file, area); File tmpDir = ConfigGlobal.i.resuelveRuta(LectorConfig.i.get().getChild("dirs").getChild("tmp").getValue()); // creating a resource locator that is capable of retrieving libraries // or images from the database... DataBaseResourceLocator dataBaseResourceLocator = new DataBaseResourceLocator(area); IReportRunnable design = getEngine().openReportDesign("test",attachment.getAsInputStream(), dataBaseResourceLocator); updateDataSources((ReportDesignHandle)design.getDesignHandle().getModuleHandle(), petA); IRunAndRenderTask renderTask = getEngine().createRunAndRenderTask(design); RenderOption opcRend; if ("pdf".equals(fmt)) { PDFRenderOption opc = new PDFRenderOption(); opc.setOutputFormat("pdf"); //ReportDesignHandle designHandle = (ReportDesignHandle)design.getDesignHandle().getModuleHandle(); //designHandle.setDisplayName(null); // para reducir la pagina tal como sale desde el diseñador BIRT opc.setOption(PDFRenderOption.PAGEBREAK_PAGINATION_ONLY, autoPageBreaking); opc.setOption(PDFRenderOption.FIT_TO_PAGE, autoPageBreaking); opcRend = opc; } else if ("excel".equals(fmt)){ // TODO: find if there is opcRend = new RenderOption(); opcRend.setOutputFormat("xls"); } else { HTMLRenderOption opc = new HTMLRenderOption(); opc.setHtmlTitle(design.getReportName()); opc.setBaseImageURL("/recursos/img/x.birt-img?imagen="); opc.setImageDirectory(tmpDir.getAbsolutePath()); opc.setImageHandler(new HTMLServerImageHandler()); opcRend = opc; } // hanlde report paramteters. if(parametros_Reporte != null) { Iterator it = (Iterator)parametros_Reporte.keys(); while(it.hasNext()) {
Re: DownloadLink, BIRT report
I don't know about BIRT, but I recently did an output to Excel page. You link to it like any other page: http://wicket.apache.org/";> Auction Excel Download That meta content in the head is more for documentation - it doesn't seem to work without the final step below: The Java code looks something like this to populate the table: add(new DataView("rows", new MyDataProvider()) { public void populateItem(final Item item) { item.setModel(new CompoundPropertyModel(new DetachableXYZModel(item.getModelObject(; item.add(new Label("name")); And the final magic makes it ask if you want to open it with excel: @Override protected void configureResponse() { super.configureResponse(); getRequestCycle().getResponse().setContentType("application/x-msexcel"); } That worked for me - hope it helps. (Also note you can output a mix of literal data and formulas) I use web app to collect data, then word merge templates for reports. -- Jim Pinkham http://firstuucolumbus.org/auction On Wed, Dec 31, 2008 at 10:22 AM, newbieabc wrote: > The generation of the excel report. > I am really new to BIRT and wicket.. > I've created the BIRT report (report.rptdesign)(in eclipse) but need it to > be output as xls. > I'd really appreciate some help. > Thank you > > > reiern70 wrote: > > > > Sure you can... Which part is giving you problems? The generation of the > > excel report with BIRT? Or the creation of the link? > > > > Best, > > > > Ernesto > > > > newbieabc wrote: > >> Hello.. > >> How can create a download link on a webpage, that converts a BIRT report > >> to > >> excel format and downloads to client machine? > >> > >> Thank you. > >> > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > > -- View this message in context: > http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21232850.html > > Sent from the Wicket - User mailing list archive at Nabble.com. > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For > additional commands, e-mail: users-h...@wicket.apache.org > > >
Re: DownloadLink, BIRT report
The generation of the excel report. I am really new to BIRT and wicket.. I've created the BIRT report (report.rptdesign)(in eclipse) but need it to be output as xls. I'd really appreciate some help. Thank you reiern70 wrote: > > Sure you can... Which part is giving you problems? The generation of the > excel report with BIRT? Or the creation of the link? > > Best, > > Ernesto > > newbieabc wrote: >> Hello.. >> How can create a download link on a webpage, that converts a BIRT report >> to >> excel format and downloads to client machine? >> >> Thank you. >> > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21232850.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DownloadLink, BIRT report
Sure you can... Which part is giving you problems? The generation of the excel report with BIRT? Or the creation of the link? Best, Ernesto newbieabc wrote: > Hello.. > How can create a download link on a webpage, that converts a BIRT report to > excel format and downloads to client machine? > > Thank you. > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
DownloadLink, BIRT report
Hello.. How can create a download link on a webpage, that converts a BIRT report to excel format and downloads to client machine? Thank you. -- View this message in context: http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21218997.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org