In my previous post, I talked about discussing extra space issues aka ‘Blank page issues’ Dynamics AX. So, today we will walk through the problem and try to find a solution (or a set of possible solutions) that works every time. With that said, I would like to point out that the ‘Blank page issue’ is such a black-hole in itself that no one can ever guarantee that following some specified set of steps would save you from falling into that ditch, but this will serve as an pro-active attempt to reduce the percentage of getting into trouble.
So, what is this blank page issue actually?
At first glance, when you print your recently modified report to the screen it looks like it is working the way it is supposed to. But, actually if you try to print the same report or save it to pdf you will realize that it is printing an extra page. This extra page can be at the end of the report (in this case, only one extra page is printed in total) or there could be one normal, one blank page, one normal and one blank page which has now doubled the amount of pages you actually needed.
So, why does this Blank page issue arise?
There could be many answers to this, some experts would argue it’s the settings some would say it’s the developer and we would certainly discuss all those arguments when going through the solution. But for now, I will keep it simple; this happens (in most cases) when you have content flowing beyond the body size of the report.
Blank Page Solutions
1) Make sure that the page you are actually using in the printer is specified correctly in the Report print setting, for example if you are using European A4 instead of US Letter(mostly used) you would need to specify that change(by default it is set to US Letter). Reason being, European A4 (8.3 x 11.7 inches) and US Letter (8.5 x 11 inches) have different dimensions.
2) Make sure that the Body size is set to correct limits. Body Width = Page Width – Left Margin – Right Margin, so for US Letter the Body size would be <=7.5in (8.5 – (0.5+ 0.5)) and similarly for European it should be 7.3in.
When we take a look at the VS report for FreeTextInvoice we find that the Body size is 8.11in which is more than 7.5in and hence causing the blank page issue.
If you absolutely cannot make your report work in the Body Size of <=7.5, the only other option you have left is to actually modify (decrease) the margin(Left, Right) size; the basic rule while playing with this page width and body size properties are that your actual Report width should not go beyond the defined Page width.
3) If you believe that for any reason you may have accidentally changed the column (or textboxes) width while re-arranging some of the textboxes or if you have added new columns (or textboxes) it is the high time that you take a note of those new additions or changes because it is highly prominent that this is causing the blank page issue.
My dear friend Bill suggested that we can color those textboxes that we recently monkey’ed with, reason being that this will allow you to actually visualize which textboxes are actually going over-width when we see the corresponding color printed on the 2nd page (blank). This is very easy and also saves developer a lot of hit and trial time.
4) There is a property called ‘CanGrow’ for textboxes, MSDN specifies that if set to True, it will allow the section or control to grow vertically so that all data it contains can be printed or previewed. We need to make sure that we have this property set to False.
5) In the Report properties, Set ConsumeContainerWhiteSpace property to True.
6) Under Print destination settings – Properties – Check “override default settings”:
7) Try minimizing the white space at the end of the Report, this is purely a work-around.
For other blank page problems in Microsoft Dynamics AX, check out the related posts.