简体   繁体   中英

Issues loading parameters on a C# RDLC Report

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

错误1

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.

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