Alpha Video Training
Results 1 to 15 of 15

Thread: How to display a .jpg file in a JPG image field

  1. #1
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    655

    Default How to display a .jpg file in a JPG image field

    I have a table with the following fields:

    Logonum Numeric 3 0
    Description Character 20 0
    Jpeg JPeg Image 10 0
    Filename Character 200 0
    After the user enters the filename I would like the JPG field to be automatically filled with the .jpg file that corresponds to that file.

    I cannot find any XBASIC that can do this. Currently the user must enter the filename, then go to the JPEG field and select the same file that they just entered in the filename field... less elegant than I like :-(

    How can I automatically have the JPEG image loaded from the 'filename'.jpg file specified in the filename field?

  2. #2
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,269

    Default Re: How to display a .jpg file in a JPG image field

    A bit late, but there are 2 ways I do this,
    1 where the jpg name matches a value on the form. When the form is opened, if there is a corresponding file, it will be displayed.
    2 where the jpg file name is saved in a table. That requires selecting the jpg first though.

    In either event some business rules need to be in place to ensure that the jpg is there and named correctly for 1 above.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  3. #3
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    655

    Default Re: How to display a .jpg file in a JPG image field

    Thanks Ted...
    I am doing both of these... They are WHAT I am doing... but I am trying to discover HOW to do the following:
    The .JPEG field on the form REQUIRES the user to enter a filename... but the field named 'filename' already contains the filename of the .jpg that I want to display in the JPEG field. I want to have the JPEG field automatically display the file specified in the filename field. This will avoid having the user enter the filename twice.

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,269

    Default Re: How to display a .jpg file in a JPG image field

    Then make the image field a default, where the image is from the value in the table field.
    The table field what creates is the default, or I may have misunderstood.
    If I have, please spell it out in more detail if you can.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  5. #5
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    655

    Default Re: How to display a .jpg file in a JPG image field

    Thanks Ted...
    I tried putting a field rule on the jpeg field so that it defaulted to the value in the filename field... is that what you meant by 'make the image field a default'... sadly.. it doesn't work :-(

  6. #6
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,269

    Default Re: How to display a .jpg file in a JPG image field

    Can you show us the actual code you put in the default section please?

    You probably need this or similar in the default value.

    TRIM(SUBSTR(A5_QUALIFY_FILENAME(LOOKUPC
    ("Your Drive Letter",
    The JPEG ID,
    "The field you store the JPeg link in",
    "Jpeg",
    "Jpegid")),
    1,50))

    A bit like this

    TRIM(SUBSTR(A5_QUALIFY_FILENAME(LOOKUPC("C",abc,"abc","jpegtable","abc")),1,50))

    It is a case of qualifying the jpeg filename and setting it as the default.
    You might want to test for the file actually being there.
    Last edited by Ted Giles; 01-03-2019 at 11:41 AM.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  7. #7
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    655

    Default Re: How to display a .jpg file in a JPG image field

    Quote Originally Posted by Ted Giles View Post
    Can you show us the actual code you put in the default section please?

    You probably need this or similar in the default value.

    TRIM(SUBSTR(A5_QUALIFY_FILENAME(LOOKUPC
    ("Your Drive Letter",
    The JPEG ID,
    "The field you store the JPeg link in",
    "Jpeg",
    "Jpegid")),
    1,50))

    A bit like this

    TRIM(SUBSTR(A5_QUALIFY_FILENAME(LOOKUPC("C",abc,"abc","jpegtable","abc")),1,50))

    It is a case of qualifying the jpeg filename and setting it as the default.
    You might want to test for the file actually being there.

  8. #8
    Member
    Real Name
    David Boomer
    Join Date
    Apr 2000
    Location
    Brampton Ontario, Canada
    Posts
    655

    Default Re: How to display a .jpg file in a JPG image field

    I have specified the field named FILENAME and also tried the TRIM(SUBSTR(A5_QUALIFY_FILENAME(LOOKUPC("C",Logonum,"filename","logospecs","Logonum")),1,50)) formula in the default for the field rule for the JPG fiels… neither works.

  9. #9
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,269

    Default Re: How to display a .jpg file in a JPG image field

    Then I have misunderstood the situation.
    The best I can come up with is an alias in a browse, but it requires the user to select the image in the first place and then give it an alias.
    I am unclear as to why you need to enter the image path as well as selecting an image to display.
    Selecting the image will enable the image path to be established should you need it.
    Changing the image will always take you back to the original folder and type.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  10. #10
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,158

    Default Re: How to display a .jpg file in a JPG image field

    I have been following this thread. Image presentations within my major application is very extensive using multiple different strategies. What I can't figure out is what the problem being encountered by David is about, at all! At this juncture a tiny sample database example that shows the issues you are experiencing David is needed, because it may be me, but I just don't get what the problem is.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  11. #11
    Member
    Real Name
    Rob Penney
    Join Date
    Aug 2002
    Location
    Christchurch, New Zealand
    Posts
    37

    Default Re: How to display a .jpg file in a JPG image field

    The solution I have used for displaying graphics like this is an image file reference field. Then with an onchange event of the filename the image file reference field contains a jpg file with the name specified by the filename field.

  12. #12
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,269

    Default Re: How to display a .jpg file in a JPG image field

    Thanks Rob.
    With an IRF, I have not found a way yet to populate the field without human intervention.
    I still need to try Finians suggestion and that is on tomorrows schedule.

    In an ideal world, the IRF would be populated automatically using the field default setting.
    I've tried encoding and decoding the jpg image file name and cannot get the syntax correct.

    My next option will be to create a table with a dummy record in it and link it into the set. Then maybe I can get the default to reference the image in the dummy field.

    The work around at present is to use JPEG fields.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  13. #13
    Member
    Real Name
    Rob Penney
    Join Date
    Aug 2002
    Location
    Christchurch, New Zealand
    Posts
    37

    Default Re: How to display a .jpg file in a JPG image field

    Below is a screenshot of the set image file reference field genie.

    The image filename syntax is: "H:\A5V11 Runtime\Shared path\Signatures\Sig "+rtrim(signed)+".JPG":
    John smith's signature would be stored in folder "H:\A5V11 Runtime\Shared path\Signatures"
    The signature JPG would be "Sig John Smith.jpg". and
    "Signed" is a character field in the table.
    "Sig1" is an image file reference field in the table
    "Sig1" is also the form object pointing to IFRF "Sig1"

    So I have a password protected action script that puts the name into the "Signed13" object (points to table field "Signed") and then the next action script sets the image file reference field "Sig1".

    It is important to note (took me a while to figure out) that the field must be an image file refrence field and the action script to set it is specific for an IFRF - you cannot use a set text or set value function like you can to set the name in a character field. This work pretty reliably, and has all been done with two lines of action scripts.

    Hope this is useful.


    Capture.JPG

  14. #14
    Member
    Real Name
    Rob Penney
    Join Date
    Aug 2002
    Location
    Christchurch, New Zealand
    Posts
    37

    Default Re: How to display a .jpg file in a JPG image field

    PS - I forgot to mention that I seemed to need an event to set the value. It can be an on-change from another field, or a specific "set image file name in linked image field" action script. But merely using a calculated value in the field is problematic it seems.

    Rob.

  15. #15
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,269

    Default Re: How to display a .jpg file in a JPG image field

    Thanks Rob, I will explore.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. How to display an image file in a dialog from a Image File Reference Field
    By cezar in forum Application Server Version 11 - Web/Browser Applications
    Replies: 22
    Last Post: 06-18-2013, 02:48 PM
  2. How to Display a blank of Null image for an Image field in a grid
    By cpgood in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 02-25-2013, 04:16 AM
  3. Calculation to display Image File Reference field form another table
    By Scott Kurimski in forum Alpha Five Version 10 - Desktop Applications
    Replies: 7
    Last Post: 06-29-2011, 12:41 PM
  4. Display image (jpg file) on a form?
    By jjfcpa in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 07-24-2009, 05:21 PM
  5. Cannot display computed “Image File Reference” in report
    By harrison4411 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 26
    Last Post: 04-20-2009, 11:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •