Hello,
I'm having trouble selecting records from VB code. My code so far is this:
Dim rap As ReportDocument = New ReportDocument
rap.RecordSelectionFormula = "year({@Order}) = 2004 and month({@Order}) = 3"
rap.Load(Replace(Application.StartupPath, "\bin", "") & "\reports.rpt")
CRViewer.ReportSource = rap
@order is a formula that i created in crystal reports. I also tried a normal database field but it still didn't work. It always says:
An unhandled exception of type 'CrystalDecisions.CrystalReports.Engine.LoadSaveReportException' occurred in crystaldecisions.crystalreports.engine.dll
Additional information: Invalid report file path.
I know the file path is correct! So I think the RecordSelectionFormula is wrong. I also tried to leave this selection and then it works, but then it gives the wrong information.
TIA
I'm having trouble selecting records from VB code. My code so far is this:
Dim rap As ReportDocument = New ReportDocument
rap.RecordSelectionFormula = "year({@Order}) = 2004 and month({@Order}) = 3"
rap.Load(Replace(Application.StartupPath, "\bin", "") & "\reports.rpt")
CRViewer.ReportSource = rap
@order is a formula that i created in crystal reports. I also tried a normal database field but it still didn't work. It always says:
An unhandled exception of type 'CrystalDecisions.CrystalReports.Engine.LoadSaveReportException' occurred in crystaldecisions.crystalreports.engine.dll
Additional information: Invalid report file path.
I know the file path is correct! So I think the RecordSelectionFormula is wrong. I also tried to leave this selection and then it works, but then it gives the wrong information.
TIA