We are using Microsoft.Reporting.WebForms reportparameter[] class to send parameters to report viewer as in the code below .Here the RDL files is expecting datatype as Boolean\Date etc.
Since the ReportParameter.ReportParameter accepts only string values while rendering I am getting System.InvalidCastException.What is the workaround for this issue
ReportParameter[] repParams = new ReportParameter[2]; if (Session["rptCurrentPage"].ToString() == "1") { repParams[0] = new ReportParameter("param_ParentRecordKey", Session["ID"].ToString()); repParams[1] = new ReportParameter("param_UserID", SessionHelper.UserProfile.ApplicationUserId.ToString()); } else { repParams[0] = new ReportParameter("param_SubsidiaryAccountRecordSystemKey", Session["ID"].ToString()); repParams[1] = new ReportParameter("param_UserID", SessionHelper.UserProfile.ApplicationUserId.ToString()); } ReportViewer1.ServerReport.SetParameters(repParams); ReportViewer1.ServerReport.Refresh();</div>