Hi,
I've been googling and reading up on this for the past 3 days. I'm completely new to vb and crystal... Got this assignment because no one else knew vb. What I'm trying to do is this : In my database i have character strings, since bmps are too large to store in my situation. I need to create an ocx in vb wich reacts to the section format event from crystal. Somehow I need to get from this event the location in the database where my image sits. After i render the image through vb i then need to get this bmp filename back to crystal so he can display the image. This will all be occuring at run time -- sorry if the question is simple... like i said i've got about 3 days self training in this matter. Here is what i have pieced together so far, with some help from crystal examples:
Dim Appl As New CRAXDRT.Application
Dim Report As CRAXDRT.Report
Dim WithEvents CrSecPH As CRAXDRT.Section 'dim with events so we can access the format event
Dim CrSecs As CRAXDRT.Sections
'Public Pic1 As CRAXDRT.OLEObject 'Dim an object for the ole pictures so we can change the pic
Public success As Long
Public sigdisp As New ENFORMSIGDISPLAYLib.ENFormSigDisplay
Private Sub CrSecPH_Format(ByVal pFormattingInfo As Object) 'catches event from crystal... i think
'For now I am using a hard coded bmp character string for testing, this value needs to be taken from db.
'setoposbcnibblesignaturedata takes my character string and turns him into a bmp.
sigdisp.SetOPOSBCNIBBLESignatureData ("'????????14002701280013014<00??006800>;007<00=?007000>;005400070130002;0114004?0100006301040077011800'"
'Writes the signature data to a file
success = sigdisp.WriteSignatureToFile("C:\BMPTEST.BMP", 1, 38 * 8, 9 * 8, True)
End Sub
Private Sub Form_Load()
Set Report = Appl.OpenReport(App.Path & "\pic.rpt", 1) 'opens the rpt.
Set CrSecPH = Report.Sections("PH" ' set this section object to the page header
For i = 1 To CrSecPH.ReportObjects.Count 'Loop through the report objects and see if they are pictures
If CrSecPH.ReportObjects(i).Kind = CRAXDRT.CRObjectKind.crOleObject Then ' if it is a CrOleObject then
'Set Pic1 = CrSecPH.ReportObjects(i) 'Set the pic1 object to the Ole Report object
'Seems like in here somewhere i need to find out what the name of the
'event is so that i can find the database field from that name.
End If
'set pic1 = crsecph.ReportObjects(i).
Next i
End Sub
As you can see any help would be appreciated. Thanks in Advance.
rock
I've been googling and reading up on this for the past 3 days. I'm completely new to vb and crystal... Got this assignment because no one else knew vb. What I'm trying to do is this : In my database i have character strings, since bmps are too large to store in my situation. I need to create an ocx in vb wich reacts to the section format event from crystal. Somehow I need to get from this event the location in the database where my image sits. After i render the image through vb i then need to get this bmp filename back to crystal so he can display the image. This will all be occuring at run time -- sorry if the question is simple... like i said i've got about 3 days self training in this matter. Here is what i have pieced together so far, with some help from crystal examples:
Dim Appl As New CRAXDRT.Application
Dim Report As CRAXDRT.Report
Dim WithEvents CrSecPH As CRAXDRT.Section 'dim with events so we can access the format event
Dim CrSecs As CRAXDRT.Sections
'Public Pic1 As CRAXDRT.OLEObject 'Dim an object for the ole pictures so we can change the pic
Public success As Long
Public sigdisp As New ENFORMSIGDISPLAYLib.ENFormSigDisplay
Private Sub CrSecPH_Format(ByVal pFormattingInfo As Object) 'catches event from crystal... i think
'For now I am using a hard coded bmp character string for testing, this value needs to be taken from db.
'setoposbcnibblesignaturedata takes my character string and turns him into a bmp.
sigdisp.SetOPOSBCNIBBLESignatureData ("'????????14002701280013014<00??006800>;007<00=?007000>;005400070130002;0114004?0100006301040077011800'"
'Writes the signature data to a file
success = sigdisp.WriteSignatureToFile("C:\BMPTEST.BMP", 1, 38 * 8, 9 * 8, True)
End Sub
Private Sub Form_Load()
Set Report = Appl.OpenReport(App.Path & "\pic.rpt", 1) 'opens the rpt.
Set CrSecPH = Report.Sections("PH" ' set this section object to the page header
For i = 1 To CrSecPH.ReportObjects.Count 'Loop through the report objects and see if they are pictures
If CrSecPH.ReportObjects(i).Kind = CRAXDRT.CRObjectKind.crOleObject Then ' if it is a CrOleObject then
'Set Pic1 = CrSecPH.ReportObjects(i) 'Set the pic1 object to the Ole Report object
'Seems like in here somewhere i need to find out what the name of the
'event is so that i can find the database field from that name.
End If
'set pic1 = crsecph.ReportObjects(i).
Next i
End Sub
As you can see any help would be appreciated. Thanks in Advance.
rock