Options

printing from preview page

leugimleugim Member Posts: 93
edited 2004-06-07 in Navision Attain
hi all! i need some help

i have a trouble with the preview page. my steps are the following: start navision, type user and password, open main menu, enter in sales & payables, orders and press print button. after typing filters, i press the preview button and the report ends ok. but still in preview page... i want to print this report by my printer, and i press the small button on the lower left corner of the window, or even the same button under File menu... a message appears: "This report cannot be printed from preview..."

does somebody knows where this message is launched? i want to be able to print sales and purchases reports from preview page (in purchases & payables also appears).

entering the object designer i run the same report and the message also appears, but i couldn't find any property or code to open the message i'm talking about...

ideas or clues will be well-received
many regards
_______________
so far, so good

Comments

  • Options
    RobertMoRobertMo Member Posts: 484
    sometimes this happens, but i never bothered with it... you can still run it again and print it without preview
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    Timo_LässerTimo_Lässer Member Posts: 481
    This message appears if "IF CurrReport.PREVIEW THEN [...]" exists somewhere in the C/AL code.
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • Options
    Edward_BloomfieldEdward_Bloomfield Member Posts: 155
    Hi,

    I believe this is because it is a report that updates records when it is printed - e.g. updating the "No. Printed" field in the Sales Invoice header table.

    If you preview a report like this, then the data is not updated because it is only being previewed. If you then print from preview, this code is not run from preview, & the data is never updated (No. Printed is not incremented).

    As a result, Navision does not let you!
    Edward Bloomfield

    Lead Consultant
    Theta
  • Options
    leugimleugim Member Posts: 93
    hi all and thanks for your supply

    the problem is not to arrange those reports, the problem is my final customer, because they find very unnoperative to preview a report and then close it to print again by the printer... they work hard and found Navision a very slow tool to work with... ops! :(

    i talk with some other people about this question and they told me about updating the number of times a report is printed too, as edwar bloomfield did. one of them talk me about some codeunit between 300 and 399 (???) where the update is done each time an invoice report is printed by the printer. another friend exported all codeunits in text format and the text "This report cannot...." was looked for in an external text editor. the total number of hints was.... ZERO ( wow! :?: )

    so, my final customer will have to accept this Navision's way to work, it's not a bug, is not an error, it's only an adaptation the customer don't want to accept :?

    for all of you, thanks to be there giving your knowledge and your ideas. my best regards to all and each of you.
    _______________
    so far, so good
  • Options
    RobertMoRobertMo Member Posts: 484
    damn, that kind of customer again... :x
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    Timo_LässerTimo_Lässer Member Posts: 481
    leugim wrote:
    [...]
    another friend exported all codeunits in text format and the text "This report cannot...." was looked for in an external text editor. the total number of hints was.... ZERO ( wow! :?: ) [...]
    You can't find this string because it comes from the fin.etx file.

    You have to look for
    IF CurrReport.PREVIEW THEN
    
    This little piece of code blockes printing from preview.
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • Options
    kinekine Member Posts: 12,562
    IF CurrReport.PREVIEW THEN
       Message('A')
    else
      Message('B');
    

    CurrentReport.Preview is the source of your problems. It is clear - if you press Preview - Message('A') is done. Than you press print but this code in this case is wrong because you PRINT... 8) to have consistent and true code, you must close report and run once again.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.