Report Header with Dynamic Height

7 posts, 1 answers
  1. Ryan
    Ryan avatar
    35 posts
    Member since:
    Jul 2015

    Posted 30 Nov 2015 Link to this post

    Hello,

    1: I read that it is not possible to resize my report header at runtime. Is this true? I have text that sometimes wraps and other times doesn't, and I'd like to change the height of my report's header accordingly. Or is there a way to determine if the text will wrap, so I can reduce the font size until it will no longer wrap?

    2 (assuming option 1 isn't possible): I've moved my header to the detail section, but now I would like for it to repeat on each page. My header consists of two textboxes.

    Also, moving the header textboxes to the detail section creates another problem: sometimes, a seemingly random page break will be placed immediately after the textboxes. I'm assuming this is because I have placed a subreport immediately after the textboxes, and the subreport won't fit onto a single page. Does anyone know how I can force the subreport to display immediately below the textboxes?

    Thanks!

  2. Answer
    Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 03 Dec 2015 Link to this post

    Hello Ryan,

    1. It is not possible to resize the Page Header section at run-time. Other report sections can be resized at run-time, such as the Report Header section. For more information, please refer to the Report Structure help article. Also, there is no option to determine if the text will wrap using the built-in Reporting features.

    2. You can place the text boxes inside a static Group Header section and set the section's PrintOnEveryPage property to True.
    The SubReport will be kept together on a single page if its KeepTogether property is set to True. To keep the SubReport and the TextBox items together you will need to nest them inside a single Panel item and set the Panel.KeepTogether = True. For more information, please check the Understanding Pagination help article.

    Regards,
    Nasko
    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. Ryan
    Ryan avatar
    35 posts
    Member since:
    Jul 2015

    Posted 09 Dec 2015 Link to this post

    Thanks, Nasko!

    This took me a bit to figure out, so here's instructions for anyone else trying to accomplish this:
    1. Right click somewhere on the outside of your report (outside of the header/detail/footer section) and click 'Add New Group' and press OK (don't even press New).

    2. You now have a groupHeaderSection and groupFooterSection. Add stuff to your groupHeaderSection, set the PrintOnEveryPage property to true, and set the Visible property of groupFooterSection to false.

  5. Franklin
    Franklin avatar
    6 posts
    Member since:
    May 2014

    Posted 11 Feb in reply to Nasko Link to this post

    Hi Nasko,

    I'm having a hard time setting the size of my ReportHeader (NOT PAGE HEADER) at runtime so it will grow to fit the content. Sometimes the report has more content than others so I'm setting the visibility of items in the report header appropriately. My problem is when I programatically set reportHeaderSection1.Height = Unit.Mm(1) the Report Header is the same size as it would be if the items were visible. I've also tried binding the Height of the ReportHeader to "1px" as stated in the documentation but same results. What am I doing wrong?

     

    Thanks,

    Franklin

  6. Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 16 Feb Link to this post

    Hello Franklin,

    You can set the height of the report header in the report constructor to:
    this.reportHeaderSection1.Height = Telerik.Reporting.Drawing.Unit.Pixel(1);

    The report header will be resized at run-time to accommodate its items, regardless of their height.

    Regards,
    Nasko
    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. Franklin
    Franklin avatar
    6 posts
    Member since:
    May 2014

    Posted 16 Feb in reply to Nasko Link to this post

    Nasko,

    Thanks for your reply, but I have tried this and still find the report header remains the same height even when its items are set to invisible by bindings. My report header has an image and three lists. Two of the lists which are next to each other horizontally at the bottom of the report header are made to be invisible when certain data items are Null. This is working as expected. I've also set the reportHeaderSection1.Height property as you suggested as well as setting the Height property for both of the lists which may or may not be there. I am still finding the reportHeaderSection1 to be the same size as if the lists were still visible. Not only in the reportHeaderSection1 but in other areas of my report I am finding this same behavior. Please advise where I might be going wrong as this is holding up my project while I try and find a solution.

     Thanks,

     Franklin

  8. Franklin
    Franklin avatar
    6 posts
    Member since:
    May 2014

    Posted 16 Feb in reply to Nasko Link to this post

    Nasko,

     Please disregard the last post. I found my problem. Even though the lists were not visible my visibility bindings had disappeared for some reason. I'm having better success now.

     Thanks,

    Franklin

Back to Top
DevCraft banner