Multiple pages with report RDLC C#

Asked

Viewed 26 times

0

I’m using rdlc for reporting. I upload and retrieve the required data from a csv (collaborator, enrollment...).

Within my routine while, I am using the following code to override the parameters of report:

ReportParameter[] prReport = new ReportParameter[8];
prReport[0] = new ReportParameter("vlColaborador", sColaborador, false);
prReport[1] = new ReportParameter("vlMatricula", sMatricula, false);
prReport[2] = new ReportParameter("vlFuncao", sFuncao, false);
prReport[3] = new ReportParameter("vlCentroCusto", sCentroCusto, false);
prReport[4] = new ReportParameter("vlAdmissao", sAdmissao, false);
prReport[5] = new ReportParameter("vlDtOcorrencia", sDtOcorrencia, false);
prReport[6] = new ReportParameter("vlMotivo", sMotivo, false);
prReport[7] = new ReportParameter("vlDtHoje", DateTime.Now.ToString().Substring(0, 10), false);

// atualiza reportviewer
this.reportViewer1.LocalReport.SetParameters(prReport);
this.reportViewer1.RefreshReport();

Follows image of the way I set up the report:

report

But as I am using the same routine, at all times it just updates the current page, always keeping 1/1.

How do I insert a new page into this routine? No overwriting the current one?

  • Must do using a datasource. So you’ll always have only one page.

1 answer

0

you are passing these values statically to the same positions of the vector in that while either replacing the values in each loop, for more than 1 value it is necessary to use datasource, to correct this in a simple way,

List<Collaborator_stitch> list = new List<Collaborator_stitch>();

while(){

collaborator_point cp = new collaborator_point;

cp.contributor_name = contributor name;

list.add(cp);

}

just after you set the report database with this data collection;

use parameters for static values only ex: a sum of a collection...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.