borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Crystal report evaluation)Next Topic (formula field in crystal report) New Topic New Poll Post Reply
AndreaVB Forum : Reporting tools : Display picture by using VB6, CR and MySQL
Poster Message
dchau
Level: Trainee

Registered: 22-07-2005
Posts: 1

icon Display picture by using VB6, CR and MySQL

hi all,

i'm using VB6, CR8.5 and MySql 4.0.18. what i'm trying to do is to display a BLOB field in mysql as an image in CR. I'm using active data (.ttx) to define the DB of CR. and passing a recordset to CR to display.

the image will be stored into db right before the report starts, and a recordset will retrieve the blob field again and pass it to the report.

please see my coding below,

SavePicture Picture1.Image, "c:\tempsign.bmp"
                
Set rsStore = New ADODB.Recordset

rsStore.Open "Select * from signature where 1=0", cn, adOpenKeyset, adLockOptimistic

'load pic file to stream
Set mstream = New ADODB.Stream
mstream.Type = adTypeBinary
mstream.Open
mstream.LoadFromFile "c:\tempsign.bmp"

rsStore.AddNew
rsStore.Fields("JobID").Value = m_lngJobNo
rsStore.Fields("Signature").Value = mstream.Read
rsStore.Update
rsStore.Close
mstream.Close
                
strSQL = "Select * from signature Where JobID = " & Val(m_lngJobNo)
rsSign.Open strSQL, cn, adOpenKeyset, adLockOptimistic

Report "\rptJobSignature.rpt", IIf(frmPrintDialog.m_strDest = "Printer", True, False), frmPrintDialog.cboPrinters.ListIndex, False, False, , rsSign


the report function is a function which will pass all the data to CR.

my problem is, the image has been displayed, but in corrupted appearance. i can see part of the image correctly, but not the complete one. (please refer to the attachments)

please help.

____________________________
Attached:
corrupted.zip 3 KB (Downloads: 2)

22-07-2005 at 02:32 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Reporting tools : Display picture by using VB6, CR and MySQL
Previous Topic (Crystal report evaluation)Next Topic (formula field in crystal report) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder