How to hide SubReport with data

4 posts, 0 answers
  1. HMPSOLBB
    HMPSOLBB avatar
    15 posts
    Member since:
    Mar 2012

    Posted 16 Feb Link to this post

    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.

  2. Stef
    Admin
    Stef avatar
    3044 posts

    Posted 16 Feb Link to this post

    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
  3. DevCraft banner
  4. HMPSOLBB
    HMPSOLBB avatar
    15 posts
    Member since:
    Mar 2012

    Posted 18 Feb Link to this post

    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.

     

     

     

  5. Stef
    Admin
    Stef avatar
    3044 posts

    Posted 19 Feb Link to this post

    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
Back to Top