Thanks for reading my question. I used to load a report with a button, after selecting dates (from and to), I used mysql and c#, and here are some images so you can look the issues.
Here is the principal issue/error
Here is my Report, as you can see, at the left side, it has the parameters required
Here i have the dataset/Query to that report, it has the @parameters here too
Finally, the code for the click event to generate the report
Have you tried this before calling reportViewer1.RefreshReport()
?
reportViewer1.LocalReport.SetParameters(new ReportParameter[]{
new ReportParameter("desde",desde.ToShortDateString()),
new ReportParameter("hasta", hasta.ToShortDateString())
});
Try this on button1_Click
event:
DateTime desde = dt_desde.Value;
DateTime haste =dt_hasta.Value;
this.byc_articulosTableAdapter.Fill(this.datasetResumenInventario.byc_articulos, desde,haste);
this.reportViewer1.RefreshReport();
If u have parameter query for report binding then u must pass those parameters while dataAdaptor filling ( byc_articulosTableAdapter
). Hope this helps u.
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.