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)
Integrate drill through in custom application
Julien401
Hello,
I have been using interactivity on charts in my custom application integrating birt. I am very happy of the rendering by now.
I am now trying to switch to an other report (passing params) by clicking on the report.
So far so good it works in designer ...
but In my app, the result is really not as expected. It calls some wrong url that lead to a 404.
So I need a better understanding of what is actually done by birt in this case.
It seems to me it builds a custom url containing:
[SERVER_URL]/[MY_GENERATED_CHARTS_DIRECTORY]/run?__report=[MY_CHART_URL].rptdesign&[MY_PARAM]=[SOME_VALUE]&__overwrite=true
I am not really happy with this url, is there any way to modify it? Where does it come from? Is the sample web interface using a servlet called run?
Maybe I should simple use the hyperlink option -> URI, in this case, is the scripting language allowing me to build this url based on a specific info (column value on the clicked row)?
I know this subject is going into multiple directions, but the ultimate goal is really to integrate interactivity and links between charts with parameters.
Any help highly appreciated.
Find more posts tagged with
Comments
Julien401
Reading the source code, I realized this url is build in HTMLActionHandler.buildDrillAction().
Url elements are actually hardcoded in the class, I would rather have a somewhat configurable.
So a workaround would be to implement a custom HTMLActionHandler overriding buildDrillAction(). This custom method would be responsible for building a more generic url, that I can config for my specific case.
>> IMO this would be an interesting enhancement for BIRT in general.
In the API, it seems I can specify that I want to use my custom action handler in:
HTMLRenderOption.setActionHandler()
Could anyone validate this strategy or propose a better/simpler solution?
Also, I realized there are some bugs (size in pixel not well supported for charts) and interesting enhancements (defining Master Layout size in % > Basically 100% so that size can be defined at webapplication level). Could anyone point me to the class where this is defined?
I found some interesting elements in HTMLRenderOption (setOutputMasterPageMargins()...), but I need to modify deeper parts (override html rendering for layout size & chart size).
JasonW
You have the write approach here. Implement your own IHTMLActionHandler class and set it in the render option. One the chart size question, are you setting your layout to fixed or auto? Check the report properties to find it.
Jason
Julien401
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="72250" data-time="1294937171" data-date="13 January 2011 - 09:46 AM"><p>
You have the write approach here. Implement your own IHTMLActionHandler class and set it in the render option. <br /></p></blockquote>
Thanks, I will go ahead and implement this.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="72250" data-time="1294937171" data-date="13 January 2011 - 09:46 AM"><p>
One the chart size question, are you setting your layout to fixed or auto? Check the report properties to find it.<br />
<br />
Jason<br /></p></blockquote>
Well I did not find this option, but used HTMLRenderOption.setLayoutPreference(HTMLRenderOption.LAYOUT_PREFERENCE_FIXED)<br />
to test. I did see any impacting difference.<br />
<br />
While testing deeper and playing with firebug, I realized I have the following outputs:<br />
- jpg: Size was defined as 300px / 200px<br />
<img style="width: 300pt; height: 200pt;" alt="" src="charts/chart14a523412d809572c71.jpg" id="__bookmark_1" class="style_1"><br />
- svg: Size: 700px / 500px<br />
<embed style="width: 700pt; height: 500pt;" alt="" src="charts/chartcf0bfc12d809745b51.svg" type="image/svg+xml" onresize="document.getElementById('__bookmark_1').reload()" id="__bookmark_1"><br />
<br />
So I think my problem is only related to chart size having a conversion issue. I already (as you adviced) opened an issue for this: <a class='bbc_url' href='
http://bugs.eclipse.org/bugs/show_bug.cgi?id=334063'>http://bugs.eclipse.org/bugs/show_bug.cgi?id=334063</a><br
/>
<br />
Now I think that for my specific case, the best behavior would be to have size to 100% (tested successfully with firebug). Then the wrapping html component would be responsible for the size.<br />
I guess this would involve implementing a custom emitter: I started tracking this in the source code, now in HTMLReportEmitter.outputSVGImage(), but I would need more time to follow this lead.
Julien401
In order to fix this size issue, I finally implemented a custom emitter extending HTMLReportEmitter.
Overriding 1 method was enough to do the trick.
I also wanted to add a style element (overflow), so I added it in the same place. I am not sure this is the best place for adding custom css elements.
I am impressed how easy it is to extend birt behaviors.
Thanks for your help.
JasonW
Glad you got it working.
Jason