BIRT in a desktop application
Did someone ever used a BIRT report in a desktop application. I'm comming from the .NET environment and there you can use Crystal Reports to show reports in desktop apps. Is this possible with BIRT too, without having to set up a server environment?
Can you give me some advice how to reach this goal?
Thanks in advance.
Asked by: Roman464 | Posted: 23-01-2022
Answer 1
If your desktop application is written using the Eclipse Rich Client Platform (RCP) it is trivial to add reporting. All you need to do is add the org.eclipse.birt.viewer plugin and then use it.
Here is an article that explains it: http://digiassn.blogspot.com/2008/08/birt-launch-birt-rcp-application.html
Answered by: Chester821 | Posted: 24-02-2022Answer 2
There is a BIRT run-time that allows you to generate reports from the command line. Read this article. That will allow you to use BIRT without a server. Originally noted here as an answer to my own question.
Answered by: Emma747 | Posted: 24-02-2022Answer 3
Yes, it is possible. I used it in a project I did about 1-2 years ago so I'll have to get back to you with the details. (Though things might have changed since then)
Here are the plugins I needed:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="JUNIT_HOME/junit.jar" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/>
<classpathentry kind="lib" path="lib/log4j-1.2.14.jar"/>
<classpathentry kind="lib" path="lib/swt.jar"/>
<classpathentry kind="con" path="SWT_CONTAINER"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart_2.1.2.v20070205-1728.jar"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart.device.extension_2.1.2.v20070205-1728.jar"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart.device.swt_2.1.1.v20070205-1728.jar"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart.engine_2.1.2.v20070205-1728.jar" sourcepath="C:/Programme/eclipse/plugins/org.eclipse.birt.chart.source_2.2.0.v20070209/src"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart.engine.extension_2.1.2.v20070205-1728.jar"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart.runtime_2.1.2.v20070205-1728.jar"/>
<classpathentry kind="lib" path="org.eclipse.birt.core_2.1.2.v20070205-1728.jar"/>
<classpathentry kind="lib" path="org.eclipse.emf.common_2.2.1.v200609210005.jar"/>
<classpathentry kind="lib" path="org.eclipse.emf.ecore_2.2.1.v200609210005.jar"/>
<classpathentry kind="lib" path="org.eclipse.emf.ecore.xmi_2.2.1.v200609210005.jar"/>
<classpathentry kind="lib" path="js.jar"/>
<classpathentry kind="lib" path="com.ibm.icu_3.4.5.jar"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart.ui_2.1.1.v20070205-1728.jar"/>
<classpathentry kind="lib" path="org.eclipse.birt.chart.ui.extension_2.1.2.v20070205-1728.jar"/>
<classpathentry kind="lib" path="lib/hsqldb.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Answered by: Paul190 | Posted: 24-02-2022
Answer 4
Yes, it is possible. Here is some general description. I've used Birt in server environment though as far as I know there's a RenderContext interface through which you render your reports in the way you want.
Answered by: Alina566 | Posted: 24-02-2022Answer 5
It is possible and you can easily create a preview of the report in a JeditorPane, you have to download BIRT Runtime and then you can try with the example code posted in this post on Eclipse forum.
Answered by: Clark327 | Posted: 24-02-2022Answer 6
package com.passport;
import java.io.FileOutputStream;
import java.util.Collection;
import java.util.Iterator;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.IGetParameterDefinitionTask;
import org.eclipse.birt.report.engine.api.IParameterDefnBase;
import org.eclipse.birt.report.engine.api.IRenderOption;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.RenderOption;
public class EngineReport {
private static final long serialVersionUID = 1L;
private IReportEngine engine=null;
private EngineConfig engineconfig = null;
private IReportEngineFactory factory = null;
private String sourceReport;
private String locationReport;
private String reportRealPath = "";
public static void main(String[] args){
EngineReport engineReport = new EngineReport();
engineReport.save("src/com/passport/report.rptdesign","c:/tmp/rep.doc");
}
private void save(String sourceReport, String locationReport) {
this.sourceReport = sourceReport;
this.locationReport = locationReport;
IReportRunnable design = null;
IRenderOption options = null;
try {
String reportFormat = locationReport.substring(locationReport.lastIndexOf('.')+1);
sourceReport = "src/com/passport/report.rptdesign";
if ((sourceReport != null && (sourceReport.length() > 0)) ) {
engineconfig = new EngineConfig();
reportRealPath = "";
Platform.startup(engineconfig);
factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(engineconfig);
design = engine.openReportDesign(reportRealPath+sourceReport);
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
IGetParameterDefinitionTask taskParam = engine.createGetParameterDefinitionTask( design );
Collection<?> params = taskParam.getParameterDefns( false );
String paramName = null;
Iterator<?> iterOuter = params.iterator( );
while ( iterOuter.hasNext( ) ) {
IParameterDefnBase param = (IParameterDefnBase) iterOuter.next( );
paramName = param.getName( );
if (paramName.equalsIgnoreCase("PR_SOME_PARAM")) {
task.setParameterValue(paramName,"someparam");
}
else if (paramName.equalsIgnoreCase("PR_SOME_PARAM_2")) {
task.setParameterValue(paramName,"someparam2");
}
}
options = new RenderOption();
options.setOutputFormat(reportFormat);
FileOutputStream fos = new FileOutputStream(locationReport);
options.setOutputStream(fos);
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
fos.close();
}
} catch(Exception e) {
System.out.println(e.toString());
}
}
}
Answered by: Sienna711 | Posted: 24-02-2022Similar questions
java - How to notify the user of important events for a desktop application?
Our customer is using our software (Java Swing application started using Webstart) besides other software like MS Office, to do his job. From time to time there are important events he has to deal with in our software without much delay. The customer wants to have a prominent notification then. Now he might be using Excel at the moment, so popping up a message box will not suffice (although the entry in the task bar will b...
java - How to make a desktop application modular?
How do you make a Java desktop application modular? How should the modules be classified?
java - Can an EJB be called from a desktop application?
I am new in Java EJB 3.0. It is possible to call a (session) bean—deployed on JBoss—from a desktop application client?
Thanks in advance.
udp - How do I write my own desktop sharing application in java?
Hello I want write my own desktop sharing application in Java.
The application should have some very default features:
Capture screen;
Allow a remote connected user to click / edit fields.
I was thinking to use Java Robot class for mouse movements / key pressing.
T...
What Swing look and feel should I use for a Java desktop application?
I am developing a Java desktop application and I use Swing to build the GUI. I realize that I can change the look of my app by setting different L&Fs.
The JRE (from SUN) provides me at least two L&Fs, one is the default Metal L&F and the other is the "System" L&F which let my app have a native look. Also I can find some really cool L&Fs on the internet.
The question is: which L&F s...
java - I want to use Google Map API for my Desktop application
I want to use google map API for my desktop application. The application will be totally connected to the internet.
While I was searching some research notes about this implementation. I found a ideal site with the configurations, but it has some java files to be downloaded, but when I tried that website its not loading. which is swinglabs.org
java - Desktop application using Spring RCP
I am about to start a project using Spring RCP, which I have no knowledge of. I was wondering if there was any site where I can learn everything from basic to advanced techniques in this framework.
jsp - How can I create a Java web application which looks the same as my desktop?
I want create a web application which looks similar as my Windows 7 desktop. I am using JSP and JSF. I wonder how I could create a start button and gadgets. Can anyone give me some hints?
java - How to get name of JAR which is a desktop application run from?
I have created simple library AppInfo providing an easy way to show always valid, automatic updated information about a version of running software in Java applications, which is especially useful in conjunction with automatic builds from CI server.
In my library it is necessary to read MANIFEST.MF from JAR (in case of a desktop application) which is the ...
swing - How can I hide a "java desktop application"
I'm newbie in Java so I deicide make an application use "java desktop application" in Netbeans. It creates 3 file (ProjectNameAboutBox.java (JFrame Form), ProjectNameApp.java, ProjectNameView.java (JFrame Form and all my code in this file)).
Now, I want to ask how can I hide and restore this application when run? I already made a systemTray for it
Thank you
windows - IE6 generated strange worksheet name when doing export from java application
I am encountering error like
test(10)[1].csv file cannot be found at
C:\Documents and Settings\Ron\Local Settings\Temporary Internet Files\Content.IE5\PQ0STUVW
When trying to do export of CSV file using the following codes.
Anyone have any idea what could be wrong? This issue does not occur in IE7 / Firefox and is only specific to IE6.
response.setContentType("applicati...
c# - Embedding Flash Player in a C++ or Java application?
I would like to embed Flash Player directly inside a C++ or Java application.
I found an article that describes how to do this for C#:
http://www.adobe.com/devnet/flash/articles/stock_history03.html
Unfortunately, I have no experience with C#, COM or ActiveX. I need someone to translate this code to C++, allowing ...
java - How best to implement user selectable variables in web application
I have a Java based web-application and a new requirement to allow Users to place variables into text fields that are replaced when a document or other output is produced. How have others gone about this?
I was thinking of having a pre-defined set of variables such as :
@BOOKING_NUMBER@
@INVOICE_NUMBER@
Then when a user enters some text they can specify a variable inline ...
which library better for faster java application swt or swing?
which library better for faster java application swt or swing?
java - Which is the best Open source application server?
java - Access spring bean that is exposed using http invoker from GWT application
Can I access spring bean that exposed using http invoker (server) from GWT application (client)?
If so is there any example / tutorial for that?
How to close a Java Swing application from the code
What is the proper way to terminate a Swing application from the code, and what are the pitfalls?
I'd tried to close my application automatically after a timer fires. But just calling dispose() on the JFrame didn't do the trick - the window vanished but the application did not terminate. However when closing the window with the close button, the application does terminate. What should I do...
java - How best can I isolate my application from an unreliable database?
I have a Java SOAP data service which sits on top of a Sybase database which, for reasons out of my control, has unreliable performance. The database is part of a vendor package which has been modified by an internal team and most of the issues are caused by slow response times at certain times of the day.
The SOAP service provides data to a calculation grid and when I request data, I need the response time to be ...
java - Netbeans GUI Designer & Fixed-Size Application Panels
I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size.
When I start a new GUI project in NetBeans, I set the properties of the main panel for min/max/preferred size to 800 x 600, and the panel within the 'Design' view changes size. ...
How do I create a "Hello World" application in java for an iphone?
I'd like to create a basic "Hello World" style application for the IPhone using Java - can anyone tell me how?
Still can't find your answer? Check out these amazing Java communities for help...
Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)