`
lpzhouyang
  • 浏览: 34251 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
社区版块
存档分类
最新评论

Using the BIRT Web Project Wizard

    博客分类:
  • Birt
阅读更多
转载地址:http://www.newsletterarchive.org/2007/12/06/277634-Using+the+BIRT+Web+Project+Wizard
今天看到一遍很不错的Birt Web Project文章,就转载过来和大家分享了。
Now that you have created your great looking BIRT reports, you need to deploy the design files to make them available to others. There are several different ways to deploy your BIRT report designs. These range from writing all the deployment code from scratch using the Report Engine APIs to writing no code at all with some of the commercial report servers. Somewhere in the middle, there is another option called the Web Viewer Example that will get you off to a nice start. This article will talk about the Web Viewer Example that ships with the Eclipse BIRT Runtime and introduce the BIRT Web Project Wizard that helps you integrate the Web Viewer and BIRT JSP tag library into a web application.

Introduction to BIRT
First, a little bit of information about BIRT. BIRT is a flexible, 100% pure Java reporting tool for building and publishing reports against data sources including databases, XML, Java objects, web services, and more. BIRT stands for Business Intelligence Reporting and Tools and is an Eclipse open source project that benefits from the rich capabilities of the Eclipse platform and a very active community of users. BIRT includes powerful report and chart designers, as well as runtime components for generating and deploying BIRT reports. The BIRT Report Designer provides easy-to-use wizards and point-and-click layout capabilities that are similar to many web page design tools. Finished reports are easily integrated with Java Server Pages, servlets, or existing Java applications and leverage existing application server infrastructure. The rest of this article assumes some level of familiarity with BIRT and will focus on using the BIRT Web Viewer from a BIRT Web Project and using the BIRT JSP tag library.

BIRT Web Project Wizard
To get started using the BIRT Web Project Wizard, you need to be using BIRT 2.2 or higher which can be downloaded here. While in the Eclipse IDE, select File | New | Project, and then select ‘Web Project’ from the ‘Business Intelligence and Report Tools’ section. Press Next and then provide a name for your project and select the Target Runtime for your deployment. I’m selecting Tomcat 5.5 for this example. You can browse and modify the rest of the available settings by selecting Next, or you can accept the defaults by pressing Finish.

Once you are finished, Eclipse will switch to the Java EE perspective so you can work with this type of web project. Locate your project in the Project Explorer and expand the WebContent folder to find index.jsp. Right click on that file and select Run As | Run on Server. Select the server you want to use or define a new server and press Next. Make sure your new BIRT Web Project is listed in the Configured Projects list on the right. Remove any other project that might be in this list and press Next and then press Finish. If everything went as expected, you will see a simple web page (see Figure 1) with a link to a report design example. Select ‘View Example’ to see the report. If you see “Congratulations” then you have successfully run the report.


Figure 1 – Web Viewer Example initial page

Once you have successfully run the example report, you can swap it out with a design of your own. Open index.jsp from the Project Explorer and look for a line near the bottom like the one below:

<a rel="nofollow" href="<%= request.getContextPath( ) + "/frameset?__report=test.rptdesign&sample=my+parameter" %>">View Example</a>

The web viewer is called by using URLs to the frameset servlet mapping and passes parameters specifying which report to run. To run your own report using this method, copy another rptdesign file to your project and replace ‘test.rptdesign’ with the name of your file. Notice that test.rptdesign used a parameter called sample and passed the value of ‘my+parameter’ to the report. Replace that part with your own parameter names and values if desired, or leave the parameters off the URL to use the default values. You can also add ‘__parameterpage=true’ to the URL to force the user to be prompted for the parameters.

If your report depends on external JDBC drivers, you will need to include those prior to running your report. To add your JDBC drivers so the viewer can see them, import your JDBC JAR files into the WEB-INF/platform/plugins/org.eclipse.birt.report.data.oda.jdbc_[version_xxx]/drivers directory. Run index.jsp again and select the View Example URL to run your report. If it was successful, you should see your report.


Figure 2 – Example Report running in the BIRT Web Viewer

BIRT JSP Tag Library
Another option for calling the BIRT Web Viewer from your web project is to use the BIRT JSP Tag Library. There are only 5 base tags (viewer, report, param, parameterPage, and paramDef) and each has several attributes. These JSP tags allow you embed reports or deal with parameters within your JSP page. The rest of this article will show you how to get started with the BIRT JSP tag library and show a few examples of the reports running within a JSP page. I won’t spend much time with the parameter tags as those were explained very well recently in this post from the BIRT World blog.

To get started using the BIRT JSP tag library, right click on WebContent in the BIRT Web Project and select New | Other… Select ‘JSP’ from the ‘Web’ category and then press Next. Provide a name for your JSP page and then press Next. Make sure ‘Use JSP Template’ is selected and then select ‘New JSP File (html,BIRT tag)’ and then press Finish. This JSP Template ensures that the taglib reference below is included.

<%@ taglib uri="/birt.tld" prefix="birt" %>

Once your page is created, you simply need to start typing “<birt…” to see the available tags (See Figure 3).


Figure 3 - BIRT JSP Tag Library

The ‘viewer’ tag allows you to generate and view a BIRT report and includes the Viewer toolbar with the report. The ‘report’ tag is the same as above except it does not include the toolbar. You can see that I used the ‘param’ tag with each to supply the parameter for the report. Output generated is shown in Figure 4. . <birt:viewer id="test1" reportDesign="test.rptdesign" width="600" height="200"> <birt:param name="sample" value="BIRT Rocks!"></birt:param> </birt:viewer>

<birt:report id="test2" reportDesign="test.rptdesign" width="600" height="200"> <birt:param name="sample" value="BIRT Rocks!"></birt:param> </birt:report>


Figure 4 - BIRT JSP Tag Library - 'report' tag and 'viewer' tag examples

If you want to prompt the user for the parameters instead of passing them in, you need to set the ‘showParameterPage’ attribute to ‘true’ like below. This will prompt the user for the parameters and then run the report in the same space allocated by the height and width parameters. (See Figure 5)

<birt:viewer id="test1" reportDesign="test.rptdesign" width="600" height="600" showParameterPage="true"> </birt:viewer>


Figure 5 - BIRT JSP Tag Library - 'viewer' tag using 'showParameterPage' attribute

These steps were intended to get you started with your BIRT Web Project deployment. There is more information available at the URLs below.

分享到:
评论
1 楼 yangzy666 2010-04-23  
老大要是把它翻译过来了,就更好了

相关推荐

    Web Service Proxy Wizard的介绍,安装,以及如何使用

    Contents: Introduction Installing the Web Service Proxy Wizard Using the Web Service Proxy Wizard Writing a WSP Client Cross-Platform Interoperability Conclusion

    西门子_Generating the Parameters for the Modbus TCP Communication using the Modbus TCP Wizard.pdf

    西门子_Generating the Parameters for the Modbus TCP Communication using the Modbus TCP Wizardpdf,

    kotlin-project-wizard-idea.jar

    kotlin-project-wizard-idea.jar

    Web Page Wizard-开源

    这套cgi脚本和perl模块套件使Web托管服务器可以为其客户端提供一些基于Web的工具来管理其自己的文件。 这些工具的范围从最基本的网页创建到复杂的文件管理。 类似于Geocities.com工具

    WebWizard-开源

    WebWizard是一个用Visual Basic.NET 2005编写的Web浏览器项目。尽管它仍处于Alpha状态且存在一些错误,但它已经成为半个体面的浏览器。 但是,存在一个导致其崩溃的错误。 你能帮我解决吗?

    JavaEE-8.0-api.zip

    j2ee(JavaEE) 8.0官方api压缩包,使用压缩软件解压后,点击跟目录的index.html可以在网页查看详细的j2ee 8.0的api说明文档

    ML6000 setup wizard

    ML6000 setup wizard The following procedure outlines the step for using the Setup Wizard to configure the ML6000.

    ReactJS by Example(PACKT,2016)

    In the second project, building a multi-step wizard form, you will learn about composite dynamic components and perform DOM actions. You will also learn about building a fast search engine by ...

    ReactJS by Example

    In the second project, building a multi-step wizard form, you will learn about co mposite dynamic components and perform DOM actions. You will also learn about building a fast search engine by ...

    CuteFTP 8 Professional

    CuteFTP 8 Professional New Feature Highlights New features for CuteFTP Professional include: ...Scheduling uploads from your local computer to a server using the Upload Scheduled Wizard.

    ddkwizard ddkwizard vs2003vs2008

    DDKWizard adds a new subfolder in the project creation wizard - see figure 2 - and presents all supported project types there. Currently these are Driver, Empty Driver, Native Application, Win32 ...

    Application Web Update Wizard-开源

    Web Update Wizard Framework使开发人员可以轻松地在主机站点上部署其更新,并允许用户使用Web Update Wizard应用程序下载它们。

    FME CRACK(超好用)

    FME CRACK:fme是现今超级好用的数据转换软件,(SafeFLEXlmInstaller.msi、licgen.exe、instructions(安装说明).txt) ... type by using the "FME Licensing Wizard" from the Start menu, Programs, FME.

    Hummingbird Exceed v13 2008, 64位版, part1

    Hummingbird HostExplorer Deployment Wizard Add-on 这个新型外接附件允许管理员从任何网络服务器将HostExplorer配置为具有用户化的外观。 完全的Windows 2000 支持——包括Microsoft Installer和Advertised ...

    lp wizard 下载.txt

    lp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txtlp wizard 下载.txt

    Mician uWave Wizard 7.5

    Mician uWave Wizard 7.5安装程序,需要的可以自行下载

    In this step we add a simple COM object to our server using

    In this step we add a simple COM object to our server using the New ATL Object Wizard.(25KB)

    lpwizard用户指南

    lpwizard用户指南

    自动封装生成工具Lp_Wizard使用教程

    自动封装生成工具Lp_Wizard使用教程,Lp_Wizard可创建AD,CADENCE,PADS等格式的封装

Global site tag (gtag.js) - Google Analytics