This is a migrated thread and some comments may be shown as answers.

Dynamic Visibility of Group Footer Section

2 Answers 161 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 14 Apr 2014, 11:16 PM
I am running across a situation where I have the need to display a SubReport or not depending on if the data source contains any items.  That part is no problem, I can set the visibility of the SubReport to false if the data source contains no items.  However, the SubReport is in a Group Footer section, and even if I set the SubReport visibility to false, the group footer still allows the room for it, so I end up with an extra page with page header/footer.

I then try to set the visibility of the Group Footer section based on the same logic as the SubReport visibility, and that seems to work, except that it applies the same visibility to ALL group footers.  So say I have 5 groups, and only 1 of them needs to display the SubReport, it will set the visibility of the Group Footer to true for ALL 5 groups, rather than just the individual group that should display the SubReport.

The only solution I have found so far, is to programmatically set the Height property of the Group Footer section to 0, which works for the most part, as the section will grow to make room for the SubReport that needs to be displayed.  However, the SubReport is a dynamic height, and I need to force it to 7.65in.  I tried programmatically settings the Group Footer height to 7.65in when the SubReport needs to be displayed, but I get the same issue, where it sets the height to 7.65 for ALL groups instead of just the one.

How would I go about forcing the Height of the SubReport, in order for the Group Footer to size itself accordingly?  I do not see a Height property of the SubReport.  I think that the answer is just to set the height of the SubReport, that way it will be per group, rather than for the whole report, but I am just not finding the Height property.  Thanks.

Brian Williams

2 Answers, 1 is accepted

Sort by
1
Brian
Top achievements
Rank 1
answered on 14 Apr 2014, 11:42 PM
I found some tips elsewhere on the forums, and tried to set the Height property of the ReportHeader section of the SubReport to the size I need.  Again, it sets the Height for ALL subreports, rather than just the one that needs to display, even though I also programmatically set the Height to 0 for the subreports that do not need to be displayed.

Is there a property or something else that I am missing that would be possible to set for an individual group?  I only have one subreport, and the visibility needs to be dynamic for each group independent of each other.

Brian
1
Brian
Top achievements
Rank 1
answered on 14 Apr 2014, 11:52 PM
Ah, it appears that I was still setting the Height of the Group Footer section, that is what was causing it to apply to all the groups.  Once I took that out, and just set the Height of the ReportHeader within the SubReport itself, it worked like a charm!
Tags
General Discussions
Asked by
Brian
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Share this question
or