Beginner Question: How to work with Reports

Heiko_DHeiko_D Member Posts: 11
Hello, i am a total beginner in Navision. So i hope somebody can help me.
My problem is, i want to insert a menu button with two options:
1. to print with the firm logo
2. to print without the firm logo

My first try was to create 2 reports. One with logo and the other without logo.
Would it be well, to say :
option 1 "run object" "report with logo"
option 2 "run object" "report without logo" ?

i don't know, because all forms i looked at doesn't use "run object".
There is just
DocPrint.PrintSalesOrder(Rec,Usage::"Order Confirmation");
and i don't know how to use such a code :(

I hope you could understand my problem.
secon EDV-Consulting GmbH
Software | Schulung | IT-Beratung

Comments

  • krikikriki Member, Moderator Posts: 9,115
    For maintainability it is better to create 1 report in which you put a picture to which you can import (or not import) a blob (like Picture of table Company Info) to show or not show the picture.

    In this case you can put in the requestform of the report a toggle ("Show the Logo") that let's the user decide to use the logo or not.

    In the OnPreReport-trigger, you can check the boolean an if it is true, have the blob calculated to show it on the report.
    Lets say the picture of the logo is in the picture-field of table Company Information.
    Define a global of type record and subtype "Company Information".
    Then this would be the code:
    recCompanyInformation.GET();
    IF blnShowLogo THEN
      recCompanyInformation.CALCFIELDS(Picture);
    

    The picture on your report must have as sourceexpression "recCompanyInformation.Picture".
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Heiko_DHeiko_D Member Posts: 11
    Big thanks for your help.

    but now i have a new question.

    I build the button "With Logo" on my form. "on Push" i insert your code.
    As Global Variable for the Form i insert "CompanyInfomation" as "record" an subtype "company information".

    But now a message says : Unknow Variable "blnShowLogo"

    I know it's a silly question but i can't keep this in mind 8-[

    big thanks in advance :D
    secon EDV-Consulting GmbH
    Software | Schulung | IT-Beratung
  • krikikriki Member, Moderator Posts: 9,115
    Just noticed this:
    [Topic moved from Navision DOS forum to Navision forum]
    BTW I assume you DON'T work with the DOS-version of Navision any more :D

    You also need to define the variable blnSHowLogo as boolean in the globals.
    In the "On Push" of that control (Not a button, you should use a checkbox), you don't need to put any code.
    The code you should put in the "OnPreReport"-trigger.

    BTW: the name of the "Company Information"-record is recCompanyInformation. I forgot to mention this before.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Heiko_DHeiko_D Member Posts: 11
    Very Very Much Thank you :D
    You have made a navision beginner very happy. :mrgreen:
    secon EDV-Consulting GmbH
    Software | Schulung | IT-Beratung
Sign In or Register to comment.