How to use different top margin on each page of telerik report

4 posts, 0 answers
  1. Ankush
    Ankush avatar
    4 posts
    Member since:
    Apr 2018

    Posted 18 Jun Link to this post

    I want to give top margin on each page except first page. How can I achieve this?

    My current approach is that I gave top margin to PageHeader section and trying to hide PageHeader section on specific pages. But I failed because it hides PageHeader on all pages.

    Please suggest.

    Thanks

  2. Todor
    Admin
    Todor avatar
    321 posts

    Posted 20 Jun Link to this post

    Hello Ankush,

    The PageSettings->Margins of the Report may be set with Bindings. However, the Page functions that may be used to determine page properties (e.g. PageNumber function for the current page) can be used only in the Page sections and are not available in the context of the Report. Hence, the Margins cannot be set directly depending on the page number.

    If you don't need the PageHeader to display any information, you may use it to mimic Top Margin. Set its height to the desired margin and set its property PrintOnFirstPage to False to remove the PageHeader from the first page.
    You may also use Bindings to show/hide the PageHeader based on the page number, for example with the following Expression that will hide the header for pages 1, 2, 4 and 5 :

    Property path   |   Expression
    Visible         |   = IIF(PageNumber In Array(1, 2, 4, 5), False, True)

    Check the attached screenshot for clarity.

    Regards,
    Todor
    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
  3. Ankush
    Ankush avatar
    4 posts
    Member since:
    Apr 2018

    Posted 20 Jun in reply to Todor Link to this post

    But this approach doesn't remove PageHeader section space. Thats the main issue I'm facing.
  4. Todor
    Admin
    Todor avatar
    321 posts

    Posted 20 Jun Link to this post

    Hello Ankush,

    I have attached a sample report and the generated PDF that demonstrate how the PageHeader may be used to simulate Top margin. Note that there is blank space (i.e. top margin) only in the pages specified in the Expression.

    Regards,
    Todor
    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
Back to Top