ReportViewer.SetPageSettings Method (PageSettings)

 

Sets the page settings that are used to print the current report in the ReportViewer control or display it in print layout mode.

Namespace:   Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

Syntax

public void SetPageSettings(
    PageSettings pageSettings
)
public:
void SetPageSettings(
    PageSettings^ pageSettings
)
member SetPageSettings : 
        pageSettings:PageSettings -> unit
Public Sub SetPageSettings (
    pageSettings As PageSettings
)

Parameters

Remarks

By default, the ReportViewer control uses the page settings specified in the report definition when printing the current report or displaying it in print layout mode. Use this method to change the page settings for the current report (not the current page), such as margins or paper size. This method validates the margin and page size values in the pageSettings parameter. Note that the change only affects the current report in the ReportViewer control, and does not affect its parent report or the drillthrough reports accessible from it.

The ReportViewer control uses the pageSettings**.PrinterSettings** property to initialize the Print dialog, but does not validate the pageSettings**.PrinterSettings** property. The printer settings in pageSettings**.PrinterSettings** affect all reports displayed in the ReportViewer control. If pageSettings**.PrinterSettings** is null, the existing printer settings remain unchanged.

If the ReportViewer control is in print layout mode when this method is called, the it cancels any currently running report rendering operation and rerenders the report immediately.

See Also

ReportViewer Class
Microsoft.Reporting.WinForms Namespace

Return to top