Opening BIRT report from a jsp

smuks
edited February 11, 2022 in Analytics #1
I have successfully managed to create reports in BIRT but now comes the big question of how do I create and call the same reports through a J2EE application that runs on Weblogic 10.0 web server.

I have been going through several forums and have seen several posts talking about BIRT viewer and the Report engine API.But I am so confused as to where to start from and what steps to follow.

Could someone please tell me what I need to do in order to be able to display a BIRT report by clicking a link/button on a jsp/html page?

I would be so grateful for any help at this point.Micheal,Gary...could you please come to my rescue once again?!

Many thanks.

Comments

  • cypherdj
    edited December 31, 1969 #2
    I guess the answer will depend on how you want to integrate with BIRT. <br />
    <br />
    1. You could simply use the BIRT viewer as a deployed application within your web app server. If this is what you want, all you will need to do is get the BIRT runtime, and follow the instructions at<br />
    <a class='bbc_url' href='http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php'>http://www.eclipse.org/birt/phoenix/deploy/viewerSetup.php</a><br />
    Then simply create your button/link on your page and link it to <a class='bbc_url' href='http://localhost:8080/birt-viewer/run?__report='>http://localhost:8080/birt-viewer/run?__report=</a><name of your report> (you may also need to set your parameters on this URL). Or if you want the full frameset functionality replace run by frameset in the previous URL.<br />
    <br />
    2. You could integrate the BIRT viewer within your deployed app. Again, get the BIRT runtime, unzip it in a temporary location, copy the relevant folders from WebViewerExample into your own app and copy the contents of WebViewerExample/WEB-INF/web.xml into your own app web.xml. Again simply create your button/link on your page and link it to <your app context>/run?__report=<name of your report><br />
    <br />
    3. You could decide to use the RE APIs within your own app to implement your own version of the BIRT viewer in the form of a servlet. If this is the way you want to go, read <br />
    <a class='bbc_url' href='http://wiki.eclipse.org/Servlet_Example_(BIRT)_2.1'&gt;http://wiki.eclipse.org/Servlet_Example_(BIRT)_2.1&lt;/a&gt;&lt;br />
    Obviously, you may not need all the jars under ReportEngine/lib, just cherry pick what you need to get your reports working. You may also not need iText.jar unless you are planning to generate PDFs (someone correct me if I'm wrong on this one, I've not gone this road yet...)<br />
    <br />
    Hope that helps getting you started, and good luck whatever way you decide to integrate,<br />
    Regards,<br />
    Cedric
  • smuks
    edited December 31, 1969 #3
    Thank you so much,Cedric.This was exactly what I was looking for.

    I am going to start with Option #1 now and will just have to come back to this forum in case I am stuck!

    Thanks again!
  • smuks
    edited December 31, 1969 #4
    Cedric,I am working on Option #2 wherein I deploy the BIRT viewer as a part of my application.

    The problem I have is that I am not too sure as to what folders/files of the WebViewerExample I need to have in my web application.Could you please throw some light on this issue?

    Many thanks.
  • cypherdj
    edited December 31, 1969 #5
    To integrate the BIRT runtime 2.2.2:
    ? unzip the contents of the birt-runtime-2_2_2.zip into a temporary folder,
    ? expand the WebViewerExample folder,
    ? copy the report, scriptlib and webcontent folders to your own app folder,
    ? copy the WEB-INFplatform and WEB-INFtlds folders to your own app WEB-INF folder,
    ? copy the contents of the WEB-INFlib folder to your own app WEB-INFlib folder,
    ? copy the WEB-INFjrun.web.xml, WEB-INFserver-config.wsdd & WEB-INFviewer.properties to your own WEB-INF folder,
    ? merge web.xml to your WEB-INFweb.xml,
    ? copy your DB drivers to your WEB-INFplatformpluginsorg.eclipse.birt.report.data.oda.jdbc_2.2.2.r22x_v20071206drivers,

    Note that you will need to tweak web.xml BIRT config values to your specific needs.

    Hope that helps, if you have any problems/queries, feel free to post,
    Cedric
  • smuks
    edited December 31, 1969 #6
    Thank you so much,Cedric.

    I managed to get everything done except for one small hurdle in the end.

    I get this error :

    <Error> <HTTP> <BEA-101214> <Included resource or file
    "/myapp/webcontent/birt/pages/layout/RunFragment.jsp" not found from requested resource "/myapp/run".>


    I have the webcontent folder in myapp folder and yet this error continues to persist.

    Any thoughts?

    Many thanks.
  • smuks
    edited December 31, 1969 #7
    Cedric,it worked!!I deleted the webcontent folder and copied it afresh and it worked!!

    Thank you so much for your help!I truly appreciate it!

    I am going to proceed next with Option #3 ie the Report Engine api and writing my own servlets.

    I am counting on your guidance in case I run into problems again :)
  • cypherdj
    edited December 31, 1969 #8
    No problem smuks, I'll be happy to help if I can, I've just gone through the same as yourself, and have still some issues with regards to the servlet (see my other posts on the forum), but generally speaking it's looking in good shape.

    Best of luck,
    Cedric