Hi All,
I have a SQL/ODBC based CR Report that I run off a VB application by binding an ADO recordset to the report at runtime. I build the recordset by passing a pre-bilt SQl statement in VB. The first time I got it running it worked just fine but it won't work now. Could there be something wrong with my code? My CR report? Can anybody please help...
==============================
Here is a part of my code:
Handle = PEOpenEngine
If Handle <> 0 Then
'Print engine is opened
Else
ErrorNum = PEGetErrorCode(Handle)
MsgBox "Error in opening Crystal Report print engine.", vbInformation
GoTo ExitPoint
End If
'Open print job
job = PEOpenPrintJob(strPath & "FollowUp2.rpt"
If job <> 0 Then
Else
ErrorNum = PEGetErrorCode(job)
MsgBox "Error opening print job.", vbInformation
GoTo ExitPoint
End If
'Set record source to rstInfo
Handle = SetActiveDataSource(job, 0, rstInfo)
'Create a field definition file and check if creation was successful
Handle = CreateFieldDefFile(rstInfo, strPath & "ado.ttx", True)
'Send report output in a window
Handle = PEOutputToWindow(job, "FollowUp2.rpt", 0, 0, 520, 520, 0, 0)
'Start Print Job
If Handle <> 0 Then
Handle = PEStartPrintJob(job, True)
Else
MsgBox "Error starting print job.", vbInformation
GoTo ExitPoint
End If
=========================
Environment:
Crystal Reports Ver. 6
Windows NT
Oracle Ver. 7...
ODBC Connection
Using Print Engine API Calls
Please let me know if you need more details.
Thanks,
Erick
I have a SQL/ODBC based CR Report that I run off a VB application by binding an ADO recordset to the report at runtime. I build the recordset by passing a pre-bilt SQl statement in VB. The first time I got it running it worked just fine but it won't work now. Could there be something wrong with my code? My CR report? Can anybody please help...
==============================
Here is a part of my code:
Handle = PEOpenEngine
If Handle <> 0 Then
'Print engine is opened
Else
ErrorNum = PEGetErrorCode(Handle)
MsgBox "Error in opening Crystal Report print engine.", vbInformation
GoTo ExitPoint
End If
'Open print job
job = PEOpenPrintJob(strPath & "FollowUp2.rpt"
If job <> 0 Then
Else
ErrorNum = PEGetErrorCode(job)
MsgBox "Error opening print job.", vbInformation
GoTo ExitPoint
End If
'Set record source to rstInfo
Handle = SetActiveDataSource(job, 0, rstInfo)
'Create a field definition file and check if creation was successful
Handle = CreateFieldDefFile(rstInfo, strPath & "ado.ttx", True)
'Send report output in a window
Handle = PEOutputToWindow(job, "FollowUp2.rpt", 0, 0, 520, 520, 0, 0)
'Start Print Job
If Handle <> 0 Then
Handle = PEStartPrintJob(job, True)
Else
MsgBox "Error starting print job.", vbInformation
GoTo ExitPoint
End If
=========================
Environment:
Crystal Reports Ver. 6
Windows NT
Oracle Ver. 7...
ODBC Connection
Using Print Engine API Calls
Please let me know if you need more details.
Thanks,
Erick