Tuesday, July 1, 2008

Using the BIRT Report Viewer

Overview

This Viewer is an AJAX based J2EE application that illustrates usingthe BIRT engine to generate and render report content.

The Web Viewer can be used to generate and render reports, and also supports more interactive features such as table of contents, exporting report content to several formats, client and server side printing, as well as report pagination. The features available will depend on what servlet mapping is used, the settings available in the web.xml file and what values are passed as parameters.

The Example Viewer can also be deployed as an Eclipse plugin in an RCP application.

The Example Viewer also ships with a tag library which can be used to provide report functionality within your existing web applications.

Servlet Mappings

The BIRT Web Viewer consist of two main Servlets, the ViewerServlet and the BirtEngineServlet. These Servlets handle three mappings: ( /frameset,/run, and /preview).

The /frameset mapping renders the report in the full AJAX viewer complete with toolbar, navigation bar and table of contents features. This mapping also generates an intermediate report document from the report design file to support the AJAX based features.
eghttp://localhost:8080/viewer/frameset?__report=myreport.rptdesign&parm1=value1

The /run mapping runs and renders the report but does not create a report document. This mapping does not supply HTML pagination, TOC or toolbar features, but does use the AJAX framework to collect parameters,support report cancelling and retrieve the report output in HTML format.
eghttp://localhost:8080/viewer/run?__report=myreport.rptdesign&parm1=value1

The /preview mapping runs and renders the report and does not generate a report document, although an existing report document can be used in which case just the render operation occurs. The output from the run and render operation is sent directly to the browser.
eghttp://localhost:8080/viewer/preview?__report=myreport.rptdesign&parm1=value1




Web Viewer Web.xml Settings

The web.xml file contains many settings used to configure the Viewer. These settings are illustrated below.

Attribute

Description

BIRT_VIEWER_LOCALE This setting sets the default locale for the Web Viewer.

BIRT_VIEWER_WORKING_FOLDER This is the default location for report designs.  If the report design specified in a URL parameter is relative, this path is pre-pended to the report name.

BIRT_VIEWER_DOCUMENT_FOLDER If a report document parameter (__document) is not
used, this is the location that report documents will be generated in.  If this setting is left blank, the default value “webapp/documents” will be used.  If the__document URL parameter is used and the value is relative the report document will be created in the working folder.

WORKING_FOLDER_ACCESS_ONLY If this value is set to true, reports will only be searched for, relative to the working folder.  This prevents a user from entering a full path to a report.  Relative paths below the working folder are accessible.

BIRT_VIEWER_IMAGE_DIR Specifies the default location to store temporary images generated by the report engine.  If this setting is left blank, the default location of webapp/report/images is used.

BIRT_VIEWER_LOG_DIR Specifies the default location to store report engine log files.  If this setting is left blank, the default location of webapp/logs is used.

BIRT_VIEWER_LOG_LEVEL Sets the report engine log level.  Valid values are:
OFF
SEVERE
WARNING
INFO
CONFIG
FINE
FINER
FINEST

BIRT_VIEWER_SCRIPTLIB_DIR Specifies the default location to place Jar files used by the script engine.  These can be Jars used by script engine or jars containing event handlers written in Java.  These Jars are appended to the classpath.  If this setting is left blank the default value of webapp/scriptlib will be used.

BIRT_RESOURCE_PATH This setting specifies the resource path used by report engine.  The resource path is used to search for libraries, images, and properties files used by a report.  If this setting is left blank, resources will be searched for in the same directory as the report.

BIRT_VIEWER_MAX_ROWS

Specifies the maximum number of rows to retrieve from a dataset.

BIRT_OVERWRITE_DOCUMENT Specifies whether to overwrite the report document every time a report is executed.  The default is set to true.  Valid values are true and false.

BIRT_VIEWER_CONFIG_FILE Specifies the location of the viewer.properties file.  This file contains various settings used by the viewer.

BIRT_VIEWER_PRINT_SERVERSIDE This setting specifies whether server side printing is supported.  If set to OFF the toolbar icon used for server side printing will be removed automatically.  Valid values are ON and OFF.

HTML_ENABLE_AGENTSTYLE_ENGINE This setting determines how BIRT styles are handled with the HTML emitter.  If set to TRUE, the BIRT engine will output the styles directly to the report and depends on the browser to implement the style calculations.  If set to FALSE the emitter will use the BIRT style engine to calculate the styles and will output the results directly to the report.

Parameters

The example viewer has a distinction between report parameters and viewer configuration parameters.  Report parameters are used by the reportdesigns and configuration parameters affect the appearance and featuresavailable to the example Viewer application.  In either case these parameters can be passed as URL parameters by entering the &parmname= valuesyntax, passed in a html form, or passed using the jsp:parm tag.  Configuration parameters by default start with a “__” prefixed to the parameter name.< /FONT>< /FONT>

Report parameters that are designated in the design as required and are not entered in one of the above methods will cause the viewer to launch a parameter entry dialog box.  Additionally the example Viewer tag library contains tags to configure and set parameters as well.

Attribute

Description

__id A unique identifier for the viewer.

__title Sets the report title.

__showTitle Determines if the report title is shown in the frameset viewer.  Defaults to true.  Valid values are true and false.

__toolbar Determines if the report toolbar is shown in the frameset viewer.  Defaults to true.  Valid values are true and false.

__navigationbar Determines if the navigation bar is shown in the frameset viewer.  Defaults to true.  Valid values are true and false.

__parameterpage Determines if the parameter page is displayed.  By default the frameset, run and preview mappings will automatically determine if the parameter page is required.  This setting will override this behavior.  Valid values are true and false.

__report Sets the name of the report design to process.  This can be an absolute path or relative to the working folder (See web.xml settings).

__document Sets the name for the rptdocument.  The document is created when the report engine separates run and render tasks, and is used to support features like table of contents and pagination.  This setting can be an absolute path or relative to the working folder (See web.xml settings).  If no document parameter is used, a unique document is created in the document folder (see web.xml settings).

__format Specifies the desired output format, such as pdf, html, doc, ppt, or xls.

__locale Specifies the locale for the specific operation.  Note that this will override the default locale.  Order of precedence is as follows:

__locale parameter.

Locale from client browser.

Locale web.xml setting.

Locale for the application server.

__svg Specifies whether SVG is supported.

__page Specifies specific page to render.

__pagerange Specifies page range to render. Eg 1-4,7.

__isnull Specifies that a report parameter has a null value.  Eg __isnull= Myparameter.</FONT>< /FONT>

__islocale Specifies whether the parameter is localized.

__masterpage Indicates that the report master page should be used or not.  Valid values are true and false.

__overwrite This setting if set to true will force an overwrite of the existing report document. This setting will override the

initial setting in the web.xml.  By default the report document is overwritten anytime the report design is changed.

__bookmark Specifies a specific bookmark within the report to load.  The viewer will automatically load the appropriate page.

__rtl Specifies whether to display the report in right to left format.  This setting defaults to false.

__fittopage Specifies whether PDF generation should fit content to a page.  Valid values are true and false.

__resourceFolder Specifies the resource folder to use.  This setting will override the default setting in the web.xml.  The resource folder is used to locate libraries, images, and resource files.

24 comments:

Virgil said...
This comment has been removed by the author.
Virgil said...

Hi Toba, thanks for posting this great info on the BIRT Viewer. There is another reference on using the viewer with more details located at BIRT Exchange if you want to post a link.

Anonymous said...

Hello Toba Sayed,
I am running Birt2.2.2 in a Eclipse RCP with webviewer parameter as /frameset.

problem:
Not able to get data on to the report

scenario:
1. created rptdesign file using scripteddatasource
2. wrote a java script in rptdesign file to pull data from a java object.
3. created a java class which holds the data to be presented.
4. placed this jar file containing this class in birt-report-framework-2_2_2\eclipse\plugins\org.eclipse.birt.report.viewer_2.2.2.r22x_v20071213\birt\WEB-INF\lib
5. I have other classes which computes data and fills this intermediate Object. All these are jarred and placed in the path mentioned in step4.
6. Run RCP it fails to load data. No error shown.

