Click to See Complete Forum and Search --> : The only code I have on form is ...


sweetie
May 10th, 2006, 02:24 PM
Hi,

I have one command "cmdprint" on a form and "CrystalActiveXReportViewer1" and "Report1.rpt". I have written the code like below:

Private Sub CrystalActiveXReportViewer1_CloseButtonClicked(UseDefault As Boolean)
Cr.ReportFileName = "Report1.rpt"
Cr.Action = 1
End Sub
Private Sub cmdprint_click()
Cr.ReportFileName = App.Path & "Report1.rpt"
Cr.DiscardSavedData = True
Cr.Action = 1
Cr.PageZoom (85)

End Sub

When I try to click on cmdprint button ...It shows error : "Object required" and points to the followine line:
"Cr.ReportFileName = App.Path & "Report1.rpt"

I am using crystal reports XI

Please help.

sraheem
May 11th, 2006, 05:04 AM
use cr.reportsource instead of reportfilename

sweetie
May 11th, 2006, 05:21 AM
use cr.reportsource instead of reportfilename

Hi,

The same error pops up. As I have told you there is no other code in my project except which I have posted in earlier post.

Sweetie.

thg
May 13th, 2006, 06:50 PM
Hi,

The same error pops up. As I have told you there is no other code in my project except which I have posted in earlier post.

Sweetie.

Sweetie,

sraheem was right,
change "Cr.ReportFileName = ...."
to "Cr.reportsource = ..."