Alpha Video Training
Results 1 to 19 of 19

Thread: Printing photo from file on pdf report

  1. #1
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,594

    Default Printing photo from file on pdf report

    Maybe I'm overlooking the obvious....

    I have photos in jpg files on the server in a directory named "photos", and I can calculate the name of the photo file I want to print in a report as

    "c:\a5\a5webroot\photos\\"+idcode+".1.jpg"

    where idcode is a field in the grid. So far, so good.

    The problem is, I'm designing the report and can't figure out how to specify on the report to use that photo. It seems like the bitmap object in the report editor only allows a fixed name rather than a calculated name.

    How do I get a photo from a calculated name to appear on the report?

    Pat

  2. #2
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,537

    Default Re: Printing photo from file on pdf report

    I'd think you will have to reference it as an image reference file in a table.

  3. #3
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,594

    Default Re: Printing photo from file on pdf report

    Pete,

    Thanks. I put in an Image Reference File field and loaded the picture into it, but I still can't get the picture to print in the PDF.

    Has anyone been able to make this work? What's the trick?

    Pat

  4. #4
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,537

    Default Re: Printing photo from file on pdf report

    Pat - make certain you are using the latest release patch - it's only recently fixed issues with the image reference file settings.

    You need to ensure the image is located in a folder under the folder that contains the table that references it.

    Check the release notes in the patch for more explanation.

    Hope this helps.

    Peter

  5. #5
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default Re: Printing photo from file on pdf report

    Pat - did you get this to work? I can't either. Also tried using an HTML field in the report pointing to the full image URL, That didn't work either.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  6. #6
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,594

    Default Re: Printing photo from file on pdf report

    Steve,

    No, I haven't.

    To make it as difficult as possible, I'm trying to put the photo in a conditional object on the report so that, if the photo doesn't exist, it shows a square with "No Photo Available" in it.

    The "No Photo..." works fine, but not the photo itself.

    In my case, the photo exists in a sub-directory on the server, so I'm trying to access it though either the image file reference or a calculated field.

    Hmmmm. Maybe I can create a global variable and pass it to the report???

    Pat

  7. #7
    "Certified" Alphaholic NoeticCC's Avatar
    Real Name
    Andrea Gill
    Join Date
    Nov 2007
    Location
    Golcar, West Yorkshire, UK
    Posts
    2,069

    Default Re: Printing photo from file on pdf report

    What I had to do was to regularly update the field in the database, to either point at "No Image" or the right image, I could not get the calculated path to work yet...

    WatchDirectory is VERY useful for this, esp. when combined with cURL - you can either automate this when new images are added to a folder, or run something nightly to store the path for each item/product in the DB.

  8. #8
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,594

    Default Re: Printing photo from file on pdf report

    Thanks, I'll try that concept.

    Pat

  9. #9
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default Re: Printing photo from file on pdf report

    Andrea,

    Are you saying you got an Image Reference Field to properly embed an image in a PDF report running on the WAS (not local, but in the browser). I can't even if I manually enter the full path in the field.

    -------------------

    Also I note that the Image Refefence Field behaves differently on the WAS. If you open the table in a copy of Alpha on the server and compare the behaviour of an Image Reference Field in that and the Desktop, they act differently. For instance, the normal Edit dialog does not appear to the right of the field when the field has focus.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  10. #10
    Member Tommy Thompson's Avatar
    Real Name
    Tommy Thompson
    Join Date
    Apr 2000
    Location
    Tennessee (Macgregor 26S)
    Posts
    451

    Default Re: Printing photo from file on pdf report

    You guys ever get this working?
    Tommy Thompson
    Thompson Consulting Services
    Beautiful Kentucky Lake, Springville, TN 38256
    tommy@btthompson.com


  11. #11
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,537

    Default Re: Printing photo from file on pdf report

    There is a bug in V9 that has been fixed in V10, I don't know if it will be fixed in V9. But it will not work without being published (IT MUST BE PUBLISHED) in a folder called images in the same folder as the adb file resides, which kind of defeats the purpose of the file type. The fix in v10 does not require the image to be publshed.

    I understand your frustration with this. It was a mjor problem, if you cannot figure it, then you should request to become a beta program tester and start using V10.

  12. #12
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,594

    Default Re: Printing photo from file on pdf report

    Yes, I got it to work in Version 9. The photos are located in the data directory (not in the web root) and the key was to fully specify the path in the Image File reference field.

    Pat

  13. #13
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default Re: Printing photo from file on pdf report

    I don't know so, does the "Image File reference field" exist outside of Alpha? Does a similar field type exist in Sybase or MySQL, etc. required in order to use the image in a PDF report?
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  14. #14
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,537

    Default Re: Printing photo from file on pdf report

    It does not go in the webroot, sits in the folder where the adb file is. Folder called images, you can have subfolders. Just like the data it does not need to be published.

  15. #15
    Member Tommy Thompson's Avatar
    Real Name
    Tommy Thompson
    Join Date
    Apr 2000
    Location
    Tennessee (Macgregor 26S)
    Posts
    451

    Default Re: Printing photo from file on pdf report

    My understanding of a Image Reference File field is that it contains the path to the image file. Such as c:\data\images\tom.jpg. If this is the case, then why is this type of field (image) not available in the DataSubmitted (grid) fields in a Validate Event?

    Here is what I'm trying to do. I have an employee table that has an image reference file field that points to their signature (jpg).
    I got the bright idea of doing a lookup that got the image reference file field and then putting it in something like DataSubmitted.Employee_Signature. Employee_Signature is an IRF in the employee detail time table. Unfortunately, a field defined as an image doesn't seem to be available in the insert list.

    I guess I could do this with a table.change().

    Any other ideas?
    Tommy Thompson
    Thompson Consulting Services
    Beautiful Kentucky Lake, Springville, TN 38256
    tommy@btthompson.com


  16. #16
    Member Tommy Thompson's Avatar
    Real Name
    Tommy Thompson
    Join Date
    Apr 2000
    Location
    Tennessee (Macgregor 26S)
    Posts
    451

    Default Re: Printing photo from file on pdf report

    I managed to get this working. The lookup gets the signature path and updates the detail record image field. Therefore the correct signature is attached so that it can be printed on a form.

    Be glad to share if anyone is interested.
    Tommy Thompson
    Thompson Consulting Services
    Beautiful Kentucky Lake, Springville, TN 38256
    tommy@btthompson.com


  17. #17
    Member
    Real Name
    Tom Dietrich
    Join Date
    May 2009
    Location
    Pewaukee, WI
    Posts
    40

    Default Re: Printing photo from file on pdf report

    Tommy,

    I would be very interested. I've been trying to get a variable image in a report and all I get is the Image Reference Field Name to print. Thanks in advance.

  18. #18
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,537

    Default Re: Printing photo from file on pdf report

    Same - Peter

  19. #19
    Member Tommy Thompson's Avatar
    Real Name
    Tommy Thompson
    Join Date
    Apr 2000
    Location
    Tennessee (Macgregor 26S)
    Posts
    451

    Default Re: Printing photo from file on pdf report

    By golly, I got it to work!!

    The image reference fields are updating properly and the image is printing correctly on a pdf from the web. If any of you are still interested in how I did it just let me know.
    Tommy Thompson
    Thompson Consulting Services
    Beautiful Kentucky Lake, Springville, TN 38256
    tommy@btthompson.com


Similar Threads

  1. Result Stack Underflow Intermittant Error When Printing PDF Report
    By stevemreid in forum Application Server Version 8
    Replies: 24
    Last Post: 08-09-2007, 08:18 PM
  2. Report as pdf file
    By rleif in forum Alpha Five Version 7
    Replies: 3
    Last Post: 01-11-2006, 01:58 PM
  3. can't save report to pdf or html file
    By Ed Kohn in forum Alpha Five Version 5
    Replies: 3
    Last Post: 04-22-2004, 04:10 AM
  4. Can I send my own PDF file with Report Mailer?
    By John Speredelozzi in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-24-2003, 03:55 AM
  5. Printing to PDF file/Email
    By Jesse Sanders in forum Alpha Five Version 5
    Replies: 2
    Last Post: 08-23-2002, 08:33 AM

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
  •