# Print trigger in report preview

**URL:** <https://www.dynamicsuser.net/t/print-trigger-in-report-preview/10001>\
**Category:** Developers Forum\
**Created:** [May 29, 2005, 2:50pm UTC](https://www.dynamicsuser.net/t/print-trigger-in-report-preview/10001 "2005-05-29T14:50:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![innersome](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@innersome](https://www.dynamicsuser.net/u/innersome)\
**Post date:** [May 29, 2005, 2:50pm UTC](https://www.dynamicsuser.net/t/print-trigger-in-report-preview/10001/1 "2005-05-29T14:50:34Z")

</div>

Recently I come over a sales quote report that pops up a message saying it can’t be opened in preview mode. This happens when user tries to print the report while it’s in preview mode. There is no problem when the printing is initiated directly without going thru the preview mode. I would like to know how I can correct this problem i.e. to allow the report to be printed from preview mode. I tried to scan thru the codes in the report and codeunits but couldn’t find the cause of such problem. If anyone knows the solution to this, please advise. Thank you.

---

<div class="post-metadata">

**Author:** ![anfinnur](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@anfinnur](https://www.dynamicsuser.net/u/anfinnur)\
**Post date:** [May 30, 2005, 7:22am UTC](https://www.dynamicsuser.net/t/print-trigger-in-report-preview/10001/2 "2005-05-30T07:22:02Z")

</div>

I never tried to correct this. But reason is the field “No. printed”; the field is only filled out when not previewing. When you are in previewing-mode and then choose printout, Navision cannot “go back into the code” and modify the field.

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [May 30, 2005, 7:22am UTC](https://www.dynamicsuser.net/t/print-trigger-in-report-preview/10001/3 "2005-05-30T07:22:18Z")

</div>

Hello, this is in fact not a problem nor a bug but intended behaviour. Insidethe posted sales documents table (110,112,114,116) and also in most other posted documemnts you will find a field called “No. printed”. Inside the report printing such documents you find a code line like : IF NOT CurrReport.PREVIEW THEN If you are not in a preview, but printing directly, the system calls a codeunit which increments the “No. printed” field. The triggers are executed before you get the report on the screen, which means that - if you chose Preview - the counter does not increment. When you then would print from the preview, the system could not increment anymore as the triggers have been processed already. So the conclusion is: As soon as the condition CurrReport.PREVIEW is tested in a report, you will not be able to print from the preview.

---

<div class="post-metadata">

**Author:** ![innersome](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@innersome](https://www.dynamicsuser.net/u/innersome)\
**Post date:** [May 30, 2005, 12:26pm UTC](https://www.dynamicsuser.net/t/print-trigger-in-report-preview/10001/4 "2005-05-30T12:26:02Z")

</div>

In fact I suspected the Curr.PREVIEW evaluation statement as well. But because I couldn’t find something like ERROR() statement inside the block, I am confused. I tried to comment the CurrReport.PREVIEW statements and the printing from preview mode does work. But disabling these statements are not an appropriate action, i guess. Customer just have to accept the nature of the report. Thanks for your information.
