4

I am trying to get a report from my items.I make my report by Rdlc file using visual studio 2012.

I fetch my data using this code:

            List<InvoiceDetailRPT> list = customerRpt.ReturnListOfInvoiceDetailsForGRV(invoiceDetails);
  Microsoft.Reporting.WinForms.ReportDataSource dataset =
                new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", list);
            reportViewer1.LocalReport.DataSources.Add(dataset);
            dataset.Value = list;

            reportViewer1.LocalReport.Refresh();
            reportViewer1.RefreshReport(); // refresh report

Everything works fine but in print preview i have a big problems.For example in each page i should show 6 items ,if the items is more that 6 ,the reporter should makes another page for that.But when my items is less than 6 the reporter makes another age with blank !!!and another problem when my records is more that 6 it creates 4 pages and the pages 2 and 4 are blank .why ?

For example here in the pictures my result has 9 items and the result is like this :

enter image description here

Page 2 is blank like this:

enter image description here

Page 3 shows items with 7 8 9 number

enter image description here

And the last one is blank again

enter image description here

It means for each pages it makes a blank page why ?

best regards

Mehrdad
  • 174
  • 1
  • 4
  • 14

4 Answers4

7

Examine your report size values and margin values. If page width plus margin width at any point is bigger than set page size, it will push the "extra" white space into the next blank page. Same goes for page height.

So, the first thing to do is to delete any white space at the bottom and left and right sides of the page in report designer, set report size to exact page size or smaller and set margins in such a way that the report body + margins are not bigger than set page size.

InitK
  • 1,261
  • 13
  • 21
5

You can also set the ConsumeContainerWhitespace property of the parent report to true. That's worked for me.

Check the documentation here.

1

Resize your report design, to the exact bottom of the last report control or label.

See Empty pages in RDLC-Report

Community
  • 1
  • 1
Marcelo Lujan
  • 2,142
  • 1
  • 17
  • 12
0

I faced this problem recently, this is how i got away with it:

-> First of all set the page size, by changing Page Size property from Properties. Set width : 8.5 in , height : 11 in

-> By right clicking on the report page and going into its properties, reduce the margins. I reduced them from 1 inch to 0.5 inch (all sides).

Doing this rendered my report without extra pages. Hope it works for somebody.

Harry .Naeem
  • 1,245
  • 3
  • 20
  • 33