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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Crystal Report from VB 6

Status
Not open for further replies.

sk1

Programmer
Oct 10, 2001
44
US
I have created Crystal(version 8) report which takes in Parameter value. It prompts users to select one of the months from the list then it matches this month value to the date field and opens the report showing results for that month.
Now I would like to open this report from VB 6.

It opens the form with Crystal Viewer and brings up the prompt that I created in Crystal report. But after that it gives me error of "Server Has not been open Yet"...What am I doing wrong. I have tried every thing possible I can think of. Please help me.

Here is my code..(in VB)

Public Function PrintInhouseCheckRegister() As Boolean
On Error GoTo Err_PrintInhouseCheckRegister
Dim CRApp As New CRAXDRT.Application
Dim crReport As New CRAXDRT.Report
Dim CRViewer As New CRViewer
Dim rsLetter As New ADODB.Recordset
Dim rsdelete As New ADODB.Recordset
Dim strDelete As String


PrintInhouseCheckRegister = False

Set crReport = CRApp.OpenReport(sCheckRegister)
frmCrystalViewer.Caption = "Check Register"
frmCrystalViewer.CRViewer.ReportSource = crReport
frmCreateInhouseCheck.Hide
frmCrystalViewer.Show
frmCrystalViewer.CRViewer.ViewReport
PrintInhouseCheckRegister = True


Exit_PrintInhouseCheckRegister:
Exit Function

Err_PrintInhouseCheckRegister:
MsgBox Error$ & Err
Resume Exit_PrintInhouseCheckRegister
End Function
 
If you are planning on passign a recordset you will need to use a command like SetPrivateDate to actually pass the recordset to the report. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top