Home
Analytics
Add new column in birt report based on generated grand total column in crosstab.
ajay2906
I want to add a column to show percentage values after Grand Total in a BIRT crosstab. The percenatge are based on the grand total values. Is it possible, any pointers how to do it?
Find more posts tagged with
Comments
mwilliams
You want it to display the percentage of column total of the row? What's your BIRT version?
ajay2906
Yes, I want to show percentage of Grand total based on both row and column. My Birt version is 3.7.0
please look at the attached sample with dummy data.
mwilliams
Take a look at this report design. I use grids and data elements and borders to make the extra row and column. Let me know if you have questions.
ajay2906
Hi Michael
Kudos to BIRT Guru
Thanks a lot for this working example, I was struggling because of this for past few days.
One more help I need, how have you made all the columns in above example of equal width. If I drag and try
to re-adjust column widths, some of columns get disappeared when I preview the crosstab. Do you have idea
what is going wrong, please let me know.
Thanks
Ajay
mwilliams
You're very welcome! Always glad to help.
If you click into the cell of any column of crosstab cells and set the width, in the property editor, that width will be set for all cells in the column. In this example, I set the width of the top left (empty) cell, the column dimension cell, and the grand total column label cell. Hope this helps.
ajay2906
Hi Michael
Thanks for your help again, the column width thing worked after I set the width of the cells in property editor. I have facing one more issue. I am not using default style of crosstab where we have border around each and every cell, what I want is only column border as shown below. But when I set left border for the column in the crosstab it is broken at boundary of crosstab cells while rendering(this happens only for the last column where I have a grid of two columns in crossatb cell). Please help me to work around this problem as it looks very ugly.
Thanks
Ajay
mwilliams
One thing you could do is to put something like this in the onCreate script of the grid row.
if (data["device"].length > 10){
this.height = "27pt";
}
Something like this would handle two lines. If you could possibly have a 3 line row, you'd have to add more to this check.