I am trying to suppress a group footer if and only if the corresponging group header is being suppressed.
In the before print event o f the group footer, the only pertinent information I have available (that I can see) is the group level. This helps, but is not enough. I want to suppress a group header only if the corresponding group header (with the same group value) was suppressed.
As an example:
I fI suppress the GroupHeader with a group value of aster, I also want the GroupFooter with a group value of aster suppressed.
I can set a flag or variable with the group level when I suppress the GroupHeader, but I only want to suppress the corresponding groupfooter with the same group value.
In my actual report I have a variable number of group levels.
How can I do this in code?
Update on this problem.
I am trying to suppress a group footer instance if the current value of the group field is zero.
I thought by binding the groupfooter tag to the groupfield and then checking the GetCurrentColumnValue in the BeforPrint event of the group footer (using the groupfooter tag to get the column name) I could do it. However, when I put a stop in the GroupFooter BeforePrint event, the value of the tag is empty, i.e., "".
Below is the code I used to bind the groupfooter tag to the group field:
Dim GroupFooterBinding As XRBinding
GroupFooterBinding = New XRBinding("Tag", inDataSource, GroupList(k).FieldName)
Here is the BeforePrint event handler to suppress the groupfooter.
Private Sub BeforePrintGroupFooter(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintEventArgs)
If CType(sender, GroupFooterBand).Report.GetCurrentColumnValue(CType(sender, GroupFooterBand).Tag.ToString) = "0" Then
e.Cancel = True
I assume it is possible to bind to a group footer tag and then examine the value at a later date.
What am I missing?
Hello Mike !
We've updated our example to support multiple group levels. In order to hide a correct "header-footer" pair, BeforePrint events check the
Level property of the current GroupHeaderBand within a document.
Please let us know if it's suitable for you.