The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I've made a paginated report that has a page end after every unit, which can consist of multiple pages. My colleagues now want to print the generated pdf recto verso, but they need to split the printed pages per unit. When a unit has an odd number of pages, the next unit starts at the backside of the pages of the previous one. Is there a way to add in a blank page at the end of the unit, only when the unit has an odd number of pages?
Thanks in advance!
Best,
Eva
Hi, @E__
You can open the paginated report in Report Server and select Print
Select page size and orientation. Select Print.
Then wait for a minute.
Next, you can set the print page you want on the new print settings page.
If you want odd-numbered pages, you can choose Odd pages only
If you also want to leave blank space, use an expression to conditionally add a blank page. You can add a rectangle or text box at the end of a cell and set its visibility based on the number of pages.
Add a rectangle or text box at the end of the cell.
Use an expression to set the visibility of this rectangle or text box. Expressions can check if the page number is odd and then make the rectangle or text box visible. For example:
=IIF(Globals!PageNumber Mod 2 = 1, False, True)
Also adjust the page setup to ensure that the report's page setup (margins, size, etc.) is configured correctly to avoid any unexpected blank pages. You can check the following link:
Avoid blank pages when printing paginated reports - Power BI | Microsoft Learn
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
The printing of only odd does not help, because the printing is scripted (pdf is generated on schedule, and automatically printed), and the numer of pages per unit can vary between exports.
The text box does sound like a good solution, but I get an error that the PageNumber can only be used in the header or footer. I can't find an alternative that I can use on the report page - do you know of something that exists?
Thanks,
Eva
Hi, @E__
You may need to adjust your paginated report to control your blank pages.
Or add blank pages manually, albeit a bit of a hassle.
Regarding the second text box, it can only be used in the footer and header. However, you can do this in the form of custom code, which can be a bit complicated. You can check the following link:
The following code can be used:
Public PageNumber As Integer = 1
Public Function GetPageNumber() As Integer
PageNumber += 1
Return PageNumber
End Function
Use custom code in your report to set the visibility of rectangles or text boxes to the following expressions:
=IIF(Code.GetPageNumber() Mod 2 = 1, False, True)
Box selection table
Here is my preview:
Before
After
You can check the following links:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @v-yohua-msft
I can't seem to figure out where the textbox should go. I put it here, underneath my table,
But it only shows up on the last page, and not between the row groups of [Kast]. Where should I put it to generate the empty page after the end of the row group?
Thanks,
Eva
Hi, @E__
My method doesn't necessarily require a text box, you can use it directly on your table. If you must use a text box, the text box for page numbers needs to be placed in the header and footer, and the footer is the space under the dotted line.
When you click on the gray area on the right, the code will appear in the property bar on the right, and then you can embed the custom code in the code, and then continue the operation I said above
Best Regards
Yongkang Hua
Hi @v-yohua-msft,
I think I understand - your method of using the code on the table, will have the table only render on odd pages, right? What I need is slightly different - sorry for the confusion. I need to add an extra blank page if the group [Kast] ends on an odd page. This way, when we print recto verso, we can have the next item in the row group on a new seperate sheet of paper.
Best,
Eva
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.