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

sql designer in crystal report

Status
Not open for further replies.

oostar

Programmer
Aug 6, 2001
9
0
0
HK
HI,

I use a VB program to run the crystal report. Inside the report, there are 8 subreports with query generated at SQL designer. The the query file saved with data, the VB program has no problem, however, when the query file saved without the data, the VB program fails to run.
Anyone know how to solve this problem?

Thanks
 
If you save the report with data, then you're not running the report from VB. You're just opening the report. Therefore, you're not connecting to the database, executing the query, etc. So it could be a lot of things.

Are you using the OCX or the RDC technology?
 
Thanks for your reply.

I am a new user of crystal report. Is there any information for me to know more about OCX or RDC? I am not sure which i am using right now.
 
If you go into the VB toolbox and select the control called CrystalReport and drop it on a VB form, then you are using the OCX (you may have to add the control to the toolbox in the first place by going to the Project menu, selecting Components, and clicking on the Crystal Report Control enry).

If you are doing stuff like this, you are using the RDC technology:

Dim App as CRAXDRT.Application

 
Thanks for you reply.

someone give me a template and the vb program will pass 3 parameters to the crystal report to generate a new report.
below are some codes from the modules of the vb program

Set crReport = CreateObject("Crystal.CrystalReport")
crReport.Connect = sConnect

crReport.Destination = crptToFile
crReport.ReportFileName = App.Path & "\report1.rpt"
crReport.PrintFileName = App.Path & "\" & LETTER_DIRNAME & "\" & "report1_" & Format(Now, "yyyymmdd") & ".rpt "
crReport.PrintFileType = crptCrystal
lResult = crReport.PrintReport
If lResult = 0 Then
MsgBox "ok"
Else
MsgBox "Nothing"
End If

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top