It is always asked from several users to have a control on Printing of reports from Preview.
Normally you have two options to print the Report in Navision.
- From Request Page
- From Print Preview
If you check document Reports you will notice that you don’t have option to Print the Report from Preview, but you can print from Request Page.
Why it doesn’t allow in such Reports?
It is because these report uses statement like:
IF NOT CurrReport.PREVIEW THEN
If the C/AL code for the report uses the PREVIEW function to disable printing from the preview, then users cannot change the display mode to print layout.
Using these option I have tried to disable Printing of Report from Request Page and Print Preview.
Add a Boolean type Field in User Setup Table & Page as shown above.
Now the report which we want to restrict from printing we will add piece of code.
Although there are other ways to do this but to keep it simple I have followed this approach. Once you are ok with logic you can implement the same in your way, in fact more better way than this sample demo.
If I run the report by setting Allow Report Printing to FALSE, it will not show me the Print & Save as Option on Preview.
Also if I Try to Print or Save As… from Request Page it will Flag me an error as above.
So now you know the logic behind it, what you are waiting for. Give your user to control the Printing & Save As… option.
Now in last Cumulative Updates also Microsoft added option to control this, but it is at Service Level, if you want to control at user Level this is one option, wait for any further Cumulative Update in which Microsoft may add this capability or explore and find any other option and share with others.
That’s all for this post. I will come up with more details in my upcoming posts.
Till then keep exploring & learning.