Discussion Locked

Crystal Report Writer Version 4.6

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How to Question:
I am tryinh to print reports from Visual Basic 6.0 Enterprise edition using the Crystal Report Writer shipped with it. I am not sure what is causing the problem. What I want it to do is preview the report before printing by setting the option:
CrystalReport1.ReportFileName = "ReportIWantToRun"
CrystalReport1.Action = 1

3 replies

by vinnyd

It looks like you are missing the Report1.Destination.

Here is a sample of the code that I use.

Report1 = CrystalReport1 for your code.
OutputList is a form field that I have. You can just code 0 = Window (preview)

Report1.Destination= 0 ' Preview to screen.

If OutputList.Text = "Window" Then
OutputDestination = 0
Else
If OutputList.Text = "Printer" Then
OutputDestination = 1
Report1.CopiesToPrinter = Number_Of_Copies
Else
If OutputList.Text = "File" Then
OutputDestination = 2
Report1.PrintFileName = Output_File_Name
Report1.PrintFileType = Output_File_Type
End If
End If
End If
Report1.Destination = OutputDestination

This discussion is closed to new replies.