Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Please help dynamic column binding to chart according to parameter, csv data source
yuvyon
Hi <br />
i a failing in binding different column names to the xseries in chart.<br />
<br />
In my report i have a parameter which is a column name,<br />
i get different csv files with different column name according to it,so for example: <br />
1)<br />
param["source"].value = 'search.field.what'<br />
<br />
in csv file i have <br />
search.fields.what,amount,percentage<br />
0, 1, 0.005<br />
1, 6795, 32.486<br />
2, 7792, 37.252<br />
<br />
2)<br />
param["source"].value = 'search.field.city'<br />
<br />
in csv file i have <br />
search.field.city,amount,percentage<br />
0, 1, 0.005<br />
1, 6795, 32.486<br />
2, 7792, 37.252<br />
<br />
<br />
my chart (pie in this case) should show the <br />
yseries = percentage<br />
xseries = search.field.city<br />
but when trying bind column name to chart i fail (tried putting in the x series category the expression row[params["source"].value])<br />
<br />
can i do it via script(not java)? if yes how?<br />
<br />
please help !!! <br />
<br />
i attached a simple report with 2 files example <br />
<br />
P.S.<br />
I have more reports with similar behaviour where chart is a bar not a pie would that make a differnt?<br />
I am using Birt 2.5<br />
<br />
Thanks in advance<br />
Yuval<br />
<a href='mailto:' title='E-mail Link' class='bbc_email'>yuvyon@yahoo.com</a>
Find more posts tagged with
Comments
mwilliams
Hi Yuval,
With the way you're trying to do this, I think you'll end up with many binding issues because of the field names changing. What may work best if it's possible, is to create two dataSets and two charts and drop one of the charts at runtime depending on the parameter value.
yuvyon
Hi Michael<br />
Thank you very much for responding.<br />
<br />
This report is only an example to demonstrate the problem.<br />
I will actually be getting a new csv file on the fly (a web service in the background is called with params where one of them is the column name) .<br />
The new generated csv file with the column name inside and all the others columns in file are the same is to be presented by the chart.<br />
Is there a way of doing it in script getting the xseries and just giving it the column name derived from the parameter?<br />
In beforeFactory() or beforeGeneration().<br />
I tried looking for an example but only saw dealing with the y series and never with the xseries and the column binding.<br />
<br />
Thanks again.<br />
Yuval<br />
<a href='mailto:' title='E-mail Link' class='bbc_email'>yuvyon@yahoo.com</a>
mwilliams
Yuval,<br />
<br />
You could probably build the table dynamically depending on the parameter:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/262-birt-dynamic-adding-tables-and-columns/#'>BIRT
: Dynamic Adding Tables and Columns - Designs & Code - BIRT Exchange</a>