Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing date parameter from J# to Crystal 9 report

Status
Not open for further replies.

financeguy

Programmer
Jan 3, 2003
2
US
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top