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!
8 Answers, 1 is accepted
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
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.
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
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
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
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
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
[/quote]
This is not a feature of Telerik Reporting. We need the same thing for multi column reports.
Please see this enhancement request: Page Header Band that Grows/Shrink based on controls in it
Hi my solution:
private void pageHeaderSection_ItemDataBound(object sender, EventArgs e)
{
var company_Logo = (sender as Telerik.Reporting.Processing.ProcessingElement).DataObject["company_Logo"];
pageHeaderSection.Height = new Unit(company_Logo == null ? 0.75 : 1.7, UnitType.Inch);
}