0

I want to add more pages to rdlc report this is what I have tried

public void ReportPrint_Load(object sender, EventArgs e)
    {

        reportViewer.ProcessingMode = ProcessingMode.Local;
        LocalReport localReport = reportViewer.LocalReport;

        reportViewer.LocalReport.ReportPath ="KartonReport.rdlc";

        foreach (var adat in adatLista)
        {
            ReportParameter[] newReport = {
                new ReportParameter("rUgyfelKOD", nullCheck(adat.ugyfelKOD)),
                new ReportParameter("rUgyfelnev", nullCheck(adat.ugyfelnev)),
                new ReportParameter("rUzeletkoto", nullCheck(adat.uzletkoto)),
                new ReportParameter("rFizetes", nullCheck(adat.fizetes)),
                new ReportParameter("rUgyfelcime", nullCheck(adat.ugyfelcime)),
                new ReportParameter("rKapcsolattarto", nullCheck(adat.kapcsolattarto)),
                new ReportParameter("rEmail", nullCheck(adat.email)),
                new ReportParameter("rSzallitasnap", nullCheck(adat.szallitasNap)),
                new ReportParameter("rSzallitaskor", nullCheck(adat.szallitasKor)),
                new ReportParameter("rCseregyakorisag", nullCheck(adat.csereGyakorisag)),
                new ReportParameter("rMegjegyzes", adat.megjegyzes != "" ? adat.megjegyzes : " "),
                new ReportParameter("rMegrendelo", nullCheck(adat.megrendelo)),
                new ReportParameter("rEv", nullCheck(adat.ev)),
                new ReportParameter("rTelszam", nullCheck(adat.telszam)),
                new ReportParameter("rSzallitasiutemzes", nullCheck(adat.szallitasUtemzes)),
                new ReportParameter("rSzallitandoSzonyegek", nullCheck(adat.szallitandoSzonyegek))
            };
            this.reportViewer.LocalReport.SetParameters(newReport);
        }

        this.reportViewer.RefreshReport();

    }

(https://i.stack.imgur.com/0Rjlx.png) I have a list of data, Im trying to add each item to localReport with setParamaters, But the problem is I only get the last item on the report.

Zxld1337
  • 1
  • 1
  • Please include code as formatted text not image snapshot. This makes it easier for others to test and edit your code in order to assiste with an answer – moken Nov 30 '22 at 06:22

1 Answers1

0

I think you mistaken report parameters with report data.

This is what parameter looks like:

enter image description here

They are a just parameter and just that, a single value.

What you need is use Datasets.

This is how to pass data in report:

ReportDataSource reportDataSource = new ReportDataSource();
reportDataSource.Name = "List";
reportDataSource.Value = adatLista;
reportViewer.LocalReport.DataSources.Add(reportDataSource);
HardcoreGamer
  • 1,151
  • 1
  • 16
  • 24
  • Doesn't work, in my program adatLista is a List with class init that contains the data (strings), so I need to put reportParameters in my list? – Zxld1337 Dec 05 '22 at 11:28
  • RDLC can work with class data type. You may find the following example useful to you. [Using .NET Class as the DataSource with SSRS RDLC](https://stackoverflow.com/questions/27695864/using-net-class-as-the-datasource-with-ssrs-rdlc) – HardcoreGamer Dec 06 '22 at 01:34