Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT Customisation in JSP
qriousBirt
Hi,<br />
<br />
Recently, I came across Birt Release 2.6 (as well as Birt Release 2.2)<br />
And I would like to ask something about it.<br />
<br />
1) Will it provide to change <span class='bbc_underline'>Color, Title Text, Font</span> (Color, Size) of <strong class='bbc'>Charts on JSP</strong> ?<br />
2) If Yes, How can be integrated with out Application made in <em class='bbc'>Struts</em> 1.3?<br />
3) Does it provide export Functionality of Excel, Pdf without the default <strong class='bbc'>export bar by BIRT</strong>?<br />
<br />
Thanks,<br />
<br />
Aditya Kanitkar
Find more posts tagged with
Comments
JasonW
I assume you do not want to use the viewer out of the box? You can customize Charts in a report very easily with BIRT based on report parameters, session vars etc. BIRT has a set of taglibraries that may be what you want to look at.
See
http://www.eclipse.org/birt/phoenix/deploy/viewerUsageMain.php#tags
and
http://birtworld.blogspot.com/2007/09/22-birt-tag-library-building-custom.html
Jason
qriousBirt
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="76767" data-time="1304957781" data-date="09 May 2011 - 09:16 AM"><p>
I assume you do not want to use the viewer out of the box? You can customize Charts in a report very easily with BIRT based on report parameters, session vars etc. BIRT has a set of taglibraries that may be what you want to look at.<br />
<br />
See <br />
<a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/deploy/viewerUsageMain.php#tags'>http://www.eclipse.org/birt/phoenix/deploy/viewerUsageMain.php#tags</a><br
/>
and<br />
<a class='bbc_url' href='
http://birtworld.blogspot.com/2007/09/22-birt-tag-library-building-custom.html'>http://birtworld.blogspot.com/2007/09/22-birt-tag-library-building-custom.html</a><br
/>
<br />
Jason<br /></p></blockquote>
<br />
Thanks for your reply Jason,<br />
Will update you soon about it.<br />
<br />
Aditya
qriousBirt
Hi Jason,
I tried from those links you suggested.
I'm able run that example in JSP & pass parameters through paramDef tag only.
But now, If i want to Change background color of a Text which is in rptdesign file,
I'm using following script on "beforeRender" funtion of Report
var mytxt = reportContext.getDesignHandle().findElement("myText");
mytxt.getStyle().backgroundColor = "#fffff";
I'm getting this error -
ReportDesign (id = 1):
+ There are errors evaluating script "
var mytxt = reportContext.getDesignHandle().findElement("myText");
mytxt.getStyle().backgroundColor = "#fffff";
":
TypeError: Cannot set property "backgroundColor" of null to "#fffff" (/report/method[
@name="
;beforeRender"]#5)
Please help.
One more question, Are there any limitations of Javascript customization(Modifying properties of charts, text, dynamic text) in opensource version of Birt?
Any reference e-book for Birt Open Source specially for Java Developers...??
Thanks,
Aditya
JasonW
Put the code on the text element's onRender or onCreate event. Like:
this.getStyle().backgroundColor="#ffffff";
or
this.getStyle().backgroundColor="Green";
There are several BIRT books out. Here are the two that Actuate worked on:
http://www.eclipse.org/birt/phoenix/birthelp.php#books
This page needs to be udated because the third edition I believe is out now. I believe they are available as eBooks.
Jason
JasonW
BTW The second book in that series has four chapters on scripting. Most properties are changeable because this is server side scripting that allows you to call the BIRT design engine api. Most changes need to be done in the beforeFactory event because this is last method before report execution. Check out my blog at birtworld.blogspot.com. I have a lot of chart scripting examples.
Jason
qriousBirt
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="77012" data-time="1305298573" data-date="13 May 2011 - 07:56 AM"><p>
BTW The second book in that series has four chapters on scripting. Most properties are changeable because this is server side scripting that allows you to call the BIRT design engine api. Most changes need to be done in the beforeFactory event because this is last method before report execution. Check out my blog at birtworld.blogspot.com. I have a lot of chart scripting examples.<br />
<br />
Jason<br /></p></blockquote>
Hi Jason,<br />
<br />
I've integrated BIRT report into JSP and stuff.<br />
But, I need to know more about The Compilation of RPTDESIGN file.<br />
i.e. If i can skip the compilation process of RPTDESIGN file.<br />
So that, Whatever parameters i have sent to rptdesign file, That should be reflected into rptdesign file.<br />
Is it possible in BIRT.? <br />
<br />
I'm referring to some Cache or Proxy based UI, So that, there will no Compilation process in between.<br />
<br />
Thanks,<br />
Aditya
JasonW
I am confused on the question. Do you mean you want to construct the report on the fly? If so you need to use the Design Engine API, or call the DE API from script.
http://www.eclipse.org/birt/phoenix/deploy/designEngineAPI.php
Jason
qriousBirt
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="78919" data-time="1308767307" data-date="22 June 2011 - 11:28 AM"><p>
I am confused on the question. Do you mean you want to construct the report on the fly? If so you need to use the Design Engine API, or call the DE API from script.<br />
<a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/deploy/designEngineAPI.php'>http://www.eclipse.org/birt/phoenix/deploy/designEngineAPI.php</a><br
/>
<br />
Jason<br /></p></blockquote>
<br />
<br />
Currently, <br />
<br />
I've created two frames in one JSP.<br />
<br />
First JSP page(frame1) has <birt:parameterPage> tag, displaying all parameters.<br />
In this page, the parameter page tag has an attribute "target" set as "frame2"<br />
<br />
When i click show preview in first jsp, it shows report in Second JSP (Frame 2), <br />
Before that it shows "Processing Please wait", Is there any way I can change or hide this message...?<br />
<br />
Thanks,<br />
Aditya
JasonW
That is an AJAX popup showing that the report is running. If you want to hide it open the BirtCommunicationManager.js file located in teh webcontent/birt/ajax/core directory and comment out
birtProgressBar.__start( );
and
birtProgressBar.__stop( );
Jason
qriousBirt
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="79039" data-time="1308927620" data-date="24 June 2011 - 08:00 AM"><p>
That is an AJAX popup showing that the report is running. If you want to hide it open the BirtCommunicationManager.js file located in teh webcontent/birt/ajax/core directory and comment out<br />
<br />
birtProgressBar.__start( );<br />
and<br />
birtProgressBar.__stop( );<br />
<br />
Jason<br /></p></blockquote>
<br />
Thanks Jason,<br />
Its done. But, I've one more question - <br />
<br />
Presently, I've one rptdesign file in which i've 4 charts & some talbes.<br />
<br />
I want to provide some customization to charts. So i created few parameters which works fine.<br />
For this on UI level, I've created 2 frames. One with parameterPage tag & other with target(Output).<br />
<br />
Now, In the output frame. I want to show only that chart which the user wants to change & not the whole report. Only one chart. Finally, when user has made his customization, He will be exporting that to PDF.<br />
<br />
Is there any way, If i can do this with Bookmark attribute in birt:parameterPage tag...?<br />
<br />
Aditya
JasonW
Aditya
Yes you can put a bookmark propery on the report chart, say like "mychart" and use jsp like:
<%@ 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"
bookmark="mychart"
isReportlet="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>
The isReportlet attribute will make the engine only show the chart. You may also want to change the pattern to run instead of frameset.
Jason
qriousBirt
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="79124" data-time="1309195561" data-date="27 June 2011 - 10:26 AM"><p>
Aditya<br />
<br />
Yes you can put a bookmark propery on the report chart, say like "mychart" and use jsp like:<br />
<br />
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"<br />
pageEncoding="ISO-8859-1"%><br />
<%@ taglib uri="/birt.tld" prefix="birt" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<a class='bbc_url' href='
http://www.w3.org/TR/html4/loose.dtd">'>http://www.w3.org/TR/html4/loose.dtd"></a><br
/>
<html><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><br />
</head><br />
<body><br />
<br />
<birt:parameterPage id="birtParmPage" reportDesign="TopNPercent.rptdesign"<br />
name="my form"<br />
pattern="frameset"<br />
height="600"<br />
width="800"<br />
format="html"<br />
title="My Viewer Tag"<br />
isCustom="true"<br />
showTitle="true"<br />
showToolBar="true"<br />
showNavigationBar="true"<br />
bookmark="mychart"<br />
isReportlet="true"<br />
><br />
TOP COUNT PARAMETER<br />
<input type="Text" name="Top Count"><br />
<br><br><br />
TOP PERCENT PARAMETER<br />
<input type="Text" name="Top Percentage"><br />
<br><br><br />
<input type="Submit" value="Run Report"><br />
</birt:parameterPage><br />
</body><br />
</html><br />
<br />
The isReportlet attribute will make the engine only show the chart. You may also want to change the pattern to run instead of frameset.<br />
<br />
Jason<br /></p></blockquote>
<br />
Thanks Jason,<br />
Now it is showing only particular bookmark instead of whole report.<br />
But, There is some issue with parameters send to rptdesign with specific bookmark.<br />
i.e. When, for the first time,I select some parameter in drop down list in JSP, Then click show preview, <br />
Output is shown as expected. <br />
<br />
And when I again goto my param page jsp and Select another value from drop down,<br />
Output is same as before, There was no change.<br />
<br />
Then, again , I went to param page jsp, Refresh that page 3-4 times, Select another value from drop down.<br />
After that only, Output is shown as expected.<br />
<br />
What am i missing here...?<br />
<br />
And please look into this also...<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/22704-scripting-at-runtime/'>http://www.birt-exchange.org/org/forum/index.php/topic/22704-scripting-at-runtime/</a><br
/>
<br />
Aditya
JasonW
If you want the whole report remove:
isReportlet="true"
Can you add:
forceOverwriteDocument="true"
to see if it fixes the update.
Jason