Reports: Check if an Image exists

elToritoelTorito Member Posts: 191
edited 2004-06-17 in Navision Financials
Hello,

now after 2 years I must again work with Navision...
And after this Time i have a little Problems.

I Intend make an Report wich list me a lot of Items.
In the Section I have 2 Bodys, One for my Items Details and One for if exists an Image for the Item.

In my Second Body I Have the C/AL Code:
CurrReport.SHOWOUTPUT(IfExistsImage = TRUE);

But i don't now where i must put the Code for the Function who asked if the Image Exists.

If I Put Follow Code in the (onPreSection) Trigger of my first Body i get a lot of errors, in the Trigger perhaps only i can put Bool values?
myImage = ItemTable.GETFILTER(Image);

IF myImage THEN 
  IfExistsImage = TRUE
ELSE
  IfExistsImage = FALSE

Can please help me everyone and cann say me where i must put the Function for asked for an Image.

Thanks.

PS: I Hope you understand what i mean ... my bad english ... :roll: :oops: :oops:

Regards

Piter
(Oo)=*=(oO)

Comments

  • bostjanlbostjanl Member Posts: 107
    elTorito wrote:
    Hello,

    now after 2 years I must again work with Navision...
    And after this Time i have a little Problems.

    I Intend make an Report wich list me a lot of Items.
    In the Section I have 2 Bodys, One for my Items Details and One for if exists an Image for the Item.

    In my Second Body I Have the C/AL Code:
    CurrReport.SHOWOUTPUT(IfExistsImage = TRUE);
    

    But i don't now where i must put the Code for the Function who asked if the Image Exists.

    If I Put Follow Code in the (onPreSection) Trigger of my first Body i get a lot of errors, in the Trigger perhaps only i can put Bool values?
    myImage = ItemTable.GETFILTER(Image);
    
    IF myImage THEN 
      IfExistsImage = TRUE
    ELSE
      IfExistsImage = FALSE
    

    Can please help me everyone and cann say me where i must put the Function for asked for an Image.

    Thanks.

    PS: I Hope you understand what i mean ... my bad english ... :roll: :oops: :oops:

    Regards

    Piter
    Hi!

    You should put code in OnPreSection in secod body:
    ImageTable.CALCFIELDS(Picture) // Not 100% sure that this line is nessesery
    SHOWOUTPUT(ImageTable.Picture.HASVALUE);


    C&P from Help:
    b.HASVALUE
    Use this function to determine if a BLOB (Binary Large Object) has a value.

    HasValue := BLOB.HASVALUE
    HasValue

    Data type: boolean

    If HasValue is...
    It means the BLOB...

    TRUE Has a value
    FALSE Does not have a value

    BLOB

    Data type: BLOB

    The BLOB you want to check.
  • elToritoelTorito Member Posts: 191
    bostjanl wrote:
    Hi!
    You should put code in OnPreSection in secod body:
    ImageTable.CALCFIELDS(Picture) // Not 100% sure that this line is nessesery
    SHOWOUTPUT(ImageTable.Picture.HASVALUE);

    The BLOB you want to check.

    Hello bstjanl,

    thnaks for the Help, yes it was it, HASVALUE was what i needed,
    i checked too with the first Line you posted
    ImageTable.CALCFIELDS(Picture)
    

    It not seems look necessary, it works too when i leaved it.

    Thanks a lot, now it works so i would. :)
    (Oo)=*=(oO)
Sign In or Register to comment.