Tuesday, 16 October 2012

Birt Integration With Web Application

Birt Integration Part1
Birt Integration Part2

Birt is one of the powerful free report designing tool which comes with nice eclipse plugin having good report designing tool.
When I was designing reports with designer plugin in eclipse I found it very simple. But when it came to deployment we need to deploy it in separate web application provided by birt-runtime, but it was not the requirement for me.I was looking for birt integration with my existing application. So I started analysis for integrating birt report engine in my application and after 1 week of research I was successfully able to integrate with my application.
For better understanding I have created one simple web application.Go through following steps to achieve successful integration:

Index For Birt Integration
     1) Overview

     2) Installation

     3) Java Classes For integration

     4) Jsp and Sample Reports

     5) JavaScript for loading report using ajax.

     6) Sample report with pagination functionality (Under development).

     7) Download 


This simple birt integration web project which provides the same functionality provided by birt web application.Basic flow starts with ajax report request which is simply handled by one servlet and which is handover to report engine for processing and rendering output to the output response or downloading in pdf,xls and doc format.Note* Currently pagination feature is under progress.

Here we are using following technology:

  1. Birt 3.7.1 libs
  2. jquery-1.7.1.js (here any version will work as we are using for ajax call only)
  3. Simple servlet and jsp.
  4. Eclipse Plugin For Birt Report Designer.


         Follow below steps for installation of this example web project.

1) Download this example web project from here.
Update :Check sample project for pagination support here

2) Import the project in eclipse

3) Download birt 3.7.1 runtime or other version from here

4) Copy all the jars from birt-runtime-3_7_1\birt-runtime-3_7_1\ReportEngine\lib To web  

applications lib.

Java Classes For integration

These are the classes which are responsible for integrating birt engine in web application. These classes will simply instantiate ,initialise the report engine,process reports and destroy the engine when context is destroyed. 

Below is short description of the classes in sample web project:

1) BirtReportController : This class handles request for the report rendering or downloading.

2) ReportProcessor  : This is singleton class which takes care of starting report engine  ,processing report ,rendering report and shutting down report engine.

3) ReportRenderer : This class actually process reports and renders it to httpresponse object.It also handles downloading report functionality.

4) BirtEngineFactory : This class configures birt engine using EngineConfig class object and returns  

BirtEngine object.It has logging configuration.
5) ReportParameterConverter : Convert report parameter value between object and string.

Below is the source code of the some Class with explanation:

1) BirtReportController :

This class extends httpservlet which is responsible for handing report rendering request.


  • init() : Initialise birt engine
  • get() or post() : handles processing and downloading report request
  • destroy() :Shutdown report engine.

