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 <runtime download folder>\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:[email protected]] Sent: Monday, January 05, 2009 11:16 AM To: [email protected] 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().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<String> it = > (Iterator<String>)parametros_Reporte.keys(); > while(it.hasNext()) { > String param = it.next(); > try { > // first try to handle the parameter as > multivalued. > JSONArray array = > parametros_Reporte.getJSONArray(param); > Object[] values = new > Object[]{array.length()}; > for(int i=0; i < array.length(); i++) { > try { > values[i] = > array.get(i); > } catch (Exception e) { > values[i] = null; > } > } > renderTask.setParameterValue(param, > values); > } catch (Exception e) { > // if parameter is not multi-valued > then treat it as single-valued. > String value = > parametros_Reporte.getString(param); > renderTask.setParameterValue(param, > value); > } > } > } > opcRend.setOutputStream(out); > renderTask.setLocale(locale); > renderTask.setRenderOption(opcRend); > renderTask.run(); > } > ......... > > } > > This class initializes a singleton BIRT runtime and the > generateBirtReport(...) method can be used to read the report design from > a database and generate the corresponding report (PDF, excel, HTML). If > you filter out the logic that is specific to my use case you can easily > build your own machinery for building reports based on code given above. > > As for the generation of the download link there should be plenty of > examples and/or related threads in this list... > > Best, > > Ernesto > > > > > > > > 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: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21293883.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ EMAIL CONFIDENTIALITY NOTICE This Email message, and any attachments, may contain confidential patient health information that is legally protected. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this message is strictly prohibited. If you have received this information in error, please notify the sender immediately by replying to this message and delete the message from your system. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
