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

Method Action Of object 'CrystalCtrl'failed

Status
Not open for further replies.

bhargi

Programmer
Apr 8, 2002
25
US
Hi,
I am calling crystal reports 8.5 from access 2000 DB. Sometimes my crystal reports opens sometimes I don't see the reports and no error message and sometimes I get this error Method 'Action' of Object "CrystalRpt" failed / Application or object defined error. I reffered crystal web
site. Solution they gave me is open the crystal report adn click verify DB. Every time my application gets this error this method is not so feasible. Does any one had more better solution to this.

I am calling the report by specifying the path of the report using ADO Recordset method. I use the query to get the path from the table

(which as report name and path). and assign the value to a variable.

See below:
DIm m_rpt as crystalReport

Form_Load()
set m_rpt=new crystalreport
end sub

sub CmdGenerateRpt()

strRptFname="MonthlyRpt.Rpt"
'get the file path for that report(which is always 1 record)

strSQl = "Select FileLocation from tblfilepath where filename ='" & strRptFName & "'"
Set objRsFileName = objDb.GetRSFromSQL(strSQl)

If Not objRsFileName.EOF Then
strByMthRptPath = objRsFileName!FileLocation
End If

strRptFName = strByMthRptPath & strRptFName

objRsFileName.Close
Set objRsFileName = Nothing

With m_Rpt
.ReportFileName = strRptFname
.WindowState = crptMaximized
.ParameterFields(0) = "ProjectCode; " & StrProject & ";true"
.Action = 1
end with
error_handler,,,,,,
END SUB

Please help me out.

Regards
[wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top