Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Deploying BIRT to Swing App
Merlin1776
Greetings All,
I have a simple Java Swing app that I would like to add reporting to.
I have been aware of BIRT since 2004 and tried it briefly at that time. I looked at it again for this project and for the past 3 weeks I have been digging through the web and the birt-exchange site to find a way to do this.
I attended one of the roadshows and got information from a presenter who indicated that there are really only three options for deployment:
1. Use the RCP method which needs the OSGi (huge and complex)
2. Dump the engine output into a JEditorPane (awfully simplistic with no functionality)
3. Run Tomcat on the side and access the reports from that. (might have to resort to this...)
For due diligence sake I attempted to use the OSGi. The instructions for that I found were very sketchy. The instruction assumed an awful lot and the demonstration code was only in snippets. There were no detailed pre-requisites, detailed start-to-finish instructions, or complete source code that could serve as a starting point. My attempts were a complete failure.
I have tried the JEditorPane... looks great but I can't do a thing with it. I tried to print but quickly realized printing HTML source was a bad idea. I found where someone had scraped the JEditorPane for jpeg image and printed that. Even the author of that post admitted that it was an awufully cheesy way to print a report. What's worse is that all of the functionality the viewer provides would have to be coded by hand.
I have not yet tried the Tomcat method. I'm sure that works really well since that seems to be the main focus of the BIRT project.
My application is intended to be installed by the user, administered by the user. It is tiny and I am resisting the suggestions to multiply the size of the project by 1,000 times or increase the complexity of running my software for the user.
Quite frankly, I am surprised this is so much trouble. Is there a simple way to do this? Any good instructions or papers that do better than what are currently posted on this site? Or, is anyone aware of a report engine that is easier to integrate?
Thank you for any suggestions!
Find more posts tagged with
Comments
Merlin1776
No reply from anyone on my question yet I see. :-(
I am currently pursuing a similar tack to my option 2. Instead of generating HTML output. I have started messing around with PDF output.
I have created a fileOutputStream and sent the PDF ouput to that file. I then close the file and issue a Runtime execute to pull up the file in the PDF viewer.
This is working but it is far less elegant than I had originally hoped for. However, for the purposes of the project at hand it will be sufficient. :-|
I had originally intended to show this program as a test case of full BIRT functionality including links, multiple export formats, etc. Showing a finished program with the full featured viewer would have been more impressive to the rest of the programming staff who I will be briefing on this project.
I will post a fully commented and simplified code listing as soon as I cleanup my tests.
Merlin1776
Here is the link: <a class='bbc_url' href='
http://www.birt-exchange.org/devshare/deploying-birt-reports/1182-birt-report-from-java-swing/#description'>BIRT
Report From Java Swing - Designs & Code - BIRT Exchange</a>
Merlin1776
The DevShare code has been modified with more comments.
The only thing that could make the code better would be the use of named pipes or something similar so the file does not have to hit the disk before being read by Adobe Acrobat.
I briefly looked at java.io.PipedOutputStream to see if that was a possibility. have not had time to try that. Seems that Acrobat could read the pipe using a URI like .pipe{pipename}.
I would still like to see if there is a way to integrate the viewer in Swing...