Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT in JSP Application (Think Light)
Nick Cameo
<p>Hello Everyone,</p>
<p> </p>
<p>We have the typical CRUD (Create Read Update Delete) JSP web application, and now we need to</p>
<p>generate reports from data pulled from the DB. What we require is a lightweight approach, and really</p>
<p>don't want to have to deploy two applications in our tomcat container (ie, our application, and a reporting engine) if we don't have to. Lightweight reports solution is the keyword here. Please consider the attached order form done is jsp. The orders are pulled via date range (ie, date from and date to), and would require the report to be generated as such (ie, list view with a bunch of invoices in it).</p>
<p> </p>
<p>What we have done is created a report (orders.rptdesign) in eclipse that pulls all invoices in the database without date range just for testing. Everything is ok so far. For integrating the report in our JSP application we:</p>
<p> </p>
<p>* Included the `taglib` and birt.tld to our application</p>
<p>* Included all jars that google told us to include:</p>
<p>- coreapi.jar (375.0 KB) light</p>
<p>- engineapi.jar (129.0 KB) light</p>
<p>- modelapi,jar (2.5 MB) holly s**t that's heavy for a web app</p>
<p>- viewservletapi.jar (533.9 KB) light</p>
<p>- com.ibm.icu.jar (9 MB) why why why do I need this?</p>
<p> </p>
<p>Added the following code to a JSP page:</p>
<pre class="_prettyXprint _lang-html">
<birt:viewer id="birtViewer" reportDesign="orders.rptdesign"
pattern="frameset" height="450" width="700" format="html"></birt:viewer>
</pre>
<p>Got all excited, ran the app in our tomcat container and voala. Nothing? No report? Hmmmm.....</p>
<p>Just to clarify we even put order.rptdesign in the same folder as the JSP page and still nothing.</p>
<p> </p>
<p>Questions:</p>
<p> </p>
<p>1) What is the bare minimum that we will need in terms of jars specified above to:</p>
<p>i) Display the report in our JSP</p>
<p>ii) Not display the report, but just provide a `Print` button that will print the report (ie, print friendly)</p>
<p>2) How can we see our already created report. Is it in a different URL?</p>
<p>3) When the time comes, what will be the best way to pass the date range to our report. What we need is</p>
<p>basically:</p>
<p> </p>
<p>SELECT * from Order where dateCreate >= ? and dateCreated <= ? and custNum = ?</p>
<p> </p>
<p> </p>
<p>Thanks in Advance,</p>
<p> </p>
<p>Nick.</p>
Find more posts tagged with
Comments
mwilliams
<p>So, you're not wanting to deploy the BIRT viewer?</p>
<p> </p>
<p>1) It would depend on if you're deploying the viewer and using the tag library.</p>
<p>2) Can you explain more about what you mean by already created? Meaning one you've executed before?</p>
<p>3) This will depend on how you deploy BIRT. If you're using the viewer by URL, you'd pass them through the URL. If you're using the tag library, they'd be in the JSP tag library code. If you just integrate the report engine into your application with your own Java code, it would depend on how you set that up.</p>