Alpha DevCon 2018
Results 1 to 12 of 12

Thread: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

  1. #1
    Member
    Real Name
    Scott Moore
    Join Date
    Oct 2010
    Posts
    238

    Default How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    Hi All,

    It took me a long time to figure this out, there may be an answer on the forum already but I couldn't find it, so I thought I would post my solution.

    Basically, the user has uploaded an image and I have stored it in a Blob field in a MYSQL database (not on the alpha file server or anything like that). Now I have created a report and want to show that image on a PDF report....

    Here is how I did it.

    1) The image needs to be stored in a BLOB field in MYSQL database or something similar on other third party DB's.
    2) Include the blob field in the report SQL definition.
    3) On the report builder screen, go to the Tool box. Find the "Insert Static HTML Object" tool.
    4) Using the tool, draw the box where you want the image to appear. NOTE, the box must be large enough to show the image, so make sure it is large enough to show the images that are being uploaded. To make life easier maybe size the images when loaded.
    5) Once the box is created, there should be a little pencil like icon in the upper right corner of the box. Click it
    6) This will bring up the HTML text editor.
    7) Look for the "Fields" option at the top. Find your Blob field and drag it underneath the <body> tag. Alpha should generate some html that looks like this :{a5_HTML_extended_image_field_format("Image_Field_name","")}
    8) Thats it!

    I love doing it this way...my users images are all stored in the mysql database so I only have to worry about backing that up, if the alpha server crashes no big deal.

    Hope this helps someone :)

    Scott

  2. #2
    Member
    Real Name
    Scott Moore
    Join Date
    Oct 2010
    Posts
    238

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    One additional note, I found in some instances the published server version of the report (as opposed to preview) was shrinking the image to a few pixels, so switching the html code to this fixed the problem:

    {a5_HTML_extended_image_field_format("Image_Field_Name","style=\"width: 1in; height: 1in;\" title=\"My image\"")}

    The style sets the image dimensions, so you can modify the inches as appropriate. Even more reason to standardize the picture size when loading I guess.

    Cheers,

    Scott

  3. #3
    Member
    Real Name
    Oluotes
    Join Date
    Jun 2011
    Posts
    7

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    Thank you man for sharing your findings with us. Many thanks.

  4. #4
    Member
    Real Name
    Drew R.
    Join Date
    Feb 2011
    Location
    Northeast TX
    Posts
    60

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    FINALLY !! ....Thank you very much...you ended months of battling a report. Do you happen to know how to put the the image in a 'Conditional Object' and have that object not show if the image field is empty. I'm using a longblob field in a MySQL database to hold the images.

  5. #5
    Member brad.lindsay69@gmail.com's Avatar
    Real Name
    Brad Lindsay
    Join Date
    Jul 2011
    Location
    Auckland, NZ
    Posts
    73

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    thank you, thank you, thank you

  6. #6
    Member
    Real Name
    Gustavo
    Join Date
    Apr 2013
    Posts
    6

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    Thank you I was struggling with this too. Your post helps me a lot!!

  7. #7
    Member
    Real Name
    Blair Chan-Kent
    Join Date
    Jul 2013
    Location
    Vancouver, BC
    Posts
    23

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    Great thanks for the instructions. Definitely helped with displaying the signature capture once it was stored in my db.

  8. #8
    Member
    Real Name
    Dan K
    Join Date
    Dec 2010
    Posts
    81

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    Dude! Scott you are a star! Thank you very much for this info.

  9. #9
    Member
    Real Name
    Ivan Lozano
    Join Date
    Apr 2013
    Location
    Azusa, CA. LA County
    Posts
    395

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    AWESOME!!! This is great stuff bro, Just one question, how do I tell it to fill the entire field on the report? Is there an easy way to set it to "Best Fit"?

  10. #10
    Member
    Real Name
    Jonathan
    Join Date
    Apr 2010
    Posts
    107

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    Is there a way to insert a blob field (from a signature capture) directly into an email?

  11. #11
    Member
    Real Name
    Adrian Alexander
    Join Date
    Nov 2014
    Posts
    9

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    Anyone know how to include an image on a report from Amazon S3 please?

  12. #12
    "Certified" Alphaholic
    Real Name
    Jetson Lilibeth
    Join Date
    Dec 2011
    Posts
    1,031

    Default Re: How to add a Blob Image from a MYSQL Database to a PDF Report - so simple!!

    This works on a regular report but when it is converted to layout table report the image is not showing at all.

Similar Threads

  1. append/merge pdf stored as image reference to a pdf report in web application
    By lemandras in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 03-01-2011, 10:40 AM
  2. mySQL BLOB image in Grid kills row save
    By chopfner in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 01-07-2011, 05:47 PM
  3. display image blob in grid
    By Steve Wood in forum Application Server Version 10 - Web/Browser Applications
    Replies: 11
    Last Post: 10-25-2010, 04:47 PM
  4. how to view a PDF file (store as blob in sql)
    By Ken Tjia in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 10-07-2008, 06:13 PM
  5. Alpha5 can not create pdf report from MySQL connection
    By andi in forum Application Server Version 8
    Replies: 3
    Last Post: 07-29-2007, 03:34 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
  •