financeguy
Programmer
I am having trouble passing a date parameter to a web report using J#. Here are the details:
-Displaying a Crystal Report v9.0 on an ASP .NET Web Form using the Crystal Web Viewer
-data retrieved from a SLQ Server 2000 Stored Procedure using an OLE DB (ADO) data source
-Web Application is developed using J#
-Code:
System.DateTime dtVar;
dtVar = new System.DateTime(2003,1,03);
pdvStartDate = new CrystalDecisions.Shared.ParameterDiscreteValue();
pdvStartDate.set_Value(dtVar);
pvStartDate = new CrystalDecisions.Shared.ParameterValues();
pvStartDate.Add(pdvStartDate);
reportDocument1.get_DataDefinition().get_ParameterFields().get_Item("@iStartDate".ApplyCurrentValues(pvStartDate);
-The report does not display, I get the following error message instead:
[Exception: Exception of type System.Exception was thrown.]
CrystalDecisions.Web.ReportAgent.v(Boolean `)
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Page.ProcessRequestMain()
-if I comment out this code and set a default value in the report, the report displays successfully
Look forward to hearing about the simple fix I am missing!
-Displaying a Crystal Report v9.0 on an ASP .NET Web Form using the Crystal Web Viewer
-data retrieved from a SLQ Server 2000 Stored Procedure using an OLE DB (ADO) data source
-Web Application is developed using J#
-Code:
System.DateTime dtVar;
dtVar = new System.DateTime(2003,1,03);
pdvStartDate = new CrystalDecisions.Shared.ParameterDiscreteValue();
pdvStartDate.set_Value(dtVar);
pvStartDate = new CrystalDecisions.Shared.ParameterValues();
pvStartDate.Add(pdvStartDate);
reportDocument1.get_DataDefinition().get_ParameterFields().get_Item("@iStartDate".ApplyCurrentValues(pvStartDate);
-The report does not display, I get the following error message instead:
[Exception: Exception of type System.Exception was thrown.]
CrystalDecisions.Web.ReportAgent.v(Boolean `)
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Page.ProcessRequestMain()
-if I comment out this code and set a default value in the report, the report displays successfully
Look forward to hearing about the simple fix I am missing!