RDL second page control widths

Posted by: roland.lee on 2 May 2024, 4:24 pm EST

    • Post Options:
    • Link

    Posted 2 May 2024, 4:24 pm EST

    hello.

    Another question - so there is a 2 column layout in a report, on the 2nd page, we would like to maximize the width of the 2nd column since the 1st column is most likely done in the first page. Is this doable in an RDL?

    Roland

  • Posted 3 May 2024, 6:08 am EST

    Hi Roland,

    Although there is no direct way to achieve this requirement in an RDL report, however, if you have static data in your table i.e. the height of the contents in your table (on the first page only) does not change on each preview then you can use ReportSections to achieve your requirement.

    For this in the first report sections add two tables one on the left and one on the right, in your second table you can add an expression to the ‘Visibility.Hidden’ property that compares whether the row number is greater than the number of rows for the first page, if yes you can hide the rows else show them.

    For your second report section copy the second table to this section extend its width and change the visibility condition to the exact opposite, i.e. check if the row number is greater than the number of rows for the first page, if yes you can show the rows else hide the rows.

    Please find attached a sample implementing the same.

    You may also try using a SectionReport in which events get called on each section/page render and you can change the control’s width/position as per different event calls at runtime.

    You may learn more about SectionReports here: Section Report. You may also learn about Section Report Events here: Report Events.

    Regards,

    Anand

    TwoColumnReport.zip

  • Posted 3 May 2024, 11:06 am EST

    Hi Anand.

    Thanks for the example. We are leaning towards the event driven Section reports. We usually do it this way but was wondering if there was an RDL report way of doing it.

    Thanks,

    Roland

  • Posted 7 May 2024, 12:21 am EST

    Hi Roland,

    No issues, glad we were able to assist!

    Regards,

    Anand

  • Posted 29 May 2024, 4:06 pm EST

    Hi Anand -

    So which event is used to set a control’s width on a second page? is it format or print event? Mind you, the control may go between multiple pages so it will be 3/4 page in the first page and full page width in the subsequent pages?

    Thanks.

    Roland

  • Posted 30 May 2024, 5:06 am EST

    Hi Roland,

    You can update the controls’ width within the section’s before print event, you can learn more about events here: Report Events.

    However, please note that SectionReports only supports binding to a single DataSource, so if you have multiple data sources/datasets you will first need to merge them into a single data and bind it to the SectionReport’s DataSource property.

    Please find attached a sample implementing your requirements.

    >> Mind you, the control may go between multiple pages so it will be 3/4 page in the first page and full page width in the subsequent pages?

    In SectionReport there’s no direct control for the Table as the Detail Section itself repeats for each data in your report, so the expression gets calculated for each row of your data so even if the page break happens in between your data the next section will update its width as per the page number at that moment of time.

    Regards,

    Anand

    SectionReportWidthAdjust.zip

  • Posted 30 May 2024, 9:33 am EST

    Hi Anand.

    Thanks for the example and thanks for clarifying the per row calculation. So the question then is, if the “row” is one large html block that potentially covers multiple pages, then the moment in time calculation doesnt work no?

    That seems to be what I am experiencing.

    Thanks.

    Roland

  • Posted 31 May 2024, 1:40 am EST

    Hi Roland,

    Unfortunately, that would not work as the before print event/format events are called at the time the section is getting printed, and due to that it will take up the size values based on that page number in the case when the section has started rendering from the first page the before print/format event will set the width values accordingly.

    Regards,

    Anand

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels