Reputation: 651
Is there a possibility of changing how the SSRS DateTime parameters are displayed on the report, i have a parameter with a date/time data type, when the report run, users see a date format that included time in it , users don't want to see time in the parameters, it should only be a date like <2/6/2010>, is there a way to do this in SSRS
Thanks in advance
Upvotes: 1
Views: 6325
Reputation: 651
On Embedding SSRS report on a .NET web form, using Report Viewer control, and pre-populating the date parameter with values, from code. The parameters after that will keep the same format as the date you provided them with from code.
so i was populating my parameter from C# like this
var startDate = DateTime.Now;
var parameters = new List<ReportParameter>
{ new ReportParameter("START_DATE", startDate.ToString())};
ConsumptionReportViewer.ServerReport.SetParameters(parameters);
this gave the START_DATE paremeter with dates of this format "3/9/2008 4:05:07 PM" and later changing the dates from the calender input, the format remains the same
i changed the format on the code to
new ReportParameter("START_DATE", String.Format("{0:d}",startDate)
this gives the START_DATE paremeter wiht dates of this format "3/9/2008" and now when i change the datees from the calender input, the format remains the same
Upvotes: 1