ServerReport.GetDefaultPageSettings 方法
取得報表定義所指定的預設頁面設定。
命名空間: Microsoft.Reporting.WebForms
組件: Microsoft.ReportViewer.WebForms (在 Microsoft.ReportViewer.WebForms.dll 中)
語法
'宣告
Public Overrides Function GetDefaultPageSettings As ReportPageSettings
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 方法的 deviceInfo 引數來傳遞頁面邊界和頁面大小資訊。
範例
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
Dim pageSettings As ReportPageSettings
pageSettings = ReportViewer1.ServerReport.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