Conditional Picture display

Hi,
I m very new to Fast reports, just 1 week.

I m generating a report which displays fields from database table.

In the, i have a string field which display time in HH:MM:SS format e.g 09:25:36

I have another picture control on my report form which is not connected to any table.

What i m looking for is i want to display picture if time is above 9'Oclock.

If the first 2 characters of time field is greater than 09 than display picture otherwise make is invisible

Can somebody please help.

Thanks,
AJ

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:57AM
    use the decodetime function to decode the time into its parts
    inthe obp event of the pictureview
    write code to check the value and set the visible property.
  • edited 4:57AM
    gordk wrote: »
    use the decodetime function to decode the time into its parts
    inthe obp event of the pictureview
    write code to check the value and set the visible property.

    Hi thanks for ur reply...

    However, when i pressed CRTL+SPACE button in the obp event of the pictureview i cannot find decodetime function.
    I m not sure why. Am i doing something wrong?

    Anyway i found a workaround to it. I have created an extra field in the table and from delphi i m reading the time, comparing it and saving 0 / 1 in my new numeric field in the table.

    After that i went to obp event of the picture and i wrote

    Picture1.LoadFromFile('ALERT.png');
    if <frxDBDataset2."prof_iINImgDisplay"> = 0 then begin
    Picture1.Visible:=False;
    end else begin
    Picture1.Visible:=True;
    end;

    It may not be the correct way but it works.

    Anyway if u think this is not the proper way to do this, kindly let me know how to do this.

    thanks

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.