5 www.topazsystems.com Back to Top
Crystal Report Demo How-To Guide
The Code
1. The code below is run when you push the “Create Crystal Report” button and is used to
write the selected image to a Crystal Report. First it turns the tablet off and does not clear
the image. It then sets the appropriate dimensions using SigPlus and also allows for a time
and date stamp to be affixed to the signature. Next it creates a filename for the Bitmap,
writes the desired signature to that location, hides the Record menu, and brings up the
Crystal Report.
Private Sub cmdCrystalReport_Click()
Dim TextSize As String
Dim strPath As String
SigPlus1.TabletState = 0 'Make sure the tablet is off
cmdClear.Enabled = False
With SigPlus1
.ImageFileFormat = 1 'Sets the image type to be saved-JPG,BMP,TIF etc. (1 is a BMP)
.ImageXSize = 1500 'Sets the X resolution (in pixels)
.ImageYSize = 500 'Sets the Y resolution (in pixels)
.ImagePenWidth = 14 'Sets the width of ink for image
.ImageTimeStamp = False 'Set this to TRUE if you want automatic time/date stamping
If .ImageTimeStamp = True Then 'If you want the time/date stamp, then do this routine
TextSize = Int(.TabletLogicalYSize * 14) / 100 * 0.9 'Gets a good size for the text, if
displaying time/Date stamp
.ImageTimeStampSize = TextSize 'Sets the size of the Text
.AutoTimeStamp 'Performs time/Date stamping
End If
End With
SigPlus1.JustifyMode = 5 'This will zoom the signature to fit the control...otherwise, you may leave it to be
the size it was when signed
strPath = "C:\SignatureFolder\Signature" & datPrimaryRS.Recordset.Fields(10).Value & ".bmp"
'Builds the the full path, as well as file extension, naming the file by the PID field (primary key) of the db
SigPlus1.WriteImageFile (strPath) 'Writes the image; be sure to pass it the full path, as well as file
extension
strPath = ""
TopazRecords.Hide
CrystalReportForm.Show
End Sub
2. The code below loads the Crystal Report application and changes the cursor temporarily to
an hourglass while it is loading.
Dim Report As New CrystalReport1
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub