I have a report with many columns in design time that don't fit on an A4 sheet. So I switched to A3 to be able to work. But the user selects only some of the columns and prints in A4.
Then in the Before Print event I change the size from A3 to A4. But my band remains the same size and is cut.
Oh how to solve this?
A sample report is attached.
Build date: 2023.08.23
- (12.9 KiB) Downloaded 128 times
You should manually correct the components size, and positions in that case, or create report from code:
https://www.stimulsoft.com/en/samples/r ... -from-code
I set the width of my band equal to the page width after changing the sheet size. I would expect the in-band panel to adjust automatically since it is with dockerStyle full. But that didn't happen.
Then I defined the panel width with the bandwidth meta. Because I have two columns in it. Now I don't have cut data. But I lost the space setting between columns I defined. Then decrease the width of the panel by 2, so there is space between the columns. In this simple example there are already problems with this approach.
One observation: I placed a panel aligned at the top of the page and it automatically adjusted when I changed the size of the sheet. No cropped data. Why can't the band behave like this? Are there any limitations?
- set-paper-size-sample (1).mrt
- (14.84 KiB) Downloaded 128 times
Please explain, how you run the report, change the page size and send it to printing.
I have an Order object with payment methods. I need to print the order data and payment methods in two columns.
Therefore, I created a band for the order and another band, with two columns, for the payment methods. Set the sheet size to A3 by default.
In the page's BeforePrint event, I change the size of the sheet to A4. And here the problem happens.
If the band doesn't have speakers it works fine. The problem is when using columns.
To run it, I open the mrt file in the editor, click on preview and see the problem.
Attached you can download the report and reproduce the problem.
Thanks for the help so far.
- set-paper-size-sample (3).mrt
- (8.63 KiB) Downloaded 8 times
There is no possibility to automatically adjust all component sizes for new paper size.
You should manually correct the components size, and positions in that case, or create report from code.