1

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?

kittykittybangbang
  • 2,380
  • 4
  • 16
  • 27
Suravi
  • 301
  • 1
  • 7
  • 21
  • Within ReportingServices you must set the InteractiveHeight to a number greater than 0. If it is set to 0 paging will be disabled – Sreejith Jul 06 '15 at 05:09
  • @Sreejith the way I read the question is to load & set the datasource once (as per code shown) and have one product per page. I didn't interpret this question to disable paging. – Jeremy Thompson Jul 06 '15 at 05:11

1 Answers1

1

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

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321