how to display the picture

hi i have some data in a table, it's name Product. it's contain some data like this:

code picture
A1 C:\A1.jpg
A2 C:\A2.jpg
...etc.

field picture just contain path of picture location not a blob. how can i show in fast report which contain code of product and it's picture? help me

thank's
yudi

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 6:47PM
    use the obp event of the pictureview and write code using the loadfromfile method
    IIRC picture1.picture.loadfromfile('path&filename');
  • edited 6:47PM
    thank's for the replay but i still not understand to fill Path&filename in picture1.picture.loadfromfile('Path&file name'). this the situation:
    1. table product have 2 field (as i wrote before)
    2. i put a memo which contain code and picture(which load from directori) in masterdata1 band.
    3. if i use picture1.picture.loadfromfile('C:\A1.jpg') in obp event of pictureview then code A1 and A2 display picture A1.jpg
    4. i want like this:

    if code A1 then the picture A1.jpg
    if code A2 then the picture A2.jpg

    or we can say every code display it's own picture. or how to fill 'path&filename' with value of picture field in table product

    thank's
    yudi
  • gordkgordk St.Catherines On. Canada.
    edited 6:47PM
    in th obp event test the value of the field
    if <datasetname."fieldname" > = 'A1' then
    picture1.picture.loadfromfile('C:\A1.jpg') else
    picture1.picture.loadfromfile('C:\A2.jpg');

    or if the data field contains the path & filename
    picture1.picture.loadfromfile(<datasetname."fieldname" >);
  • edited 6:47PM
    thank's it's work
  • edited 6:47PM
    buenisimo el ejemplo, lo he implementado, ahora me queda una consulta, cuando registro no tiene foto asignada, se lanza un error, como podria manejar esta excepcion haciendo que si no existe tan solo muestre vacio el objeto picture?
  • gordkgordk St.Catherines On. Canada.
    edited 6:47PM
    no comprendo
    language of group is english.
  • edited 6:47PM

    good example, I have implemented, now I have a query, where registration is not assigned photo, an error is thrown, as it might handle this exception so that if there is not just a picture showing the object empty?
  • gordkgordk St.Catherines On. Canada.
    edited 6:47PM
    typical
    in obp event of band check the size of the datafield stream if not large enough to be a picture
    then modify the pictureview's properties to suit
  • edited January 2011
    gordk wrote: »
    in th obp event test the value of the field
    if <datasetname."fieldname" > = 'A1' then
    picture1.picture.loadfromfile('C:\A1.jpg') else
    picture1.picture.loadfromfile('C:\A2.jpg');

    or if the data field contains the path & filename
    picture1.picture.loadfromfile(<datasetname."fieldname" >);

    That perfectly works for me.
    Thanks a lot for your help.
  • edited 6:47PM
    Hi,
    Am new to OAF and have one question.. If I want to display the prompts against any field in the OAF page dynamically then is this feasible? What should I be looking to achieve the same.

    Thanks and Regards
  • edited 6:47PM
    I think it's quite feasible.
    Please PM me.
  • edited June 2013
    Photo addresses are stored in the database.
    The way you said you did not call and the following error message appeared.
    help me


    32084632d369.jpg

    void Picture1OnBeforePrint(TfrxComponent Sender)

    {
    picture1.picture.loadfromfile(< frxDBDataset1."LBLImage" >);
    // picture1.picture.loadfromfile("E:\Certificate\AghahiTojihi\Keshvarian.jpg");



    }

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.