c# - Reports neither getting displayed nor getting any error -
i trying display report windows application in vs 2015. on button click , have 2 datetimepicker controls selecting , dates.the problem don't encounter error when running application although selected , dates getting displayed in report not data.
below code
private void btnload_click(object sender, eventargs e) { mydatasettableadapters.getdatareporttableadapter ta = new mydatasettableadapters.getdatareporttableadapter(); mydataset.getdatareportdatatable dt = new mydataset.getdatareportdatatable(); ta.fill(dt); reportdatasource rds = new reportdatasource(); rds.name = "dataset1"; rds.value = dt; reportparameter rp1 = new reportparameter("fromdate", dtfromdate.value.date.toshortdatestring()); reportparameter rp2 = new reportparameter("todate", dttodate.value.date.toshortdatestring()); reportviewer1.localreport.datasources.clear(); reportviewer1.localreport.reportpath = "report.rdlc"; reportviewer1.localreport.setparameters(rp1); reportviewer1.localreport.setparameters(rp2); reportviewer1.localreport.datasources.add(rds); reportviewer1.localreport.refresh(); reportviewer1.refreshreport(); }
please help.
i resolved issue creating new stored procedure , accessing data it.
ta.fill(dt,dtfromdate.value.toshortdatestring(),dttodate.value.toshortdatestring());
this changes should done while autobinding datasource reportviewer.
Comments
Post a Comment