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)
Using DataSet to dynamically create MarkerLines
cpickart
Hello together,
my BIRT report has a chart where I want to dynamically add marker lines, one for each value of a column
in a DataSet. I tried the way that was indicated in several places around the web:
1. create a hidden table using the data set
2. in the onFetch event of the DS: adding each value of the column to an array as global persistent variable
3. reading the array in the beforeGeneration function of the onRender event of the chart and adding
the marker lines
This works if I view the reports as HTML, but viewing it with the report viewer does not show me the lines.
The data set is apparently not fetched before the onRender event of the chart triggers.
I use BIRT 2.5.1.
Does anyone have an ideas how to work around this? Is there another way to read from the DataSet?
Or to ensure the reading of the DataSet before the onRender event of the chart?
Thanks in advance for replies ;-)
Christoph
Find more posts tagged with
Comments
mwilliams
Can you explain the situation more? You have a second dataSet that you want to take every value from and put a marker line in your chart that is linked to another dataSet? Is this the case?
cpickart
Hi,<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="83989" data-time="1318366733" data-date="11 October 2011 - 01:58 PM"><p>
Can you explain the situation more? You have a second dataSet that you want to take every value from and put a marker line in your chart that is linked to another dataSet? Is this the case?<br /></p></blockquote>
<br />
yes, this is exactly what I'd like to do. As said, I even see them when<br />
viewing the report in HTML, but not when viewing it with the BIRT report<br />
viewer. There must be a different order of rendering and DataSet execution<br />
in the report viewer. The size of the ArrayList is zero when I read it in the<br />
onGeneration event of the chart, so apparently the onFetch of the DataSet is<br />
executed too late. A means to trigger the reading of the dataset explicitly<br />
would solve the problem, I guess.<br />
<br />
Christoph
mwilliams
Can you create a sample using the sample database so I can see exactly what you're doing and can test on it? Thanks!
cpickart
Hello Michael,
my apologies for not having answered right away. Attached you'll find an example with the sample database.
I hope the report suffices, I am not that familiar with BIRT from outside our application.
I entered the following scripts
- In the "initialize" script of the report I put an empy array into report context
- In the "onFetch" script of the data set I add the apropriate row to the array
- In the "onRender" script of the chart I add a MarkerLine for each entry in the array
and one with the lenght of the array.
Now in the "Preview" tab I can see the three expected MarkerLines, and also when I view the report
as HTML or DOC. But not in the Web Viewer. There I only have the one MarkerLine with the 0 length.
I hope this helps to clarify.
With kind regards,
Christoph
cpickart
One thing I forgot to mention: I created the report now with BIRT 2.6.2
mwilliams
Hmmm. I see exactly what you're talking about. I have not seen this as an issue before, but sure enough, it is. I also tried this in 3.7.1, the newest release and got the same issue. I've tried a few things to get around it with no success, so far. Please log a bug for this at www.birt-exchange.org/org/resources/bug-reporting/ and post the bug info in here for future reference. Thanks!