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

How to hide SubReport with data

3 Answers 192 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
HMPSOLBB
Top achievements
Rank 1
HMPSOLBB asked on 16 Feb 2016, 12:03 PM

I have a master report with two subreports. The dimensions of each areabout a A4 page. I use two parameters to hide the subreports. So normaly the report should be two pages if both parameters are activated and one page if only one parameter is activated.

But I always got two pages, page one empty if only subreport two is activated and page two empty if only parameter one is activated.

I am using the following bindung für the two subreports

Subreport 1: 

  • Expression: = Parameters.param1.Value
  • Path: Visible

Subreport 2:

  • Expression: = Parameters.param1.Value
  • Path: Visible

What can I do that the subreports will not use any space when visible=false? If I have a look at the 'HTML Redering' the space is empyt, but if I have a look at the print preview or do an export the space ist used.

The problem is that i have to create a Master/SubReport using 50 subreports where the user can select the desired subreports.

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 16 Feb 2016, 06:14 PM
Hello Oliver,

If an item is hidden the rest will move into its place - Design Considerations for Report Item Layout. The article suggest layout organization via Panel items as well.

To shrink the container after hiding items, you can use the approach from the Collapse the container when hiding child report items KB article.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
HMPSOLBB
Top achievements
Rank 1
answered on 18 Feb 2016, 03:10 PM

The hidden Tables and subreports are not the problem. I placed a lot of tables on the master Report and some subreports. If I have a look at the source code of the Reports I found the following line:

<p><DetailSection Height="52.5000062072275cm" Name="detailSection1"></p>

Now i view the print layout and can see 3 pages. length of A4 paper 29,9mm x 3 = 89,7cm, now i Change the size to

<p><DetailSection Height="80cm" Name="detailSection1"></p>

And i can see 4 pages.

 

This means for me the print preview and the convertion to other documents Formats will not use the real size of the HMTL prerender, i took the layout orientated size of the detailsection. But the Detail sectionmust be as large as the Content of it. By the behavior it is impossible to create Reports with dynamic Content because you cannot size each element by a height of 0.

 

 

 

0
Stef
Telerik team
answered on 19 Feb 2016, 01:11 PM
Hello Oliver,

The physical document will be paged based on the report's PageSettings properties like PapeKind and PaperSize - Understanding Pagination.

An approach to check which sections cause the additional blank pages is to color them and add borders. Thus you can trace on how many pages a section/item spreads.

If a Detail section's Width and Height exceed the space defined by the report's PageSettings properties, the section will be split between pages. The section's Height can be set to 1px via binding to assure it will be collapse to gather exactly the visible items in it.


Please feel free to open a support ticket and send us a demo project that includes the reports and test data. Thus we can check the reports' settings and test the result in Print preview (Interactive vs. Print Layout).

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
HMPSOLBB
Top achievements
Rank 1
Answers by
Stef
Telerik team
HMPSOLBB
Top achievements
Rank 1
Share this question
or