picture of item in quote

nightrodnightrod Member Posts: 68
Hi,

Does anyone can send me a sample code of how to show the item picture in a quote.
i have tryed to add it but it doesnt show.
Also using
item.calcfields(picture)

thanx
Rod

Comments

  • garakgarak Member Posts: 3,263
    on Report or on Form?
    Do you make it right, it works too!
  • garakgarak Member Posts: 3,263
    edited 2008-12-09
    here an example based on the subform of the purchase quote.

    1. add a new Picture Box (for example in the right frame where you also can see the Item Descriptions and Item card)
    2. create a new Function like "GetItemPicture()" an form
    3. these Function you call from Form - OnAfterGetCurrRecord() and Form - OnNewRecord(BelowxRec : Boolean)
    4. Example for form:
    Form - OnNewRecord(BelowxRec : Boolean)
    ....
    ....
    ....
    GetItemPicture();
    --------------------------------
    Form - OnAfterGetCurrRecord()
    ....
    ....
    ....
    GetItemPicture();
    --------------------------------
    
    GetPicture()
    Item.RESET;
    Item.INIT;
    IF (Type = Type::Item) AND ("No." <> '') THEN BEGIN
      Item.GET("No.");
      Item.CALCFIELDS(Picture);
    END;
    ---------------------------------
    

    5. example for Report

    On a report you need also a Picture Box. The Picture Box you set in a separate Body Section (here in the example called PictureBody).
    In "PictureBody () - OnPreSection()" Trigger of the section you write:
    CurrReport.showoutput(Item.Picture.hasvalue);
    

    On the XYZ - OnAfterGetRecord() trigger you calcfield the field picture.
    Item.calcfields(Picture);
    

    In both cases don't forgett, NAV can only display bmp files.
    Also note, that storing big files in the BLOB field is not so performant under sql (search hierfür the forum).

    Regards
    Do you make it right, it works too!
  • nightrodnightrod Member Posts: 68
    Hi Garak,

    Thanks for your reply.
    i want to show the picture in the quote report.
    Does it works the same.

    Again Many thanks for your reply
  • garakgarak Member Posts: 3,263
    edited 2008-12-09
    it's the same. Read (5.).

    Create your new Function and call this Function from RoundLoop - OnAfterGetRecord().
    Why function: So it's easier for you to make changes / upgrades and you can copy this function if you need it, for example in a form or other report.

    Create a new Body Section for Roundloop and insert there the Picture Box.
    OnPreSection of this Body you write the CurrReport.Showoutput command (see 5.)

    Regards
    Do you make it right, it works too!
  • SavatageSavatage Member Posts: 7,142
    garak wrote:
    5. example for Report


    Did you see the example for Report?

    This works for any report. Quote reports are no different
Sign In or Register to comment.