Print Preview

ara3nara3n Member Posts: 9,257
Hello.
Certain reports, when you are in preview mode, you can click on print button in the bottom left corner and it sends it to printer. Some reports, you get an error that you need to exit print preview and print the report. Anybody knows the reason?


Second question.
Some reports when you in request window. you can click on file->Send->by email. Some reports are added as attachment, and some are added as body. Any reason why?

Thank you.
Ahmed Rashed Amini
Independent Consultant/Developer


blog: https://dynamicsuser.net/nav/b/ara3n

Comments

  • themavethemave Member Posts: 1,058
    in answer to the first question, reports that check a counter when printed, usually do not let you print from the print preview screen, code in the report looks for preview mode and doesn't set the counter so if you printed the counter would not be updated.

    several reports use the counter to show how many times it has been printed, like a PO, if you look at the PO list it show number of times it has been printed.

    Not sure on the second qeustion, never looked at it.
  • ara3nara3n Member Posts: 9,257
    Thanks themave.
    I just tested it with creating a new report, tested one without printpreview function it worked. Adding the printpreview function errored out. Great.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ntnt Member Posts: 160
    hi,

    how i can turn off this couter validation?
  • flfl Member Posts: 184
    Certain reports, when you are in preview mode, you can click on print button in the bottom left corner and it sends it to printer...

    The right answer here is that it is even more then the reports with a counter. All the reports with data manipulation in the C/AL code (modify, delete, insert,...) will give this error. If a counter is used, then there is offcourse a command like this in the c/al code of the report. It's quite clear that you don't want that a report be doing twice the data manipulation, once by the preview, and then once again with the print itself.

    Second question: didn't notice before
    Francois
    Consultant-Developper

    http://www.CreaChain.com
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Just to clarify on point 1.

    What happens is this. When you run a report in print preview mode, the data that is required to print is spooled to a temp file for later printing. During the running of the actual report, Navision is internally monitoring if there is any code that would act differently if printed directly or if run in print preview. mode. The most obvious thing it looks for is the command IF PRINTPREVIEW, but it does not look to see what the command does, so even the command
    IF PRINTPREVIEW then ; is enough. There are a few other conditions it checks, but I can't remember them.
    David Singleton
  • garakgarak Member Posts: 3,263
    The anwser is the Code:
    if CurrReport.PREVIEW then ....
    

    These snips is inplemented, when you will only run source when printing and not in preview mode (like number of prints in post. invoice or rch. Documents)

    then when you press the printer button on Preview, navision will not go through the Code. It prints the result thats temp. saved

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.