Search code examples
c#wpfms-reports

How to load data page by page in MS Report Viewer?


How do I load data page by page from the database into the MS Report viewer?

now I'm using following code:

private void LoadData()
        {
            reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
            merchent = new Merchant();

            reportDataSource1.Name = "DataSet1";

            reportDataSource1.Value = merchent.GetProducts();
            this._reportViewer.LocalReport.DataSources.Add(reportDataSource1);
            this._reportViewer.LocalReport.ReportPath = "../../Report1.rdlc";
            _reportViewer.RefreshReport();


}

here I want to add all data to DataSource at the initially. I want to add next page record set when clicking the next button.

Is there any way to do it?


Solution

  • Use SSRS Page Breaks.

    Otherwise use the fact that SSRS honors white space to your advantage and deliberately put white space in your RDLC file to cause pagination.

    enter image description here