Any idea, what could be wrong?

Thanks in advance.

Thanks,
Ramapriya

Anonymous said...

i very adore your own writing kind, very useful.
don't quit and keep penning considering it just well worth to look through it.
looking forward to looked over much more of your web content, have a good one :)

Anonymous said...

Well done is well-advised b wealthier than well said.

Anonymous said...

I love your blog. So much useful information. Thank you.

Anonymous said...

Well done is well-advised b wealthier than spectacularly said.

Term Papers said...

I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards

Anonymous said...

n the whole world's life, at some pass‚, our inner foment goes out. It is then break asunder into passion at near an encounter with another hominoid being. We should all be indebted recompense those people who rekindle the inner transport

Send Flowers to Dubai said...

I suggest this site to my friends so it could be useful & informative for them also. Great effort.

Canada flower shops said...

Hey great stuff, thank you for sharing this useful information and i will let know my friends as well.

Unknown said...

vimax pills is powerful natural herbal male enhancement products that increase your penis size, vimax is best quality products which have clinical proven to work, second rated pills is vigrx plus, there are is best penis enlargement products on the market since 2004. Now is time for you to increase sexual health, sex drive, sexual stamina for sexual pleasure.

Anonymous said...

I love this site toba2008.blogspot.com. Lot of great information. I am Tech guy. I have been a Desktop Technician since 1997 but have tons of other interests. In my spare time... Oh, wait I don't have any of that (just kidding). Anyways, I have been aware of this website for quite some time and decided to join the community and contribute as well as learn a lot from others. I am excited to get started on the forum and am looking forward to a great journey together. Lots of potential friends and I look forward to meeting many online.

Green Parks said...

Hello I want to congratulate to them by its site of the Web of the excellent looks like entertained and very good very to me it elaborated.

Anonymous said...

Isotretinoin capsule
What is this medicine?

ISOTRETINOIN treats severe acne that has not responded to other therapy such as antibiotics.

Anonymous said...

Девушки, кто-нибудь обстригал длинные ворлосы, не пожалели?

[IMG]http://v7em.com/go/vnimanue.png[/IMG]

Anonymous said...

Adult dates and sex dating gives you the chance for hookups with sexy people and swingers

Penis Enlargement Pills said...

nice posting keep blogging,....
i am very new in blogging, please and kindly visit my blog,..
thanks a lot...

how to get rid of cellulite said...

I’ve been looking for a while for any nice content material articles in relation to this particular point . Looking out in Yahoo and google I lastly found out this url. After studying this submit I am delighted to say that I get a beautiful uncanny feeling I stumbled upon the very things I used to be wanting for. I most certainly will make sure to don’t neglect this blog and take a look consistently.

viagra samples said...

That is very good comment you shared.Thank you so much that for you shared those things with us.Im wishing you to carry on with ur achivments.All the best.

www.buybuyvimaxpills.com said...

Hi Guys,,,,,,I hope my article useful yes :
A larger penis size is ideal for the men, prove efficacy before and after using the Vimax you will feel something that you never felt before in your sexual life, 98% of men admitted on the benefits after using the Vimax pill can last a long time to have sex, increasing thickness of the penis, and increase your penis length up to 3 -4 inches and it is permanent.
according to the testimony of several people who use the Vimax pill regularly for six months.

- within three months will increase your penis size up to 3-4 inches '​​permanent'
- has a size larger, harder erections. Because of increased blood flow your erections grow harder.
- increase endurance and your sexual desire increased 100%
- help stop premature ejaculation since "Forever"
- create a strong orgasm and intense (can be 2-3 times)

open my site please http://www.buybuyvimaxpills.com

LOUISVILLE KY HOTEL said...

Fantastic!! I love it!! Everybody should enjoy your post. Thanks for writing the pattern.

Unknown said...

thanks for all your nice comments

Escolaris said...

Hi Folks,

I'm using Myeclipse Report and I need to save it to disk, using:

birt viewer parameters, it's possible ? Similar to:








Please help me,