picture box control question - InfoPath Dev
in

InfoPath Dev

picture box control question

Last post 08-08-2010 05:00 AM by imransulehri. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 08-05-2010 08:13 AM

    picture box control question

    Hello every one, I have webservice method that returns byte[] which is barcode image. I want to display this image on infopath. i am using picture box for this purpose. I dont know how to bind the byte[] to pciture box so that it displays the image??Urgent help needed in this regard Thanks Imran
  • 08-05-2010 08:46 AM In reply to

    Re: picture box control question

    Have you try to convert to byte [] to base64 and put it in your field ?

    http://www.exampledepot.com/egs/java.net/base64.html

  • 08-05-2010 08:53 AM In reply to

    Re: picture box control question

    I just check, you have to encode your field here a good exemple:

    http://www.bizsupportonline.net/blog/2010/04/top-10-questions-infopath-file-attachments/

  • 08-05-2010 09:00 AM In reply to

    Re: picture box control question

    hello potemkine thanks for prompt reply. Here what i tried byte[] ar = IPWS.Code39(barCode); String str = Convert.ToBase64String(ar); XPathNavigator root = MainDataSource.CreateNavigator(); root.SelectSingleNode("/my:myFields/my:field17", NamespaceManager).SetValue(str); Didnt work. The last example you gave me seems a complex one can u help how to use it. thanks imran
  • 08-05-2010 11:18 AM In reply to

    Re: picture box control question

    Hi, I try this I can make it work on an attachment file but not on a picture, I don't know why. You can do something a little different with a Rich text field. you save your file somewhere and you modify the inner xml of your RT field like that:

    <IMG xmlns=\"http://www.w3.org/1999/xhtml\" SRC=\"" + YOURPATH+ "\" />";

    It will show you the image

  • 08-06-2010 01:16 AM In reply to

    Re: picture box control question

    Hi,You tried your example link http://www.bizsupportonline.net/blog/2010/04/top-10-questions-infopath-file-attachments/ you gave me before and as you suggested in your last email saved the file locally and then change the InnerXml of richtextbox??? Can i insert the base64 converted string of byte[] as source of IMG element?? Can i use the .net Convert.TOBase64String method or have to convert as shown in example link you mentioned before?? Thanks Imran
  • 08-06-2010 03:02 AM In reply to

    Re: picture box control question

    Hi,I figured it out though saving file localy isnt good idea anyhow its working.I converted the byte[] to image saved it locally and set the InnerXml property of richtextbox. Dont set using set value instead InnerXml. It works.Thanks to Potenkime for this idea and support.Imran
  • 08-06-2010 04:57 AM In reply to

    Re: picture box control question

     You're welcome

  • 08-06-2010 05:29 AM In reply to

    Re: picture box control question

     I just think of it, If you save your picture locally it will work for the current user but not if a user try to open it from other location. Is it possible to save your file on a drive Share or on a sharepoint Document library?

  • 08-08-2010 05:00 AM In reply to

    Re: picture box control question

    Hi,infact i don't think it will be problem for every user acesses the form from server( I am not deploying my template to sharepoint document library). So on every user machine file is temporarily saved to e.g c:\temp and as form is closed i opted to delete the temp file. This was my idea but now i am thinking not to do this and i opting now to change the url of dataconnection as once template is deployed to customer i have to change the url of data connection.
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.