Is there a way to have the section give up it's allotted space if you are hiding a panel?
Thanks,
Philip Carter.
Attached is a screenshot of the design and result
13 Answers, 1 is accepted
Please test to use a binding to the Panel.Visible property or a conditional formatting rule to hide it. Then apply the approach described in the Collapse the container when hiding child report items KB article on the section that needs to be collapsed.
Let us know if you need any further help.
Regards,
Stef
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.


So here's the jist. If you use the Report Header to build pages that you want before your details section, you will add a group with no grouping expression and that will give you your Group Header where you will put what you want to be your page header and then set the PrintOnEverPage Property to True. then hide the Page Header so no space is taken up on the details pages.
Also, anyone coming from Crystal Reports, should also look at the Bindings property of sections and items. Because there, you can set page breaks and the other things that you are not able to set in the standard conditional formatting. It's a very cool way of doing things.
Thanks Telerik!!!
In case anyone is interested, Here's a link to the report and subreport. It may help you figure out what you can do above and beyond what you can do with Crystal. http://marketplacesoftware.biz/LiveUpdate/ForwardTilt-Proposal.zip
Thank you for your kind words and we are happy to hear you found a solution.
Just in case later you need to use the global objects available in the page sections, you can try a document layout built by several report definitions, which are gathered in a Reportbook. In a report book, each new report starts on a new page, you can add content with different structure, and the whole book is treated as a single document on processing.
I hope the above information helps you.
Regards,
Stef
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.




I am posting how we solved the hiding empty sections and subsequent white space problem in case someone winds up in a similar case. We followed the advice of several posts about setting the initial height of the details section to 0. This works in most cases. In the sub report we had issues with white space where we had about 6 panels stacked on top of each other vertically. We set their initial heights to 0 and hid them accordingly but the white space still appeared at the bottom of the sub report causing intermittent white space between sub reports as well as generating extra pages as a result.
In the detail section item data bound event we used ElementTreeHelper to get all of the direct Panel children of the sub report details section and set their heights to 0. Then we started an accumulator at 0 and for each visible panel set the top property equal to the accumulator value and then added the visible panel's height to the accumulator. This effectively re-positions all the visible panels to be adjacent to each other vertically. But the key for eliminating the white space was to set the Top to 0 for each INVISIBLE panel. I am assuming that this moves the invisible panel under the visible panel at render time in such a way that the white space where the panel was hidden from is not rendered. You may suppose that setting the docking to top for the panels in question would make them snap up and shrink the element but I did not have success with that approach.
As an side, I found it helpful to set colored borders around each panel or sub report to derive how the rendering responds to attempts to control the white space. I tried various techniques to accomplish this such as bindings, conditional formatting, expressions using =COUNT(Fields.NameOfField) > 0, and the like but nothing else seemed to work or had various quirks. One issue I had with using an expression on a sub report and setting Parent.Parent.Visible or something similar is it locks the sub report into a specific hierarchy for the functionality to work. With this solution wherever the sub report is included it will shrink it's panels to the min height.
So overall our report uses the following approach to hide empty sub reports and possibly panels within those sub reports and shrink all the white space those elements occupied.
1. In master report constructor set master report detail data bound event to set detail height to 0; set sub report item data bound event for each sub report
2. In sub report data bound event get detail section and hide if no data.
3. In any sub reports that need to further hide panels attach item data bound event to the sub report detail and in that event hide panels with no data.
3. For each visible panel, set top to 0 for first panel or prior panel's top + prior panel's height for subsequent panels. For each invisible panel set Top to 0
4. Rejoice
The hide element if no data algorithm:
1. Set element height to 0.
2. Get all child data containing elements (Table, TextBox, HtmlTextBox, whatever yours may be) and check each element to have a value.
3. If any value, set element visible = true else set element visible = false.
We accomplished Step 2 by creating a recursive iterator that uses ElementTreeHelper internally so that I can get all children under a panel, detail, or an element and then use LINQ to filter it to a specific type. To distinguish between Textboxes used for display that will always have values and thus make the element visible we used a convention based approach where the text box name begins with "EData_". With this approach we can get just the boxes that are data bound. So effectively we have Parent.Visible = Parent.Children.Any(x => x.IsDataBound() && x.HasValue());
I had seen various cautions AGAINST modifying elements in this way during the Telerik.Reporting.Processing phase but at this time have not seen any negative side effects and it seems sometimes this method is endorsed and sometimes it is not.
One more approach utilizing the Reporting expression engine that we can suggest is discussed in the How to hide subreports that has no data forum thread and the Collapse the container when hiding child report items KB article.
I hope this information is helpful.
Regards,
Stef
Telerik
.jpg)
[quote]Philip said:I figured out what to do and I'm going to post it in simple English because coming from a CrystalReports crappy way of doing things, the way Telerik does reporting is way cooler, but completely foreign to anyone used to Crystal Reports.
So here's the jist. If you use the Report Header to build pages that you want before your details section, you will add a group with no grouping expression and that will give you your Group Header where you will put what you want to be your page header and then set the PrintOnEverPage Property to True. then hide the Page Header so no space is taken up on the details pages.
Also, anyone coming from Crystal Reports, should also look at the Bindings property of sections and items. Because there, you can set page breaks and the other things that you are not able to set in the standard conditional formatting. It's a very cool way of doing things.
Thanks Telerik!!!
In case anyone is interested, Here's a link to the report and subreport. It may help you figure out what you can do above and beyond what you can do with Crystal. http://marketplacesoftware.biz/LiveUpdate/ForwardTilt-Proposal.zip
[/quote]
While this is a good workaround, for a standard report (1 column, default setting for page), reports that are set up as multi columns, this won't work. The Report Header Band and all Group Bands will be the same size as each column. Also, this doesn't fix the issue that the Page Header is a constant height and doesn't GROW or SHRIK as necessary when you have controls in it that you hide under certain conditions (something other report writers allow, even our existing legacy software package written in Visual FoxPro supported this). I am confused why Telerik is treating the Report Header Band similar to a group band, in fact, the way it behaves to me, is it is a group band that doesn't require an expression.

