Professional Documents
Culture Documents
The Web Viewer now contains a tag library that can be used to
customize the behavior of the Viewer. This tag library can be deployed
by either deploying the viewer as normal or by using the new BIRT
Web Deployment project wizard. In addition, if you desire to have BIRT
deployed in one context and include the tag library in a separate
context this can be done by copying the birt.tld file to your WEB-
INF\tlds directory and copying coreapi.jar, modelapi,jar,
viewerservlets.jar and com.ibm.icu_3.6.1v20070417.jar from the
Viewer libs directory to the new context/web-inf/lib directory. Add the
following reference to your web.xml.
<jsp-config>
<taglib>
<taglib-uri>/birt.tld
<taglib-location>/WEB-INF/tlds/birt.tld
</taglib>
</jsp-config>
enlarge
For example the following JSP code will present the user with a set of
text boxes to enter the two parameters required for the report. The
pattern attribute specifies the Servlet mapping to be used and can be
set to frameset, run or preview.
<%@ page language="java" contentType="text/html; charset=ISO-
8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-
8859-1">
</head>
<body>
<birt:parameterPage id="birtParmPage"
reportDesign="TopNPercent.rptdesign"
name="my form"
pattern="frameset"
height="600"
width="800"
format="html"
title="My Viewer Tag"
isCustom="true"
showTitle="true"
showToolBar="true"
showNavigationBar="true"
>
TOP COUNT PARAMETER
<input type="Text" name="Top Count">
<br><br>
TOP PERCENT PARAMETER
<input type="Text" name="Top Percentage">
<br><br>
<input type="Submit" value="Run Report">
</birt:parameterPage>
</body>
</html>
If you wish the BIRT Engine to return the HTML it generates for the
parameter you can use the paramDef tag in conjunction with the
parameterPage tag.
The following code will call the BIRT engine to populate each level of a
cascade.
<%@ page language="java" contentType="text/html; charset=ISO-
8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-
8859-1">
</head>
<style type="text/css">
.class1 { background-color:#ff0000; color: #ffffff; }
</style>
<body>
Parameter Page 1
<br>
<birt:parameterPage
id="report1"
name="page1"
reportDesign="cascade_report.rptdesign"
isCustom="true"
pattern="frameset">
This code will produce the following output. Notice that the third level
is also being customized by using a style.
enlarge
Download the 2.2 build and try out the new tag library.
17 comments:
Anonymous said...
TIA,
Nils Kassube
9:11 AM
Jason Weathersby said...
Nils,
I did some testing with JSF 1.1 using Tomcat 5.5 and did not
have much luck. Most of the tags wrap the results in an IFrame
and use AJAX. Ideally I would have thought the %lt;f:verbatim>
tag would have worked, but not on my installation. The following
tag works because the results are returned in a div without
AJAX.
%lt;html>
%lt;f:view>
%lt;body>
%lt;birt:report id="birtViewer"
reportDesign="TopNPercent.rptdesign"
height="600"
width="800"
format="html"
isHostPage="false"
reportContainer="div"
>
%lt;birt:param name="Top Count" value="3">%lt;/birt:param>
%lt;/birt:report>
%lt;/body>
%lt;/f:view>
%lt;/html>
2:02 PM
Anonymous said...
So do I tried to use the BIRT tag with jsf and I found the same
problems of yours. I use the 'reportContainer="div"' and this do,
but If I use the ajax results the thing not work. Have some news
about?
Stefano
1:04 PM
Jason Weathersby said...
Stefano
I do not have an update on this yet. Can you log a bugzilla entry
for your issue?
Jason
6:45 AM
Anonymous said...
Hi Jason,
happy to read that you answered me, I use in my web app the
birt tag, althought I don't know use it very well. Unfortunately
the documentations that I found are few, and sometime not very
clear... So first of all I ask you if you have some link where I
found it more...
However, if you thought that the problem is inside of the tag, I
can replicate the problem with a little code and put in the
bugzilla.
Thanks
3:26 PM
Jason Weathersby said...
7:15 AM
Jason Weathersby said...
/deploy/viewerUsage2.2.php
7:16 AM
Anonymous said...
Thanks.
4:51 AM
Jason Weathersby said...
Jason
7:33 AM
Anonymous said...
Thanks again!
1:39 AM
Jason Weathersby said...
6:40 AM
Anonymous said...
it works fine and the report runs but when I press on the "Run
Report" button of the viewer I see again the default parameters
page
8:21 AM
Jason Weathersby said...
I see. You will need to make a JavaScript modification.
Under the
webcontent/birt/ajax/ui/report directory open up the
AbstractBaseReportDocument.js file and look for the
__beh_parameter function.
This may not be ideal as this will affect all reports. Another
option is to turn off the toolbar in using the taglib attribute
showToolBar="false" and implement your own. Or use the code
above and do a check on the report you are currently viewing.
Jason
8:56 AM
Anonymous said...
9:21 AM
Jason Weathersby said...
How are you first running the report? Are you not running it
through the custom parameter jsp page first?
11:05 AM
Anonymous said...
12:59 AM
Jason Weathersby said...
You could modify the
BirtParameterDialog.js file.
Change the __bind function to redirect.