1

I have developed my application on C# winform. I designed my report on rdlc report in Visual studio 2013. I am using report viewer to generate preview of the report and print the report.

The report paper size is a custom paper. That is width: 19cm x Height: 20cm. But when I see my report in report viewer, it shows the report in A4 page.

I set the page size in report properties in design mode. But that is not taking effect.

I tried to set the page size at run time. But it is also not taking effect.

I tried this code.

System.Drawing.Printing.PageSettings PS = new System.Drawing.Printing.PageSettings();
                PS.PaperSize = new System.Drawing.Printing.PaperSize("Custom", (int)((19 * 0.393701) * 100), (int)((20 * 0.393701) * 100));
                PS.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
                PS.Landscape = false;


                RepViewer.SetPageSettings(PS);

Is there any way to use custom paper size with RDLC report and MS Report Viewer.

IF No, then please suggest any alternate solution for it that should be free.

Haider Ali Wajihi
  • 2,756
  • 7
  • 51
  • 82
  • 1
    Check `GetDefaultPageSettings()` value in your `LocalReport`. – Irshad Sep 18 '15 at 12:12
  • 1
    Also check the `deviceinfo` value passing to `report.Render` method – Irshad Sep 18 '15 at 12:13
  • Getting this error while calling GetDefaultPageSettings() method. An unhandled exception of type 'Microsoft.Reporting.WinForms.MissingReportSourceException' occurred in Microsoft.ReportViewer.WinForms.dll Additional information: The source of the report definition has not been specified – Haider Ali Wajihi Sep 18 '15 at 12:39

1 Answers1

0

I think you just add this code end code of you, it will save code your did custom above:

[YourNameReportViewer].RefreshReport();
B.Syal
  • 69
  • 2
  • 5