WELL WELL WELL IT'S VERY STRANGE WHEN I AM PASSING ONLY SINGLE PARAMTER LIKE CustomerName CRYSTAL REPORT IS LOADED PERFECTLY BUT WHEN IAM PASSING MORE THEN ONE PARAMETER THEN THERE IS MESSAGE COMES ENTER PARAMETER VALUES WHEN CRYSTAL REPORT IS LOADED PLZZZZZZZZZZZZZZZZZZZZZZZ HELP ME OUT I TRIED ALOT BUT IT'S NOT WORKING I HAVE SEARCHED CODE IN GOOGLE BUT STILL THE SAME RESULT
Private Sub FrmReportBill_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim rpt As New RptBill
Dim param1Fileds As New CrystalDecisions.Shared.ParameterFields
Dim param1Field As New CrystalDecisions.Shared.ParameterField
Dim param1Range As New CrystalDecisions.Shared.ParameterDiscreteValue
param1Field.ParameterFieldName = "CustomerName" ' Parameter Name In Crystal Report
param1Range.Value = FrmBillEntry.custName ' value For Parameter Field
param1Field.CurrentValues.Add(param1Range)
param1Fileds.Add(param1Field) ' To add parameter in parameterslist
CrystalReportViewer1.ParameterFieldInfo = param1Fileds 'to pass parameter inf.to CRV
'AS UPTO THIS ABOVE CODE WORKS FINE FOR ONLY SINGLE PARAMETER
'WHEN IAM PASSING AN OTHER PARAMETER LIKE WaiterName FOR CODE GIVEN BELOW I MEAN WHEN I REMOVE THE COMMENTS OF BELOW CODE THERE IS MESSAGE FOR ENTER PARAMETER VALUE
Dim param2Fileds As New CrystalDecisions.Shared.ParameterFields
Dim param2Field As New CrystalDecisions.Shared.ParameterField
Dim param2Range As New CrystalDecisions.Shared.ParameterDiscreteValue
param2Field.ParameterFieldName = "WaiterName" ' Parameter Name In Crystal Report
param2Range.Value = FrmBillEntry.waiterName ' value For Parameter Field
param2Field.CurrentValues.Add(param2Range)
param2Fileds.Add(param2Field) ' To add parameter in parameterslist
CrystalReportViewer1.ParameterFieldInfo = param2Fileds 'to pass parameter inf.to CRV
rpt.Refresh()
rpt.SetDataSource(FrmBillEntry.dtBill)
CrystalReportViewer1.Refresh()
CrystalReportViewer1.ReportSource = rpt
' Dim objRpt As New RptBill
'CrystalReportViewer1.Refresh()
'CrystalReportViewer1.ReportSource = objRpt
'CrystalReportViewer1.SelectionFormula = "{tblBill.Receipt}=" & FrmBillEntry.ReceiptNoSrch
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub