Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Picture in data report

Status
Not open for further replies.

elibb

Programmer
Oct 22, 2001
335
MX
hi, im using a datareport to print some data i have in an access database, in one of the filels i save directory paths for different pictures. The datareport takes that fields as text, so i want to put an imgage control and make its picture the one thats on the path. ive tried this:

DataReport1.Sections("Sección1").Controls & _
Set .Item("image1").Picture = LoadPicture(.item & _("txtPic1").text)

txtpic1 is bounded to the picture field on the database, but i cannt make it work.

any ideas??

thank You very much.

Eli
 
ive been trying to do this for a while now, and u cant
i got a reply from MS and they said it is a limitation of the datareport
bu ti think u can load the picture into a temp file then display that

Hope that helps
 
can you tell me how to do that?
its driving me crazy...

thank you very much
Eli
 
This might work, I dont know if it does yet because i am yet to try it, but someone sent me this code.

Dim loStream As ADODB.Stream
Set loStream = New ADODB.Stream

loStream.Type = adTypeBinary
loStream.Open
loStream.Write loRecordset.Fields("ImageField").Value
loStream.SaveToFile App.Path & "\Test",
adSaveCreateOverWrite
Set Datareport1.Sections("Section3").Controls("Image1").Picture = LoadPicture(App.Path & "\Test")loStream.Close
Set loStream = Nothing

Hope it works!!!
 
ill try it and let you know, thank you very much.

Eli
 
Using the Data report in VB6 to produce my reports sometimes my reports print sometimes no. Also, when I send the report to the screen sometimes the report appears fine, other times I get a blank report. I have tried using an ADO recordset as the source and also the VB6 data environment as the source. What could be the problem? Should I use crystal reports instead of the Data Report Designer tool in VB6?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top