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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Parameter with ReportViewer

Status
Not open for further replies.

JSMITH242B

Programmer
Mar 7, 2003
352
GB
Hi All,

I have the following code which works using the ReportViewer component. However how do I pass in the current date i.e Now?

When I use DateTime.Today.ToString I get the following error: The value provided for the report parameter 'SnapshotDate' is not valid for its type. SnapshoteDate is defined as DateTime.


If Not IsPostBack Then
ReportViewer1.ServerUrl = " ReportViewer1.ReportPath = "%2fCorVuReports/LAA/Pie&SnapshotDate=06/01/2004"
ReportViewer1.Toolbar = Microsoft.Samples.ReportingServices.ReportViewer.multiState.False
ReportViewer1.Zoom = "75"

End If
 
I don't know how to do it the VB way. I just know the GetDate() function from T-SQL. Have you tried passing in the date via the SQL Server?



Catadmin - MCDBA, MCSA
"The only stupid question is the one that *wasn't* asked.
 
What did you do to resolve it?



Catadmin - MCDBA, MCSA
"The only stupid question is the one that *wasn't* asked.
 
something like

Dim CurrentDate as Date

CurrentDate = Now.Date.ToShortStringDate

ReportViewer1.ReportPath =
"%2fCorVuReports/LAA/Pie&SnapshotDate" + CurrentDate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top