简体   繁体   中英

Get a Report within date range in C#

I want to get reports within a date range. I have two date time pickers and a view report button. In my sql data base i have a table which include some dates. i want to get reports between dates which in my two date time pickers.when user click the view report button user be able to get a report which include records within those two dates.

If you are using RDLC for reports. Add parameters in report using report menu. To pass parameters to rdlc :

ReportParameter p1 = new ReportParameter("FromDt",[date]);
ReportParameter p2 = new ReportParameter("ToDt",[date]);

this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[]{p1,p2}); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM