How to view BIRT reports using Java in Eclipse - java

I'm creating an appointment booking and financial application for a start-up business opening soon. Everything is going well and I'm nearing the end of this project, yet I would like to create reports that the user can run, print and export. I have added the BIRT developer into Eclipse and have successfully created several reports which preview well. What I would like to know is how I can get the reports to run from Java code? I have searched the web for ages and have not found a solution. The reports are sitting in the same project folder as all my classes.
Your help is most appreciated..
Thanks

If your application is a web application you can use BIRT engine inside your WAR and create all your reports and charts, and then share them using the application server.
Otherwise, if your application is an Eclipse based application, I think you should use the BIRT eclipse plugin, that contains the engine, to build reports and then you can use the default eclipse file association to show them to users (ie using internal browser).

I believe the most common way of sharing BIRT reports is to use Apache Tomcat. This tool allows the report to be run as HTML, PDF, Excel 2003, and a number of other formats. As both BIRT and Apache Tomcat are open source, initiation is not as simple as more costly products but there are a number of solutions on the web for any problem you might encounter.
http://tomcat.apache.org/

Related

How to set up a system that reads PMML files which I create using R?

For the past few days I'm stuck at trying to pass a PMML file with .xml extension that I created using R and pmml package. After creating a iris.xml PMML file I have no where to go, actually I don't know what to look for. And then I saw Alex Guazzelli's video here, where he tells us to use ADAPA from Zementis to run the PMML files that are created from R.
What I took away from the video is,
I want to do something similar as shown, like uploading my PMML file at some place and input my test files frequently to get the corresponding predicted values.
ADAPA looks great, but looks like it also costs some money. So I would like to look for an alternative, which might not be as user friendly as ADAPA.
Then I found this page where the author says,
So the first step was to get the engine running. I experienced some small problems but Scott fixed them very fast and offered a new war file ready for deployment inside tomcat. It can be obtained under http://code.google.com/p/openscoring/. If you still encounter some problems you could also try my war file. It was built with java version “1.6.0_26” and tested under tomcat 7. After installing the war file using the management console, you could test it by sending a POST request in XML like the following to ‘http://localhost:8080/OpenScoring/Scoring’
Then I found jpmml. The problem here is the package names are very confusing, I don't know which one to install. In fact I don't know how to install each of them. I have basic knowledge of Java, apparently it isn't helpful in the current scenario.
Desperately looking forward for any kind of help.
How do the data flows in your application look like? Zementis' ADAPA is a standalone web service, which lets you do scoring in a request/response fashion. This works for web applications, but is clearly sub-optimal if you're looking to score larger amounts of data.
The JPMML project provides "PMML runtimes" for most popular big data frameworks. For example, if your application is tied to Apache Spark, then you would go for the JPMML-Spark project, if tied to Apache Hive/Pig, then for the JPMML-Pig project, etc. For a simple REST web service you should check out the Openscoring project, which is functionally identical to Zementis' ADAPA.
All JPMML projects can be built from their source checkout using Apache Maven by issuing the following command:
mvn clean install
Some JPMML projects also have their binaries distributed via the Maven Central repository. If you're looking for the Openscoring WAR file, then you need to search for "openscoring-webapp" and on the results page click the "download WAR" link (at the time of writing this, you would get openscoring-webapp-1.2.12.war). This is a standard WAR file that can be dropped to the auto deploy folder of your favourite Java web server (Tomcat?) as it is. The REST API of the web service is fully documented in the README file of the Openscoring project.

build lucene web application with tomcat

I had developed a lucene search engine (with Lucene 5.2.1) and now I want to embed it into a very simple web application (it has demonstrative purpose, it will run in localhost).
This web application should let the user insert some keywords and navigate through search results (in other words it should let the user read the index that I had created, with appropriate html formatting). I had already made some simple html GUI with Bootstrap.
I'm very new to web applications, but I had been told that a good idea would be embedding Lucene in a TomCat server. I had visited this link, but it's quite old and not very detailed. I have tried to look for "lucene tomcat" but I get results about SolR or very specific posts.
Can anyone please suggest me a good resource or a general approach to my issue?
Many thanks
My solution:
I wrapped my search engine library into a JAR file.
I downloaded zipped version of TomCat 8 and installed it into my Eclipse environment as a new Runtime Enviroment.
I made a Dynamic Web Project in Eclipse (see this video lesson) using TomCat 8 server.
I put the JAR into my webapp (should be something like WebContent\WEB-INF\lib\searchEngine.jar)
I created a Servlet to handle user input.
I did the rest using very simple JSP pages, embedding Java code that uses my JAR (I know, that is not so good but it works!)
Cheers!

Configuring & Generating BIRT Reports Dynamically

From watching the 2-part YouTube videos and perusing the BIRT manual, my understanding of it is the the worflow goes something like this:
Create a new Report in Eclipse
Use the BIRT Report Designer (Eclipse plug-in) to design a report
Populate the report with Data Sources (JDBC drivers & databases) and Data Sets (specific tables)
Generate/export/print the report
As cool as this tool seems to be, I cannot find any documentation that leads me to believe that this is a Java tool and not an Eclipse-only tool (meaning, it has a Java API and can interact with Java apps, as opposed to a pure Eclipe plug-in which requires manual/human interaction from the Eclipse IDE.
Specifically, I want to confirm that BIRT either can or cannot do the following:
Configure a report (layout, UI widget placement, data sources/sets, etc.) programmatically; i.e. in the same way that JasperReport API has the iReport designer that generates JRXML, is the same true for BIRT?
Kick off a report "generation" through a Java API whereby data gets read-in realtime and populates the report and the report can be sent out or stored on a file system
Create HTML and PDF versions of the same report
Answers to your questions:
Yes. BIRT may not be as powerful as JasperReports, but it can achieve most of the common needs.
BIRT designer generates a .rptdesign file similar to JRXML in JasperReports.
About your question: almost everything is possible to achieve programmatically in BIRT. BIRT Report Engine APIs is the best source for you to get started with all the functionalities you have mentioned. It has good examples given for every functionality.
Not sure. BIRT usually fetches pre-saved data from DB and generates the report. You could though see the real time data representation (in the form of a flash chart may be) with the help of some external libraries (See if this thread and this example helps). But I am not aware of a direct way of converting the real time data to PDF/HTML report. You will have to find some hack(s).
Yes of course. Refer the APIs. To be specific, irendertask.
Sources to get more information/answers:
There are several example reports given on the website. A quick glance through them might give you more insights.
For discussions and troubleshooting, refer eclipse community forum and BIRTExchange (heavily used by BIRT users).
BIRT: A Field Guide to Reporting is an excellent book. I've used it myself from time to time.
I can confirm that the two BIRT components you are interested in using (BIRT Design Engine and Report Engine) will work in a pure-Java context and are deployable without Eclipse. I have deployed BIRT reports to run out of standalone Tomcat servers as well as Pentaho BI Server, and have exercised report definitions at the command line using shell scripts (no Eclipse involved).
Answers to your questions:
Configure a report programmatically: use the Design Engine API. I am not familiar with the Jasper Reports API so cannot comment on whether the BIRT method is similar, but the example code provides a good illustration. In particular, note lines 120-133 which add and manipulate widgets in the report, and how line 136 calls saveAs to save the report design file.
Generate a report in realtime: use the Report Engine. The sample code for the IRunAndRenderTask may be the most useful for you at first, but the engine has the ability to separate the data processing (extract and aggregate) of the report from the rendering and paging. I believe the examples focus on running reports from a Servlet, but it is easy to extract that logic from the servlet container logic.
Create both HTML and PDF versions: easily handled in the Report Engine via the IRenderTask. Once you've been through all the other setup work, changing the output format to produce PDF vs HTML is something of a joy. In my experience, it just works.
I found it useful to start out with a very simple Java class (adapted from the very old code here) to run a test report, called from the command line.
you can use the report engine API to configure reports:
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#ireportrunnable
You can create HTML or PDF versions of a report by setting a variable in the url to generate the report or if using the report engine programmatically:
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#irendertask
We use Eclipse to build and design reports. The report engine is deployed as part of a reports_war, the war has its own connection to the database. Our Java based web application uses urls to interact with the report templates (variables are set in the urls).
The BIRT Exchange is a good place for more information
There is not much difference between Birt and jasper as designing point of view except birt have eclipse plugin.
1)yes,you can configure it by java program or methods.
2)yes,this is possible.
3)yes again for export your report in different formats is easy for birt report by java
BIRT is a good and easy tool fro report generating.
you can design your pages in BIRT.
-
Create datasets and can pass the values from your web pages to your BIRT design using jsp tag lib.
BIRT fulfills all your requirement. Its so easy to use. first i use jasper, then tried crystal atlast Birt gies the output.
tag lib
i refer this link to view BIRTVIEWVER in my web page. PDF creation is so perfect in BIRT. You can generate PDF, DOC, HTML also.
you can pass values to your birt . while creating dataset there is option for passing params.
to do all this you have to install BIRTREPORT inyour eclipse BIRT Report designer

How to set Netbeans to ignore Javascript library when scanning and building?

I am currently using Netbeans Web Application project. I used dojo and dijit library within my project and I notice that when I start netbeans it scans very slow, I believe part of the slow scanning at startup is the scanning of dojo files. As these files do not change, is there a way to command netbeans to ignore a part of the javascript directory? I believe using a Content Delivery Network (CDN) is a solution but this project would only be accessible via intranet.
Any ideas here?
You'll always want to use Dojo's build system to optimize/minify/concatenate code before deploying. The individual files used for development will load very slowly over a network.
You may also try the public CDN (currently deployed to Google and AOL) using the build layers as deployed there (e.g. dijit.js) to both offset bandwidth and take advantage of caching.

Can BIRT be used within a web application without deploying a separate web application on the server?

Can I use BIRT within my application instead of deploying as a separate app on the webserver?
I know that BIRT viewer can be integrated with the application by installing it on the server. I went through the process and its very cumbersome. It requires me to import too many JARs and then code too much even for a simple report.
Jasper on the other hand does this elegantly.All I need is 2-3 JARs and 5 lines of code to generate a simple report.
Is it possible to accomplish the same with BIRT?
It is possible to add just the report engine (and possibly the report designer) to your application, and have everything happen via code, instead of URL from the viewer. But you'll have to implement your own viewing functions, e.g. paging through the report, and if you need the report in different output formats, there's code you'll have to write for that, too, instead of letting the viewer application do it.
You can deploy the open source viewer, which will allow you to do this. There is also a BIRT Reporting Web Project you can create using Eclipse's Web Tool Platform that will create a web project for you to run BIRT reports in. (BIRT WTP Integration download)
http://www.eclipse.org/birt/phoenix/intro/intro02.php

Categories