LocalReport.GetDefaultPageSettings 方法

获取在本地报表中指定的默认页设置。

命名空间:  Microsoft.Reporting.WebForms
程序集:  Microsoft.ReportViewer.WebForms(在 Microsoft.ReportViewer.WebForms.dll 中)

语法

声明
Public Overrides Function GetDefaultPageSettings As ReportPageSettings
用法
Dim instance As LocalReport
Dim returnValue As ReportPageSettings

returnValue = instance.GetDefaultPageSettings()
public override ReportPageSettings GetDefaultPageSettings()
public:
virtual ReportPageSettings^ GetDefaultPageSettings() override
abstract GetDefaultPageSettings : unit -> ReportPageSettings 
override GetDefaultPageSettings : unit -> ReportPageSettings 
public override function GetDefaultPageSettings() : ReportPageSettings

返回值

类型:Microsoft.Reporting.WebForms.ReportPageSettings
一个 ReportPageSettings 对象,包含本地报表中的默认页设置。

注释

返回的 ReportPageSettings 对象可以用来通过传递给 Render(String, String, String%, String%, String%, array<String[]%, array<Warning[]%) 方法的 deviceInfo 参数传递页边距和页大小信息。

示例

Private Sub Button2_Click(ByVal sender As System.Object, _
   ByVal e As System.EventArgs) Handles Button2.Click
   Dim pageSettings As ReportPageSettings

   pageSettings = ReportViewer1.LocalReport.GetDefaultPageSettings

   Debug.WriteLine(pageSettings.Margins.Top)
   Debug.WriteLine(pageSettings.Margins.Bottom)
   Debug.WriteLine(pageSettings.Margins.Left)
   Debug.WriteLine(pageSettings.Margins.Right)
   Debug.WriteLine(pageSettings.PaperSize.Kind)
   Debug.WriteLine(pageSettings.PaperSize.RawKind)
   Debug.WriteLine(pageSettings.PaperSize.PaperName)
   Debug.WriteLine(pageSettings.PaperSize.Height)
   Debug.WriteLine(pageSettings.PaperSize.Width)

End Sub
   Debug.WriteLine(pageSettings.Margins.Top)
   Debug.WriteLine(pageSettings.Margins.Bottom)
   Debug.WriteLine(pageSettings.Margins.Left)
   Debug.WriteLine(pageSettings.Margins.Right)
   Debug.WriteLine(pageSettings.PaperSize.Kind)
   Debug.WriteLine(pageSettings.PaperSize.RawKind)
   Debug.WriteLine(pageSettings.PaperSize.PaperName)
   Debug.WriteLine(pageSettings.PaperSize.Height)
   Debug.WriteLine(pageSettings.PaperSize.Width)

End Sub

请参阅

参考

LocalReport 类

Microsoft.Reporting.WebForms 命名空间