Home
Intelligence (Analytics)
Crosstab with stacked bar chart
nairwen
<p>Hi,</p>
<p> </p>
<p>I'm trying to make a report that would look like the attached example. I think it kinda looks like a cross tab report but the problem is that I can't find a way to use stacked bar chart in a crosstab. Is there any way to do it?</p>
<p> </p>
<p>Can you suggest any other type of report that would look like my example? Maybe by using grid?</p>
<p> </p>
<p>Regards,</p>
<p>Nair</p>
Find more posts tagged with
Comments
mwilliams
A grouped table with an embedded chart that uses data set parameters in its data set to limit the data to only that of the table grouping.<br><br>Attached is an example of a Table grouped by country and city. The country group is the only displayed in the table. In the general tab of the property editor for the cell containing the country element, the "drop" property is set to "detail". In the city group header row, I insert a chart that uses my second data set that has data set parameters set up to limit the data by country and city. I use city for x-axis, value for y-axis and I create stacked bars by using the optional grouping (you could manually create series if you wanted). Finally, in the binding tab of the property editor for the chart, select the "Data Set Parameter Binding..." button and you'll see that I pass the two group values from the table to the chart's data set through the data set parameters.
nairwen
<p>Thanks for the quick reply. Sample report looks great!</p>
mwilliams
Not a problem. Let me know if you have any more questions.
nairwen
<p>I have one more question.
<br><br>
My report has two cells in a row. First cell is using data from the first dataset and second cell (which shows the chart) is using the second dataset. The second dataset sometimes returns null, while the first one doesn't which means that the second cell in a row is empty and the first one is not (as shown on the attached picture). Is there any way to hide the entire row when the second cell is empty? I tried with visibility function but it only allows me to use data from the first dataset which is never empty so it doesn't help me much.<br><br>
Regards,</p>
<p>Nair</p>
mwilliams
<p>There are probably several different options to work around this. One would be to add a hidden dynamic text tied to your chart's data set above your chart and use the onCreate to figure out the number of rows (you might need to add an aggregation to the bindings of the text box). You could store that value in an array. Then, in your outer table's detail row's onRender, use that array to hide your rows with:</p>
<p> </p>
<p>this.getStyle().display = "none";</p>
<p> </p>
<p>You could also do something similar with another data set that runs a grouped query with a count for the inner data set's value as a field. You'd then place a hidden text control bound to this new data set above your table, store the values with the count of the inner query's rows equaling 0 and use this array to hide the rows of your main table either in the visibility property or like I described above.</p>
<p> </p>
<p>If I get a chance, I'll try to create an example showing one/both of these and maybe something else. I'm in Montreal on a slow internet connection and don't have Eclipse/BIRT on my new machine, yet. So, I won't be able to get to it, til next week, probably. Let me know if you get it before then.
</p>
nairwen
<p>I think I solved it.
I changed my SQL query so it does not contain values which would return null in second dataset. Still have to test it a bit but it looks ok so far.</p>
mwilliams
<p>Great to hear! I'm assuming that since you have't posted back that all is well?
</p>
nairwen
<p>Yes, report works as it should. Thanks for asking and thanks for help!
</p>