If Not IsPostBack Then Dim pathandname As String Dim ReportName As String Dim DiskOpts As CrystalDecisions.Shared.DiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions '' ReportName = Replace(Rptname, ".rpt", ".pdf") ReportName = Request.QueryString("rpt").ToString() 'ReportName = Replace(Rptname, ".rpt", ".pdf") pathandname = Server.MapPath("Reports/" & ReportName) Dim RptDocument As New ReportDocument Dim paramValues As New Hashtable RptDocument.Load(pathandname) paramValues = DirectCast(Session("Hashtable"), Hashtable) Dim keyCollection As ICollection = paramValues.Keys() Dim enumerator As IEnumerator = keyCollection.GetEnumerator While enumerator.MoveNext Dim param As New CrystalDecisions.Shared.ParameterField Dim paramValue As New CrystalDecisions.Shared.ParameterDiscreteValue Dim paramValTyp As New CrystalDecisions.Shared.ParameterType param.ParameterFieldName = CType(enumerator.Current, String) paramValue.Value = paramValues.Item(CType(enumerator.Current, String)) param.CurrentValues.Add(paramValue) RptDocument.DataDefinition.ParameterFields(CType(enumerator.Current, String)).ApplyCurrentValues(param.CurrentValues) RptDocument.SetParameterValue(param.ParameterFieldName, paramValue.Value) End While ApplyConnectionInfo(RptDocument) CrystalReportViewer1.ReportSource = RptDocument CrystalReportViewer1.RefreshReport() End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)