I used parameter fields in my crystal report and was able to pass parameters to it from my Visual Basic program. But the problem is the dialog box that keeps appearing asking me to enter the parameters. The discrete values have the same values as the parameters being passed. I do not want to enter the values again. How do I remove the dialog box?
My code:
Code:
Dim CRApp As New CRAXDRT.Application
Dim CRReport As New CRAXDRT.Report 'crystal report object
Dim CrtParameters As CRAXDRT.ParameterFieldDefinitions
Dim sRPTFile As String
Dim simula As String
Dim tapos As String
sRPTFile = App.Path & "\01653.rpt"
Set CRReport = CRApp.OpenReport(sRPTFile)
simula = Format(DTPicker1.Value, "YYYY/MM/DD")
tapos = Format(DTPicker2.Value, "YYYY/MM/DD")
With CRReport
.DiscardSavedData
.Database.Tables.Item(1).SetLogOnInfo odbcname, odbcname,sysuserid, syspassword
Set CrtParameters = CRReport.ParameterFields
.ParameterFields.GetItemByName("@begdate").AddDefaultValue simula
.ParameterFields.GetItemByName("@enddate").AddDefaultValue tapos
End With
'Show Report
CRViewer1.ReportSource = CRReport
CRViewer1.EnableExportButton = True
CRViewer1.DisplayGroupTree = False
CRViewer1.EnableDrillDown = True
CRViewer1.EnableDrillDown = False
CRViewer1.EnableCloseButton = True
CRViewer1.ViewReport
CRViewer1.Zoom (100)
CRViewer1.Visible = True
CRViewer1.ZOrder 0
Thanks in advance for helping.