I need to force user’s to Preview a report and not print it. Any ideas? Thanks!
IF NOT CurrReport.PREVIEW then Error('Please Select Preview Only!'); // <-- this is of course a text constant[;)]
David, Thanks for the idea! Worked to force a preview. But would not allow subsequent printing from the preview screen. Any ideas on that? Is there a way to hide the print button on a report?
Strange as it seems, I can see the logic of why you would want this, and it makes sense. So… var SeenPreview::Boolean; Cons MyMessage::Text := 'You must preview the report before printing'; OnInitReport SeenPreview := false; // make sure it is reset between multiple printings OnPreReport IF CurrReport.PREVIEW then seenpreview := true else if not seenpreview then Error(MyMessage);
What kind of code ist this? It does not look like C/AL at all. I need more information…
What part of it doesn’t look like C/AL Code? Maybe the comments? David is a fast typist, do that may be the cause… [:D]
I think that Tschopp do not understand the part var SeenPreview::Boolean; Cons MyMessage::Text := 'You must preview the report before printing';
Tschopp: this mean that you need to define one global variable with name SeenPreview of type Boolean and one TextConstant with the text ‘You must preview the report before printing’… other lines are C/AL codes…