Workflow Soluiton

 View Only
  • 1.  Display image from SQL Database in a webform

    Posted May 20, 2013 12:26 PM

    I am working on an employee information look-up workflow.  I have a SQL table with all of an employee's information including a picture.  I need help figuring out how to display that picture in a web form.  I have the picture as a variable.



  • 2.  RE: Display image from SQL Database in a webform
    Best Answer

    Posted May 20, 2013 02:42 PM

    Assuming you have the picture data as a byte array (Byte[]) on the stream, try the following:

    1. Use Add New Data Element to put a FileDataType on the stream.

    2. Map the picture data byte array into the FileDataType you added using a Single Value Mapping

    3. Add an image to your form. Specify File as the source and then specify the FileDataType variable.

    Unsure if this will work, but it's worth a try



  • 3.  RE: Display image from SQL Database in a webform

    Posted May 20, 2013 02:50 PM

    Didn't really get all that to work.  Maybe I just did it wrong. Here is what I have the best way I can explain it. 

    Sql table with user's information including first, last name, email address, badge#, BLOB of their picture and so on.  Form the first form you select to search by Badge#.  It takes that number throught a custom component that I wrote and brings back all other information attached to that Badge# including a variable called EmpPicture[First] which should be the picture and is what I am wanting to display.



  • 4.  RE: Display image from SQL Database in a webform

    Posted May 21, 2013 09:38 AM

    For sheer curiousity, I gave this a shot, but I wasn't able to get it functional. When I brought back the stream from the db table, it appeared that all was well, but it wouldn't display after mapping to a filedatatype. Oddly enough, if I wrote the file to the hard drive, the file was normal and opened just fine; it just refused to display in the web form.

    I don't need this to work, but darn I'd like to see it work just for fun.



  • 5.  RE: Display image from SQL Database in a webform

    Posted May 21, 2013 09:51 AM

    Just to expand on what reecardo was saying, I've attached some screen shots of what I think he was driving at. What you've done is great, so now you need to add a new data element of type "filedatatype" and a single value mapping component like this after your created sql component:

    Screen Shot 2013-05-21 at 7.41.13 AM.png

     

    Your single value mapping should look like so:

    Screen Shot 2013-05-21 at 7.40.13 AM.png

     

    Keep in mind that I probably put different column names there as I just whipped something together. Finally, on your form builder component, drop in an image component and configure like so:

    Screen Shot 2013-05-21 at 7.42.57 AM.png

     

    Make sense now? Of course, all this said, I couldn't get this to display the image (see comment above).



  • 6.  RE: Display image from SQL Database in a webform

    Posted May 21, 2013 02:42 PM

    Thank both of you for the explainations and giving it a try.  I also gave it another try, but couldn't get it to display.



  • 7.  RE: Display image from SQL Database in a webform

    Posted May 21, 2013 02:59 PM

    I did get it to work after all.  I was using the wrong File Data:.

     

    Thanks a bunch!!!!



  • 8.  RE: Display image from SQL Database in a webform

    Posted May 21, 2013 04:03 PM

    Awesome! I still can't mine to load the image, so I have to ask, what's the gotcha that you missed the first time round? I'm guessing I'm missing it, too...



  • 9.  RE: Display image from SQL Database in a webform

    Posted May 22, 2013 02:08 PM

    Mine will not show until I'm in debug first of all.  Second when I put the Data Type in for the image I choose the wrong one.  Once I did that everything worked just as y'all had described it.