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

Hi,

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

REgards
Veena

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.......

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

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

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

i was totally confused

hw can i write the connection string

hw to pass the parameter

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

thank u

solved

fine working

veenaaaaaaa

i wont forgot u

thanks

regards
anto

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.