1 Replies - 4663 Views - Last Post: 07 November 2009 - 09:15 AM Rate Topic: -----

#1 oohrah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 08-August 09

Pass image to Crystal reports

Post icon  Posted 04 November 2009 - 11:36 PM

Being a beginner with Crystal, I have been very unsuccessful in finding an answer to this. But first off I am using vb.net 2008 with crystal 2008. I need to pass an image through a parameter at open of the report. If anyone knows of a good tutorial that breaks it down for a layman it would be great or how ever anyone can assist me in this matter. Thank you so much in advance
Is This A Good Question/Topic? 0
  • +

Replies To: Pass image to Crystal reports

#2 oohrah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 08-August 09

Re: Pass image to Crystal reports

Posted 07 November 2009 - 09:15 AM

Figured it out......Sorta

I abandoned the parameter passing and has to create a dataset with a field set to System.Byte(). I had to convert the image to byte

		 
				Dim fs As System.IO.FileStream = Nothing
				fs = New System.IO.FileStream([PATH TO YOUR IMAGE], IO.FileMode.Open)
				Dim fi As System.IO.FileInfo = New System.IO.FileInfo([PATH TO  YOUR IMAGE])
				Dim temp As Long = fi.Length
				Dim lung As Integer = Convert.ToInt32(temp)

				Dim propimg As Byte() = New Byte(lung - 1) {}
				fs.Read(propimg, 0, lung)
				fs.Close()

				newAccountDataRow.Picture = propimg



Now all I need is to figure out how to maintain the aspect ratio as my image is the size of the picture box on the report. As good as CR is they need to rethink some things for sure.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1