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)
Extending BIRT - ODA and Report Item
rudolfkran
Hi community
I still try to extend BIRT with a oda and a report item. I have some question concerning this challenge:
1. If the users chooses the html-report, I provide some html-code to display my report item. The html-code uses some javascript-libaries to display an interactive item. How can I reference to the javascript files, which are in the plugin-directory, using the script tag? How do i have to write the path? For the moment I have to access the files using an URL, but that can't be the solution.
2. When i activate resizing on an report item, how can i handle the resize event? After resizing the getImage-method of the IReportItemImageProvider get called, but how can i access the width/height-parameters? I wanna repaint the resulting image based on the new dimensions.
3. Which method get called when the user clicks on the "check connection"-button in the datasource-wizard?
4. How can I hide a column in the preview of a dataset?
It is very hard to develop a good plugin for BIRT, because there is no usefull documentation an the samples are really poor and don't show the real interessting possibilities. However, would be cool to get some tipps from you!
Thanks a lot!
Find more posts tagged with
Comments
rudolfkran
ok....other question. Is there anyone out there, who has developed a running report-item extension for BIRT, which uses a datasource and different settings?
kosta
Hi rudolfkran,<br />
<br />
about the ODA plugin do some workaround, try to create pojo/bean list and give it to the IRunAndRenderTask task if you are using the BIRT API.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>HashMap hm = (HashMap) task.getAppContext();
hm.put("POJOlistClass", POJOlist_Intstance_Name_For_using_it_in_BIRT);</pre>
<br />
About the report items there are only two examples:<br />
<a class='bbc_url' href='
http://www.eclipse.org/articles/article.php?file=Article-BIRT-ExtensionTutorial1/index.html'>http://www.eclipse.org/articles/article.php?file=Article-BIRT-ExtensionTutorial1/index.html</a><br
/>
<br />
<a class='bbc_url' href='
http://www.eclipse.org/articles/article.php?file=Article-BIRT-ExtensionTutorial2/index.html'>http://www.eclipse.org/articles/article.php?file=Article-BIRT-ExtensionTutorial2/index.html</a><br
/>
<br />
But I think you already saw them.<br />
<br />
For example: using the scripted data set which is bound to the POJO and then to your table. you can pass there the data from the table data set into the extended report item.<br />
<br />
About 2. Are you using the BIRT API to re-size the image? How do you do that. Can you post sample code of it here?<br />
<br />
Thank you.
zqian
For question 1&2:
1. Basically you can embed custom script in following ways:
A. Generate inline script for each report item instance. This is the simplest way but of cause will result in redundant code for multiple report item instances.
B. Generate a shared inline script block for all report item instances. Each instance can later refer to this script block in their own script block.
C. Generate a shared script link, this minimizes the output most but requires to modify either the viewer code or the html emitter code somehow.
2. You can access the dimension properties by getWidth()/getHeight() methods of the passed-in ExtendedItemHandle instance.
kosta
Hi zqian,
I have custom report item in a table.
Can I pass the rendered height of the table row to the report item somehow?
I thought maybe in the "before render"-method the height of the table-row is known so I can pass it as parameter to the custom item, but I am not sure about that because I think the custom item is rendered before the table item.
Thank you for any suggestion.
rudolfkran
Hello everybody
Thanks a lot for your replies!
Question 2 solved: I can access the height and width in they way zqian metioned. The BIRT class DimensionUtil helps me to convert the measures with the different units into pixel. Finally, I use SWT to build a image, which I display on the editor. Search for "SWT resize image" (
http://www.eclipsezone.com/eclipse/forums/t93936.rhtml)
.
@zqian
: I'm programming a plugin in Java, so it would not be a problem to modify the emitter or some other classes. Can you explain me, what you mean with "shared script link"...how can I create that link? Any ideas?
Thanks!
Gustavo.Av
Humm i have my report item working within eclipse, but when i go to my web app and try to view the rotated text example in birt web-viewer my rotated texts are blank. What dependencies do i need to remove/add to make the rotated text example work in web viewer ??
Gustavo.Av
Can anyone help I cant make an extended report item to work in web-viewer through my web app