Dear helpers,
while exporting to excel, I need to hide certain columns, if their summary value is 0 (means: in each cell of this col in this group is 0). If only 1 of the rows in this group/band contains a number > 0, the col is supposed to show.
So I am trying to read the summary value for each group header. But how?
Thanks für your help!
Liz
Hello Mike,
never mind, I've got it:
While RowExporting in the main band:
' if Sum of Col in Band = 0, then hide Col. Starting with parent-band:
If e.GridRow.Band.Index = 0 Then
If Convert.ToInt16(e.GridRow.ChildBands(0).Rows.SummaryValues("SummeSelektionsbetrag").Value) = 0 Then
e.GridRow.ChildBands(0).Rows(0).Cells("Selektionsbetrag").Column.Hidden = True
Else
e.GridRow.ChildBands(0).Rows(0).Cells("Selektionsbetrag").Column.Hidden = False
End If
Thanks for your help, you've set me on the right track!
thank you for your help!
Searching and trying, I had discovered this one, meanwhile.
But, what I actually need, is the summary value in each child band. So I can, while exporting to excel, decide to hide a columns, if its summary value = 0.
But I can't find a way to access the summary value of child bands.
Or, even more, the summary value of the childband that is recently doing HeaderRowExporting.
(Actually, I can't even find the rows collection of a child band...)
Maybe you can help once more.
Thank you very much!
Hi Liz,
The SummaryValue is on the rows collection. So for the root level, this is pretty easy:
grid.Rows.SummaryValues["My Summary"].Value