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 :
Page 2 is blank like this:
Page 3 shows items with 7 8 9 number
And the last one is blank again
It means for each pages it makes a blank page why ?
best regards
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.
You can also set the ConsumeContainerWhitespace
property of the parent report to true
. That's worked for me.
Check the documentation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With