While this is a good workaround, for a standard report (1 column, default setting for page), reports that are set up as multi columns, this won't work. The Report Header Band and all Group Bands will be the same size as each column. Also, this doesn't fix the issue that the Page Header is a constant height and doesn't GROW or SHRINK as necessary when you have controls in it that you hide under certain conditions (something other report writers allow, even our existing legacy software package written in Visual FoxPro supported this). I am confused why Telerik is treating the Report Header Band similar to a group band, in fact, the way it behaves to me, is it is a group band that doesn't require an expression.
[/quote]
This...x 100. The Group Header Section is great for creating manual page breaks, but if you want anything in there that dynamically sizes you are out of luck.
.jpg)
While this is a good workaround, for a standard report (1 column, default setting for page), reports that are set up as multi columns, this won't work. The Report Header Band and all Group Bands will be the same size as each column. Also, this doesn't fix the issue that the Page Header is a constant height and doesn't GROW or SHRINK as necessary when you have controls in it that you hide under certain conditions (something other report writers allow, even our existing legacy software package written in Visual FoxPro supported this). I am confused why Telerik is treating the Report Header Band similar to a group band, in fact, the way it behaves to me, is it is a group band that doesn't require an expression.
[/quote]
This...x 100. The Group Header Section is great for creating manual page breaks, but if you want anything in there that dynamically sizes you are out of luck.
[/quote]
Support this feedback request: https://feedback.telerik.com/Project/162/Feedback/Details/256698-page-header-band-that-grows-shrink-based-on-controls-in-it
.jpg)
While this is a good workaround, for a standard report (1 column, default setting for page), reports that are set up as multi columns, this won't work. The Report Header Band and all Group Bands will be the same size as each column. Also, this doesn't fix the issue that the Page Header is a constant height and doesn't GROW or SHRINK as necessary when you have controls in it that you hide under certain conditions (something other report writers allow, even our existing legacy software package written in Visual FoxPro supported this). I am confused why Telerik is treating the Report Header Band similar to a group band, in fact, the way it behaves to me, is it is a group band that doesn't require an expression.
[/quote]
This...x 100. The Group Header Section is great for creating manual page breaks, but if you want anything in there that dynamically sizes you are out of luck.
[/quote]
Support this feedback request: https://feedback.telerik.com/Project/162/Feedback/Details/256698-page-header-band-that-grows-shrink-based-on-controls-in-it