If you take a closer look at the latest version of Business Central, you will sooner or later notice that for some reports in the preview window, the preview button is just called “Preview” and other reports are called “Preview & Close“.
Here is the report “G/L Total-Balance” as an example of preview and close:
And here in as a counter-exmaple the “Customer List” report:
What controls the difference in presentation?
I already see myself, how a customer or partner asks me this question and then of course I want to shoot with an answer from the hip.
So I set out and scoured Microsoft’s documentation.
First, I came across the entry that some reports now access the read-only replica by default. There is also a list of these reports on the docs page. After reviewing it, I found that this was not the decisive factor for a difference.
So I was on my own and tried to find the difference by logical procedure.
The following considerations came to mind:
- the PREVIEW command
- the Previewmode property
- the presence of a request page in AL
But all these considerations did not lead me to the goal.
After a long search, I finally found the decisive clue. The SaveValues property of the Request Page makes the difference here.
If this property is set to true, the request window of a report is previewed.
However, if this property is set to false, or does not exist at all, or if the requstpage area is completely missing in AL, the request page showes Preview & Close.
On closer inspection, this is also logical. If the report is started only with preview, the user has stored filters and settings to preserve.
If the user closes the preview, he has the request window with the “saved” values in front of him.
Therefore, if a report is so desgined that user input should not be saved, the request window must be closed immediately and only the preview displayed.