Passing beginning date and final date as parameter through the following code
as no parameter field is using in report,
how to display the date range in text or field object?
what is the formula to do this?
ReportDocument objRpt = new ReportDocument();
string reportPath = Server.MapPath("Daily_CrystalReport.rpt");
objRpt.Load(reportPath);
objRpt.SetDataSource(ds.Tables[0]);
CrystalReportViewer1.ReportSource = objRpt;
CrystalReportViewer1.RefreshReport();
If you don’t want to pass the start and date end via parameters then you will have to return the values to the report via the dataset.
EDIT:
You will need to add the parameters to the Crystal Report via the Design View.
Give them appropriate names e.g.
@StartDate&@EndDateThen in your code
EDIT 2:
You can also add values dynamically to the Crystal Report. Add two textboxes on to your Crystal Report and assign them names.
Then in your code you can do something like this: