Birt integration into existing Web applications

Source: Internet
Author: User

We already have a javaweb application, now we want to implement the integration of the report

This is what my app looks like.

Description

1) Here is the birt4.4 version of the, download Birt-runtime-4.4.zip (in the official download), and then Birt.war decompression, you can see logs report scriptlib webcontent web-inf **.jsp * *.rptdesign these files and folders

2) put the content under the Web_inf in the corresponding directory of our own WEB application Web-inf, and merge it with the XML content of our application, birt the specific configuration of the XML in the document

3) Birt WebContent directory must be placed in the root of the Web application, if you want to put it in the directory you specify, such as my own application inside the Birt directory, you need to modify the Birt jar of Viewsevlets.jar in the three classes:    Org.eclipse.birt.report.servlet.ViewerServlet.java Org.eclipse.birt.report.servlet.BirtEngineServlet.java Org.eclipse.birt.report.taglib.ParamDefTag.java (need to use the Anti-compilation tool, I use jd-gui.exe here)

4) Design your own report or report template, put in the configuration file specified path, I am here in the Birt directory, such as the above eastcom_test_report.rpttemplate

5) Our own JSP page is directly redirected to the Birt engine for processing

<s:form id= "MYFORM"action= "/frameset" Method= "POST" theme= "simple" ><div id= "content" ><table><tr><th width= "13%" ><span> *</span> template name: </th><td width= "35%" ><div><s:textfield name= "ReportDesign.name" maxlength = "Readonly=" "true"/></div></td><th width= "17%" ><span>*</span> template route: </th &GT;&LT;TD width= "35%" ><div><s:textfield name= "reportdesign.designlocation" maxlength= "readonly=" True "/></div></td></tr><tr><th colspan=" 4 "style=" Text-align:center; " ><span> set the following report parameters </span></th></tr><tr><th colspan= "4" >&nbsp;</th ></tr><tr><th width= "13%" ><span>*</span> resources key:</th><td width= "35%" > <div><s:textfield name= "Resource_key" maxlength= "All" onblur= "check.required (This)"/><s:hidden name= "__report" value= "%{reportdesign.designlocation}" ></s:hidden>, which specifies the specific template name, It's going to match the path we put on the template or the report.</div></td></tr></table></div><div id= "operator" ><div class= "left" > </div><div class= "Middle" onclick= "Page.submit (True)" > Submit </div><div class= "right" ></div ><div class= "left" ></div><div class= "Middle" onclick= "Page.close ()" > Close </div><div Class= "Right" ></div></div></s:form>

6) If you are publishing to a WebSphere server, you need to include Itext.1.3.jar in Lib

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.