Each item has Visible property which can be controlled via binding expression. The easiest way to go would be to create the report layout with all possible items and nest each item in a Panel (this is to maintain the original layout when you hide one item). Then you can let the user control which ones to see by report parameters e.g. the binding for the Visible property can depend on a Boolean report parameter, which the user can operate with.
As you describe is how I am performing the task at the moment, though with one slight difference; all the controls that I hide are not necessarily nested in a panel. For instance I may make a chart itself 'Visible.False'.
The problem is that after hiding various elements, the subreport does not shrink to fit the remaining elements - there may be a lot of space below the subreport before the next subreport begins.
Do you have a solution for this? If I instead hid panels, would that fix the problem?
Thanks
0
IvanY
Telerik team
answered on 03 Sep 2012, 03:14 PM
Hello Julian,
Placing them in a Panel will not fix that issue. However you can still achieve that effect, but requires a little bit of work. You will have to place this snippet in each subreport you have:
public MySub1()
{
InitializeComponent();
this.detail.Height = Unit.Pixel(1);
}
This will ensure that the detail section will grow only in runtime, if there is something to show. Add the same line in the constructor of your master report if needed.
Greetings,
IvanY
the Telerik team
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >