Can I force a page break based on when the value of a column ?
Can I force a page break based on when the value of a column ?
I have a need to insert "optional page break" in my report based on the source data. Currently my report is generated using a single (page) header and data line.
Basically, I woul like the report engine to add a page break either when the value of a given data column changes or when it is set to a specific value (either solution will work for me).
Any suggestion?
Basically, I woul like the report engine to add a page break either when the value of a given data column changes or when it is set to a specific value (either solution will work for me).
Any suggestion?
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Can I force a page break based on when the value of a column ?
Hello,
You can use the following code in the BeforePrint event:
if (yourcondition)
Engine.NewPage();
Thank you.
You can use the following code in the BeforePrint event:
if (yourcondition)
Engine.NewPage();
Thank you.
Re: Can I force a page break based on when the value of a column ?
Thank you for your answer. Unfortunately, it doesn't seem to be working.
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Can I force a page break based on when the value of a column ?
Hello,
That should work in the NET-based and JS products.
Thank you.
That should work in the NET-based and JS products.
Thank you.
Re: Can I force a page break based on when the value of a column ?
Well, it doesn't seem to work in the designer's preview (web or local). I have opened a support case for this. Thank you for your help
Re: Can I force a page break based on when the value of a column ?
I found the problem. Apparently, this script doesn't work in "interpretation" mode. Thank you again for your help.
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Can I force a page break based on when the value of a column ?
Hello,
You are welcome.
You are welcome.
Re: Can I force a page break based on when the value of a column ?
Hello,
I tried this BeforePrintEvent on a Panel (containing a simple shape). The condition is "if(IsFirstPage) Engine.NewPage();".
The new page is correctly created during preview, but it's a complete copy of the first page.
I was expecting to only have the Panel (and the components after it) on the new page.
Is this the correct behaviour ?
Thank you
I tried this BeforePrintEvent on a Panel (containing a simple shape). The condition is "if(IsFirstPage) Engine.NewPage();".
The new page is correctly created during preview, but it's a complete copy of the first page.
I was expecting to only have the Panel (and the components after it) on the new page.
Is this the correct behaviour ?
Thank you
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Can I force a page break based on when the value of a column ?
Hello,
Please send us a sample report with test data for analysis.
Thank you.
Please send us a sample report with test data for analysis.
Thank you.
Re: Can I force a page break based on when the value of a column ?
You can find the sample attached.
It's quite simple without any data. It only contains shapes and subreport.
It's quite simple without any data. It only contains shapes and subreport.
- Attachments
-
- BeforePrintEventPageBreak.mrt
- (5.23 KiB) Downloaded 82 times