mercredi 25 septembre 2019

Asp.net Microsoft report viewer show multiple result on multiple pages

In my asp.net application, I am working on a report that reads the data source from a list programmatically because I need to group the result into different multiple lists according to specific condition. I need to display each list on a different page within the same report. Here is the code:

private void PassResultsetsToReport(List<MyResult>[] Resultsets)
        {
            ReportViewer1.LocalReport.DataSources.Clear();
            for(int i=0; i<Resultsets.Length; i++)
            {
                ReportDataSource rds = new ReportDataSource("dataSet1", Resultsets[i]);
                ReportViewer1.LocalReport.DataSources.Add(rds);
            }
            ReportViewer1.LocalReport.Refresh();
            ReportViewer1.Visible = true;
    }

The result was displaying only one page with only the first list added to the report data source. what step is missing to show the other pages with other lists?

Thank you.




Aucun commentaire:

Enregistrer un commentaire