Keeping ReportItems together on one page

9 posts, 0 answers
  1. Rehan
    Rehan avatar
    6 posts
    Member since:
    Jun 2014

    Posted 04 Mar 2015 Link to this post

    I have a report with the following ReportItem's in it:

    PageHeaderSection
    DetailSection
        Panel
            TextBox - The title of the section
            Table - The section data
        Panel
            TextBox - The title of the section
            Table - The section data
        Panel
            TextBox - The title of the section
            Table - The section data
        Panel
            TextBox - The title of the section
            Table - The section data
    PageFooterSection

    I want each TextBox and Table to show together on one page. If the table data spans exactly one page, the TextBox shows on one page and the Table shows on another. How can I keep both of them together?
  2. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 09 Mar 2015 Link to this post

    Hello Rehan,

    Set Panel.KeepTogether = True and Table.KeepTogether = False. The KeepTogether property determines whether the report item or section will be kept together on a single page or will span across multiple pages. More information on this behavior can be found in the Understanding Pagination help article.

    Regards,
    Nasko
    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.

     
  3. Mike
    Mike avatar
    13 posts
    Member since:
    May 2017

    Posted 29 Jan in reply to Nasko Link to this post

    I have the same issue, but with a bit of a twist.  I have a panel with a TextBox which contains the header for the section followed by 4 tables all inside a single panel.  While I don't need them all to display on the same page (Panel.KeepTogether = True), I don't want the TextBox with the header to display at the bottom of a page without at least one of the tables.  I had considered adding the section header as a header to the first table, but any one of these tables may not display if there is no data, so if the first table had no data, it could still be left alone at the bottom of a page.

    Panel

    TextBox - The title of the section
    Table
    Table
    Table
    Table

     

  4. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 30 Jan Link to this post

    Hello Mike,

    The text box contains the header for a section. It might work if you set a page break before this section so that it always starts on a new page. Then the text box will always be on the top of the page followed by the tables.

    Regards,
    Nasko
    Progress 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
  5. Mike
    Mike avatar
    13 posts
    Member since:
    May 2017

    Posted 30 Jan in reply to Nasko Link to this post

    This report is intended to read like a continuous document, so a page break before the section heading is not ideal.  I had suggested this and it was not met with an enthusiastic response.  Any other suggestions?

    Mike

  6. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 04 Feb Link to this post

    Hi Mike,

    There is a more complex approach which utilizes Bindings to move the table items in case the first table or any other subsequent table is not visible (has no data). Each table is nested inside a separate Panel item together with the section title text box. The hierarchy of the attached sample report (demonstrates two tables) looks like this:

    Panel
    Panel
    Title Text Box
    Table 1
    Table 2


    Each panel item has its height set to a very small number via bindings, so that it does not take up unnecessary space in the report.

    To open the attached report you will need the latest version of the Telerik standalone report designer.

    Regards,
    Nasko
    Progress 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
  7. Mike
    Mike avatar
    13 posts
    Member since:
    May 2017

    Posted 06 Feb in reply to Nasko Link to this post

    Nasko,

    I have altered your sample a bit by adding a third row to the second table and setting that tables KeepTogether property to false.  I would want the header textbox to appear on the same page as a portion of the second table when hiding the first table, but that is not the case.  In this scenario, the header appears on page one with the table spread over pages two and three. 

    I have the altered report zipped up, but I cannot attach it to my response.  Is there another way I can get it to you?

    Mike

  8. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 07 Feb Link to this post

    Hello Mike,

    To attach files you need to open a support ticket. I noticed you already have an open support thread on the topic, so you can attach files there.

    Regards,
    Nasko
    Progress 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
  9. Mike
    Mike avatar
    13 posts
    Member since:
    May 2017

    Posted 07 Feb in reply to Nasko Link to this post

    Nasko,

    I attached the reworked report sample to that support ticket yesterday if you would like to have a look at it.

    Mike

Back to Top