954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Runtime error :20525 unable to load the report

any problem here with the code coz am getting the error as unable to load the report

error no:20525

and it shows the property read only

can u clear it plzzzz

CrystalReport1.ReportFileName = App.Path + "\REPORTS\Nature_Of_Complaint.rpt"
CrystalReport1.ParameterFields(0) = "natureofcomplaint;" & cmbReport.Text & ";true"
CrystalReport1.ParameterFields(1) = "fromdate;" & dtpFrom.Value & ";true"
CrystalReport1.ParameterFields(2) = "todate;" & dtpTo.Value & ";true"
CrystalReport1.Action = 1

anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
 

Hi,

What is the back end DB...? If SQLServer/Oracle, then u have to pass connection string...

REgards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

try crystalreport1.sqlquery instead of CrystalReport1.ParameterFields,
it can query the report in one line just like an ordinary sql statement in vb.
hope this helps.......

ryan_vietnow
Posting Pro
578 posts since Aug 2007
Reputation Points: 28
Solved Threads: 71
 

no guys

i think this is cause by the version

when i connect cr7 its working

but with cr9 i cant connect

but i have to check the connection string

am using sql server

can u write a connection string for me

anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
 

Hi,

Working with CR9 is quite different, It is and RDC compared to lower versions which are "OCX". u need to use CR Viewer, Place the CR Viewer on the Form and use this code:

Dim m_Report As CRAXDDRT.Report
Dim m_Application As New CRAXDDRT.Application
Set m_Report = Nothing
Set m_Report = m_Application.OpenReport(App.Path & "\MyRep.rpt", 1)
With CRViewer1
    .EnableExportButton = True
    .EnablePrintButton = True
    .EnableCloseButton = True
    .ReportSource = m_Report
    .Height = Me.ScaleHeight - 1000
    .Width = Me.ScaleWidth
    .Left=200
    .Top =200
    .ViewReport
End With


Regards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

thank you very much veena its workng fine

and i have one prob with passing the parameters

hw can i? codes........

and another one thing

why we cant open the report in a seperate window. do u hav any code for that

anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
 

i was totally confused

hw can i write the connection string

hw to pass the parameter

anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
 

Hi,

You cannot show it as a Seperate Window as our prev Versions, Instead U can add one More Form and a Viewer, and Call to show that form here, It would Look like a Seperate Window..

To pass Parameter:

m_Report.ParameterFields.Item(1).AddCurrentValue "MyParameter"


To Change Connection :

dim dCon As CRAXDRT.ConnectionProperties
Set dCon =m_Report.Database.Tables.Item(1).ConnectionProperties
dCon("DSN") ="MyDSNName"
dCon("Database") ="MyDBName"
dCon("User OD") ="MyUserID"
dCon("Password") ="MyPassword"


Pass these before viewing the report..

REgards
Veena

QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

thank u

solved

fine working

veenaaaaaaa

i wont forgot u

thanks

regards
anto

anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You