package BirtIntegration.Controller;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServlet;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import BirtIntegration.BirtViewer.ReportProcessor;
   public class BirtReportController extends HttpServlet {
         //this is the single tone class.
         private ReportProcessor processor ;
         public void  init(){
               processor = ReportProcessor.getReportProcessor();
               System.out.println("Engine Initialized!!");
         public void doGet(HttpServletRequest request, HttpServletResponse response)
                     throws ServletException, IOException {
               processor.processReport(request, response);
System.out.println("processing report complete");
           public void doPost(HttpServletRequest request,
              HttpServletResponse response)
            throws ServletException, IOException {
                 doGet(request, response);
         public void  destroy(){

2) ReportProcessor  :

This is singleton class has BirtEngineFactory  and ReportRenderer object.

This class performs following operations using ReportRenderer:

  • Initializing Report Engine.
  • Processing report for rendering and downloading.
  • Destroying report engine.

   package BirtIntegration.BirtViewer;
   import java.util.logging.Level;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import BirtIntegration.factory.BirtEngineFactory;
 * This class is responsible for initlizing birt engine configuring birt  *engine,and processing and rendering reports.
   public class ReportProcessor {
         private BirtEngineFactory birtEngineFactory;
         private ReportRenderer reportRenderer;
         private static ReportProcessor reportProcessor =null;
         //private constructor for single tone object.
         private ReportProcessor(){
         public boolean initilizeBirtEngine(){
               boolean isInitialized =true;
               reportRenderer = new ReportRenderer();
               reportRenderer.setBirtEngine( this.getBitEngineFactory().getEngine() );
               System.out.println("Bit Engine Successfully Started.");
               return isInitialized;
          * Annotated with @ bean and will create BirtEngineFactory bean.
          * @return
         private BirtEngineFactory getBitEngineFactory(){
               birtEngineFactory = birtEngineFactory = BirtEngineFactory.getBirtEngineFactory() ;
               //uncomment to use logging
               //birtEngineFactory.setLogLevel( Level.FINEST);
               //birt engine logs will be created under this directory.
               //currently this line is commented
               //birtEngineFactory.setLogDirectory( new File("E:/WorkSpaces/PracticeWorkspace/BirtIntegration/birtlogs"));
           return birtEngineFactory;
         public void shutDownBirtEngine(){
         public void processReport(HttpServletRequest request,
          HttpServletResponse response) {
               reportRenderer.processReportDesignDocAndRenderReport(request, response);
         public static ReportProcessor getReportProcessor() {
               if(reportProcessor !=null){
                     return reportProcessor;
               reportProcessor = new ReportProcessor();
               return reportProcessor;

3) ReportRenderer

This class actually process the report request. This class has method processReportDesignDocAndRenderReport(request,response), the request object has following parameters :

  • ReportName :ReportName which is processed (e.g books_report.rptdesign).
  • ReportFormat : Html,Pdf,Xls,word. If it is other than html then it’s download request.
  • pageNumber  : This used to render particular page request in pagination.
  • Other Request Parameter in request object will be converted in report parameter ,which will be  given to query or other data sources as per the need.These parameters are used for filtering the reports data.

All the reports (.rptdesign ) are located in BirtIntegration\WebContent\Reports folder.

The report is processed in two phases by

1)IRunTask : Process .repdesign and generates temp.rptdocument and it also converts  

request parameter to report parameter.

2)IRenderTask : Processes temp.rptdocument document and renders report to response 

object based on type html,pdf,xls. It is responsible for setting the current page 
and also getting the total count of pages.

Code of processReportDesignDocAndRenderRepor() is below for whole class code download the example project :


    * This is overridden method which responsible for processing report  i.e .rptdesign document.and also rendering the report.
It also handles downloading the report.
   protected void processReportDesignDocAndRenderReport(HttpServletRequest request,
               HttpServletResponse response) {
         //get report name from request object.
         String reportName = request.getParameter( this.reportNameRequestParameter );
         //"Processing report:"+reportName);
         //get format in which we are going to render report i.e:html,pdf,excel
         String format = request.getParameter( this.reportFormatRequestParameter );
         //pagination handling
         String pageNumber = request.getParameter("pageNumber");
         int currentPageNumber=0;
               currentPageNumber = Integer.valueOf(pageNumber);
         //give the download report Name here.
         String downloadFileName = "MyReport";
         //Base URL
         String baseUrl = request.getScheme() + "://"  + request.getServerName() + ":"  + request.getServerPort()+request.getContextPath();
         ServletContext sc = request.getSession().getServletContext();
         if( format == null ){
               format="html";//default format
         IReportRunnable runnable = null;
         //opend design document
         runnable = birtEngine.openReportDesign( sc.getRealPath("/Reports")+"/"+reportName );
         //first process the report using Iruntask which will create the temp.rptdocument
         IRunTask iRunTask = birtEngine.createRunTask(runnable);
         iRunTask.getAppContext().put( EngineConstants.APPCONTEXT_BIRT_VIEWER_HTTPSERVET_REQUEST, request );
         //put the parameter values from request to the report parameter
         iRunTask.setParameterValues(discoverAndSetParameters( runnable, request ));
         //create temp rpddocument"/Reports")+"/temp.rptdocument");
         //now do the rendering operation
         IReportDocument reportDoc = birtEngine.openReportDocument( sc.getRealPath("/Reports")+"/temp.rptdocument" );
         IRenderTask iRenderTask= birtEngine.createRenderTask(reportDoc);
         //set the format
         response.setContentType( birtEngine.getMIMEType( format ));
         IRenderOption options =  null == this.renderOptions ? new RenderOption() : this.renderOptions;
         //if html set html related options
         if( format.equalsIgnoreCase("html")){
               HTMLRenderOption htmlOptions = new HTMLRenderOption( options);
               htmlOptions.setImageHandler(new HTMLServerImageHandler());
               htmlOptions.setBaseImageURL(baseUrl+"/images");//TODO:Change from local host to actual path
               //if pdf set pdf related downloading options
         }else if( format.equalsIgnoreCase("pdf") ){
               PDFRenderOption pdfOptions = new PDFRenderOption( options );
               pdfOptions.setImageHandler(new HTMLServerImageHandler());
               pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.FIT_TO_PAGE_SIZE);
               response.setHeader(  "Content-Disposition", "attachment; filename="+downloadFileName );
         //if XLS set XLS related downloading options
         }else if(format.equalsIgnoreCase("xls")){
                 EXCELRenderOption xlsOptions = new EXCELRenderOption(options);
                 response.setHeader(   "Content-Disposition", "attachment; filename="+downloadFileName);
                 xlsOptions.setImageHandler(new HTMLServerImageHandler());
                 //xlsOptions.setOption(IRenderOption.EMITTER_ID, "");
                 xlsOptions.setOption(IRenderOption.EMITTER_ID, "");
               response.setHeader(  "Content-Disposition", "attachment; filename=\"" + downloadFileName + "\"" );
          * This is used for pagination and setting the page number we want to display
         long pageCount = iRenderTask.getTotalPage();
               if(pageCount >=currentPageNumber){
         //save the page count in session to use for pagination.  
         //using this page count we can implement pagination.
         request.getSession().setAttribute("pageCount", pageCount);
         //render report
         //close task and doc
         //"Processing report completed successfully:"+reportName);
         }catch (Exception e) {
               //logger.error("Exception while proceessing report ",e);

BirtEngineFactory  and ReportParameterConverter classes are pretty straight forward.
Please click here to download source.
Jsp and Sample Reports

        There is one Reports.jsp located in /WebContent/jsp/Reports.jsp which used for handling report loading . This is simple jsp which has left navigation div and center div. When report is selected from the left navigation it will be loaded in center div and this is an ajax call for loading report.Also download option are above the center div which allows user to download report in pdf,xls and doc format. Screen shots of jsp is in below section.

I have created two sample reports. These reports are located in /WebContent/Reports directory.

  • First_Report.rptdesign (Hello World Report)

This is simple report contains one Hello world message and one image.

  • books_report.rptdesign

This report will show the details books in table and it will show pie chart of total price by book type below the table.This reports uses xml data source to load the details.The books.xml is located in /WebContent/ReportXmlDatasource/books.xml.

To locate the books.xml check the data source url is working by hitting test connection

as shown below. If it is not working then browse to the books.xm manually.
Currently url is :http://localhost:8080/BirtIntegration/ReportXmlDatasource/books.xml

Data Source window:

Screen Shot for Books Details Report:

Visit below link for part2 and downloading example project:
Birt Integration With Web Application Part2


  1. This is a great example!
    As far as I tested, it does not work with Reports using Parameters.
    Would it be possible to show the Parameter options if Report contains parameters?

  2. Yes it is possible to send parameters to report.
    put the parameters in request with the same name as report parameter.

  3. Hi Vikaram,
    Thanks a lot for the good example with enough explanation
    Is possible to enable web viewer in your example , if yes how it can be done
    Please clarify me.


    Barani Kumar

  4. Hello Barani,

    This example demonstrate integration of Birt engine withing your web application is a simple servlet project which configures and start birt engine using birt api.It will follow below steps for generating reports.
    1)When application context loads it will start birt engine.e.g tomcat start it will start engine
    2)Create .rptdesign doc and put in webapps or web-inf folder
    3)Make request from jsp/html page to .rptdesign with report parameters in request.
    4)This request will be handled by servlet which is having access to birt engine. Engine will process the .reptdesign and it will convert request parameters to report parameters.
    5)After processing report based on the output type it will render report e.g html,excel,pdf ,doc etc.

    So in this scenario you won't need the web viewer.

    Note*:you can easily implement pagination.

    Please go through the code for better understanding.

  5. Hi Vikram,

    First of all let me thank you for such a brilliant effort. Can you plz be a bit more elaborate on passing report parameters with integration? Thing is that, when I preview the report from designer I see the parameter selection dialog coming up, however on integration I am not being able to do so and the report is being generated with the default values of the parameters.


  6. Hi Vikram,

    How to sort table columns on client side(Using java script)


  7. You have to send the parameters in your HTTP request and the name of the form element should be same as the report name. e.g if your report parameter name is firstName then you should have input field with name="firstName" in your form or http://localhost:8080/loadUsersList?firstName="anonymous" in url.

    Possibly I will create example and post it soon.


  8. Hey I am trying to run your sample project, when I click on any report mention on jsp I gets server error 500,what to do ?
    And also I want to pass some parameters in my report through jsp or web interface.How can I add ?

  9. Hi Vikram

    Thanks for the wonderful post. I have tried the same and it is working fine.
    Only problem I had was when downloading the reports, it was downloading with the name 'MyReport' and without any extension. I had corrected that in ReportRenderer class.

    Now I don't know how to go ahead with pagination.. Do you have any steps what are all have to be done in the design, jsp etc..


  10. Hi Carollne,

    Below are the steps to implement pagination.
    1) open your report in eclipse report design perspective and go table properties and set Page Break Interval to 10 records per page or what ever you need.
    2)In class ReportRenderer go through processReportDesignDocAndRenderReport method you will see the pagination code with comments ,which is Already implemented you just need to modify or use it as it is.

    1. Hi Vikaram,

      Thanks a lot for your reply.

      I've tried yesterday exactly what you have mentioned in these steps.

      My problem is the report is paginated but all sections are displayed in the same page.

      I guess we have to implement the jsp part to list the page numbers, prev, back and write some code on the front end so that it will work..

      Anyway, I'll download your latest example and try and let you know.


    2. Hi Vikram

      It was working.. I've customized according to my need. Thanks a lot.


  11. I see that pagination is really troubling you guys. So I have implemented pagination.

    Please download sample project from "Birt Integration With Web Application Part2" i.e below link


  12. Hello,Vikram i have try to load report using spring MVC.
    I hva used your code to process parameter and for all other stuff.
    but wen i requesting for report it throws Exception
    I have bind all jar of birt run time.

    1. please make sure that all jars are in classpath. if you are using maven please check below link for maven dependancies for birt:

  13. Hi Vikram,

    First of all, let me thank you for this brilliant example.
    None of the documents in Eclipse narrates such a brilliant working example.

    However, I am unable to actually run this in my system. Can you please give me few lines on how to set this up in eclipse ?


  14. Hi Mangalam,

    Please check above installation section.


    1. This comment has been removed by the author.

    2. This comment has been removed by the author.

    3. Hi Vikram,

      Thanks for the post.

      I have downloaded pagination project and imported in eclipse. Followed as per the instruction. But i am not able to run. When I click on Hello world report or Book detail report I get class not found exception. Can you help me on this:

      java.lang.NoClassDefFoundError: org/eclipse/birt/report/engine/api/IRenderOption
      at BirtIntegration.BirtViewer.ReportProcessor.initilizeBirtEngine(
      at BirtIntegration.Controller.BirtReportController.init(
      at javax.servlet.GenericServlet.init(

      ================and =========================================================

      aused by: java.lang.ClassNotFoundException:
      at org.apache.catalina.loader.WebappClassLoader.loadClass(
      at org.apache.catalina.loader.WebappClassLoader.loadClass(

    4. Hi Krishna,

      Copy the reportengine/lib contents(jar files) and paste them in Projectname-->WebContent-->WEB-INF-->lib folder in eclipse.

      Check if it helps. I also got the same error and resolved this way.


  15. Hi Vikram,

    Thanks once again for the wonderful example. I am sure this is one of the best working and practical example available (after a week of searching for proper examples) :)

    However, I am just a week old with BIRT and not very familar with the concepts. Is it possible for you to elaborate the above example in a little more elaborate manner?

    Also w.r.t parameters being passed to BIRT (from JSP to .rptdesign files) , if you could post a small example it would be great.

    You may also reach me on


  16. Hi I am trying to send the parameter in my report so to pass it ? do I need to add this parameter in url of report ?help..
    And also I made a report with jdbc which is showing only one page in the html output as well as in downloaded to resolve it ?

  17. HI vikarm,
    Can you please help me oue I got stuck,I need to pass some parameters in my report through jsp page,can you help me out what exact steps I need to do.
    Thanks in advance.

    1. if your report parameter name is say "name"
      then pass name value in url e.g as "http://localhost:8080/report?name=chhabra"
      i.e pass your report parameter values as form parameter.

      I have already explained this above.

  18. How do we evaluate whether the generated report has data in it.
    Below is my code

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public void generateReport(String fileName, String destinationPath,String reportType, String paramValue) {
    //Variables used to control BIRT Engine instance
    EngineConfig conf = null;
    ReportEngine eng = null;
    IReportRunnable design = null;
    IRunAndRenderTask task = null;
    HTMLRenderContext renderContext = null;
    HashMap contextMap = null;
    HTMLRenderOption options = null;

    conf = new EngineConfig();
    // conf.setEngineHome("C:/birt-runtime-3_7_2/ReportEngine");

    eng = new ReportEngine( conf );

    try {
    design = eng.openReportDesign(PropertyResolver.ReadProperty("INPUT_LOCATION") + fileName);
    } catch (Exception e) {
    System.err.println("An error occured during the opening of the report file!");

    task = eng.createRunAndRenderTask(design);

    renderContext = new HTMLRenderContext();
    contextMap = new HashMap();
    contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext );
    task.setAppContext( contextMap );
    task.setParameterValue("reporttype", reportType);
    task.setParameterValue("paramval", paramValue);

    options = new HTMLRenderOption();
    options.setOutputFileName(PropertyResolver.ReadProperty("OUTPUT_LOCATION") + destinationPath +".pdf");

    try {;

    } catch (Exception e) {
    System.err.println("An error occured while running the report!");

    //Yeah, we finished. Now destroy the engine and let the garbage collector
    //do its thing
    System.out.println("All went well. Closing program!");

    1. I think you can do this in report designer when designing report.
      You can use script there.
      Check below link for report scripting :

  19. Hello,

    I have the following

    1).rptdesign file
    2)a eclipse dynamic webproject(not a eclipse report project) where i kept the .rptdesign in Reports folder
    3)then i created a simple java file in the web project which uses the birt report engine api to generate report as xls.
    4)i put all the runtime libs from birt runtime folder into my webtier/webinf/libs
    5)after running the java file an empty excel file is created.
    with the below error on console at LINE: handleFatalExceptions
    SEVERE: Error happened while running the report.
    java.lang.NoClassDefFoundError: org/eclipse/datatools/connectivity/oda/profile/OdaProfileExplorer

    1. Could you please provide more information ?

  20. i had gone through your example my questions are as follows:
    1.i had downloaded birtwebviewer which consist of one the example report test.
    which has in built paging and button to import in any format so how can i integrate same as your project or is there any other way plz help me out

  21. Hi Vikram,

    Once again thanks a lot for all your efforts. I have one more doubt in this integration.

    The requirement is to show the data in html format, without pagination.

    I can show that, but the master page and headers are repeated.

    How to remove the Master page and the header in all the pages except first page?

    Please let me know your views on this.


    1. Are you using pagination?
      Please send me screen shots, So I can help.

    2. No i am not using pagination. How to attach files in your blog?

    3. This comment has been removed by the author.

    4. Mail me at

  22. sent the file. please check. thanks a lot.

  23. Hi,The most commonly delivered using AJAX (Asynchornous JavaScript and XML) where the JavaScript will take a user action in Web Design Cochin and send that data to the server for processing via XML, then receive a response from the server and use JavaScript again to update the user interface (web page). Thanks...

  24. Hi Vikram,

    thank you very much , it is really the best example in the internet, it very esay,
    you are the best.

    good luck :)

  25. Hi Vikram,
    Do the web application with birt work in java 1.5 version?
    We have OC4J server with java 1.5 and while deploying the war file of the birt web application, error is thrown as "Operation failed with error: Error parsing annotation for class BirtIntegration.Controller.BirtReportController ". But is works fine at my localhost with java 1.6 version.
    Error is as:
    [Dec 6, 2013 10:35:20 AM] Application Deployer for BirtIntegration STARTS.
    [Dec 6, 2013 10:35:20 AM] Copy the archive to /oracle/product/web/j2ee/SahajApps/applications/BirtIntegration.ear
    [Dec 6, 2013 10:35:20 AM] Initialize /oracle/product/web/j2ee/SahajApps/applications/BirtIntegration.ear begins...
    [Dec 6, 2013 10:35:20 AM] Unpacking BirtIntegration.ear
    [Dec 6, 2013 10:35:20 AM] Done unpacking BirtIntegration.ear
    [Dec 6, 2013 10:35:20 AM] Unpacking BirtIntegration.war
    [Dec 6, 2013 10:35:22 AM] Done unpacking BirtIntegration.war
    [Dec 6, 2013 10:35:22 AM] Initialize /oracle/product/web/j2ee/SahajApps/applications/BirtIntegration.ear ends...
    [Dec 6, 2013 10:35:22 AM] Starting application : BirtIntegration
    [Dec 6, 2013 10:35:22 AM] Initializing ClassLoader(s)
    [Dec 6, 2013 10:35:22 AM] Initializing EJB container
    [Dec 6, 2013 10:35:22 AM] Loading connector(s)
    [Dec 6, 2013 10:35:22 AM] Starting up resource adapters
    [Dec 6, 2013 10:35:22 AM] Initializing EJB sessions
    [Dec 6, 2013 10:35:22 AM] Committing ClassLoader(s)
    [Dec 6, 2013 10:35:22 AM] Initialize BirtIntegration begins...
    [Dec 6, 2013 10:35:22 AM] Initialize BirtIntegration ends...
    [Dec 6, 2013 10:35:22 AM] Started application : BirtIntegration
    [Dec 6, 2013 10:35:22 AM] Binding web application(s) to site default-web-site begins...
    [Dec 6, 2013 10:35:22 AM] Binding BirtIntegration web-module for application BirtIntegration to site default-web-site under context root BirtIntegration
    [Dec 6, 2013 10:35:22 AM] Operation failed with error: Error parsing annotation for class BirtIntegration.Controller.BirtReportController

  26. HI Vikram

    This is Great Example and thanks for sharing this.

    normally I run reports using folwong format:


    can't we use same run__? commands.


  27. Dear Vikram,
    Thanks for sharing the project.Can u explain how can i pass parameter through my java code.As u have made a static project by given a static xml.I want to pass a parameter and for that particular report should be generated.
    I tried this by using birt tool but i want to do this my web application as u did.
    Please Suggest me if u know.....

  28. Dear Vikram,

    Thank you for the detailed explanation of using XML as a datasource and integrating this with an Web app. Could you explain how do we change this for data from POJO classes.
    For e.g., the rptdesign indicates that this has a address, list of details (this will be a table), logo (image). All these are in different POJO classes.
    Appreciate your guidance on this.

  29. Hi,
    I'm trying to run the project without pagination support, but it doesn't work. I access to http://localhost:8080/BirtIntegration page from the browser but I obtain the next message: "The requested resource () is not available".
    is there some problem in your web.xml?

    Thanks in advance!

  30. can u provide a demo explaining how to design reports in Spring MVC with using BIRT designer?

  31. can u provide a demo explaining how to design reports in Spring MVC without* using BIRT designer?

  32. Dear Vikram,
    Thanx for the post and code very impressive post and detailed explanation .

    I have a doubt regarding " ' temp.rptdocument ' " file generation . I dont know wither I am in right approach.. could you plz clear it.

    temp.rptdocument file is regenerated each time for each request. if parallel many request comes.... and they will be processing parallely.. so if 1st request try to read the file after writing and at same time 2nd request try regenerate temp.rptdocument or reginerated before reading it by 1st request....... there is chance of wrong responce....

    can you please enplane me wither
    I am right or wrong.

    Thank you.

  33. Sorry Guys I did not get chance to further improve this example. Please consider this as an reference example which you can further improve (Improve as per your need). Use documentation provided by eclipse to suite your needs.


  34. Hiee..!!!
    Vikram I really appreciate your effort I have successfully installed your example in my app if you can post or mail a simple example how to get report according to passed parameters i will be very thankful to you...

    1. This comment has been removed by the author.

    2. Hi Chetan it's typically form parameters you need to send in ajax request which will act as report parameter. It's difficult for me spend time now. But I am sure if you spend some time on class ReportRenderer you will understand how request parameters are converted to report parameter. Check below method in ReportRenderer :
      discoverAndSetParameters(...) (this method where you should go)

      I would suggest you should go though part1 of this post and simultaneously debug code.


    3. Hi Vikram can u post Query to be written for paramiterized report in data set
      i have written "Select * from User where deptId = ?" but its show error.
      plz reply or you can mail me

  35. my mailid is

  36. Hi Vikram,

    its very good example. but I can not create a link to another report.
    I created a blank report, and became the author hyperlink column, and I tried both options and URI drill-through direct to the new report, but both messages generate open a new page with the error message.

  37. Hi Virkram,

    I plan to integrate BIRT with my existing web application. Do you think that it would be possible to integrate viewer like your in example with the window using EXT JS 4 ? I mean I'd like to create webapp using Ext, where one functionality is reporting tool with a viewer like yours.


    1. Yes, It is possible to integrate.I have used jQuery framework for javascript. You need to make changes in "report.js" to support EXT JS.

  38. Hi Vikram,
    Thank you very much for the wonderful example.. I have downloaded your example and try to run.. find the following error
    Can you please advice..

    Jun 09, 2014 3:20:06 PM openReportDesign
    SEVERE: D:\eclipseBIRT\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\BirtIntegration\Reports\null not found!

  39. Amazing Vikram... This is of great help!
    Awaiting few most posts like this... :)

  40. Great Example..Can you please explain how to integrate this project with Struts?

  41. Hi Vikram,
    I am using birt 4.3.2,I would like to ask you,
    - Can we externalize birt database so that when we change DB environment we just need to do change in only one place as nw I need to change each and every rptdesign file.
    - Can we Download a report in xlsx format(if yes,can u provide me code for that with images and graph)
    - How Can we pass multiple values to a single parameter in birt report(please provide me code for that)

  42. great work ..! very helpful..!

    but i have a question here that,

    if i have installed birt plugin in eclipse (indigo) or any other on ubuntu o.s.
    so i am unable to find birt engine runtime\lib there, so i need to download only birt runtime from net again to find and add jars to WEB-INF/lib

    that means i done double download

    is there any other alternate for this ... or i am doing something wrong

    i followed these steps
    1)instlled plugins for birt 3.7
    2)came on this blogpost and started following procedure
    3)downloaded source code
    4)...stuck for library files.
    5) again downloaded birt runtime only
    6) located jar's
    7)added to WEB-INF\lib

    8)HAVING FUN....


  43. Hai Vikram,

    Hi, I need to generate report through jsp page. For example, there is a country dropdown in jsp, select any country & submit, generate the BIRT report with data for the selected country in same or another jsp

    please help me..this is urgent task for me.

  44. Is this possible if web app doesn't use jsp pages?

    1. yes possible to use jsp page or static html page as a front end.
      but ultimately request should be sent to birt engine so it must be handles by HTTPServlet or other servlet or a jsp page and forward to a birt singleton handler class

  45. Hi Vikram!

    Thanks for sharing your knowledge.

    I'm trying to apply the your JSP example. What I get on the web-page, when clicking on both reports in the left div is the following messafe in the central div : "Sorry but there was an error getting details ! 404 Servlet loadReport is not available". As far as I understand, tomcat web-server cannot locate required servlet "loadReport", which is described in web.xml file. How we sort this problem out? Where this servlet actually located?

  46. Hi Vikram!
    Thanks for sharing your knowledge.
    Have an idea how integrate the internationnalization : label , title ...
    I do like this
    -declared files and copied in the same repositories of my *.rptdesign
    - In rptdesign add


    exemple of use key in my template

    method run report
    iRunTask.setLocale(locale); //locale provided from servlet

    but when running the report it dasn't work
    Anu idea how to resolve problem

  47. - In rptdesign add

    <simple-property-list name="includeResource">

    example of use key in my template
    <text-property name="title" key="title">Instance by states</text-property>

  48. Hi Vikram

    can you please help me how to get dynamic data from database using BIRT please.....

  49. Hi Vikram

    can you please help me how to get dynamic data from database using BIRT please.....

    in this sample example static data is displaying how to get dynamic data please help me out as soon as possible its very very important ......

    mail me @

  50. Hi Vikram

    can you please help me how to get dynamic data from database using BIRT please.....

    in this sample example static data is displaying how to get dynamic data please help me out as soon as possible its very very important ......

    mail me @

  51. Great example with good illustration. Any has idea on how this can work with the grails framework? Thank you.

  52. Any one has idea to integrate BIRT with seam framework? Thank you.

  53. Any one has idea to integrate BIRT with seam framework? Thank you.


  54. Thanks for sharing, I will bookmark and be back again

    Google App Integration Chennai

  55. This is a really great example to start with Birt. Thanks for sharing.
    I spent some time struggling to find the correct URL to hit the report though.
    Found it after debugging ReportRenderer class.
    The URL for one of the reports is: http://localhost:8080/BirtIntegration/loadReport?ReportName=books_report.rptdesign

    In case you are interested, I am using this platform to test:
    Eclipse IDE for Java and Report Developers
    Version: Mars Release (4.5.0)
    JDK 1.7.0_79
    Tomcat 7.0.69

  56. This comment has been removed by the author.

  57. To access Reports.jsp use below url

    Very nice post :)

  58. this article is what I'm looking for ,thanks for sharing this information but could you please share the web project example cause the link is broken

  59. hi vikram ,
    thanks for sharing such a good article, can you please share the web project example, the link is not working

  60. Thanks for sharing . Could you please share the web project link ?

  61. very good article nice work. can you please share project link or email me at