Share via


PageMargins Structure

Stores the page margin settings of a report.

Namespace CrystalDecisions.Shared Assembly CrystalDecisions.Shared (CrystalDecisions.Shared.dll)

Syntax

'Declaration
Public NotInheritable Structure PageMargins
    Inherits ValueType
public sealed struct PageMargins : ValueType

Example

This example shows how to set the properties of the PageMargins structure. The code gets the PageMargins structure, sets the margins for the report, and applies the page margins to the report.

'Declaration

      Private Sub SetMargins(ByVal myReportDocument As ReportDocument, ByVal left As Integer, ByVal top As Integer, ByVal right As Integer, ByVal bottom As Integer)
         Dim myPageMargins As PageMargins
         myPageMargins = myReportDocument.PrintOptions.PageMargins
         myPageMargins.leftMargin = left
         myPageMargins.topMargin = top
         myPageMargins.rightMargin = right
         myPageMargins.bottomMargin = bottom

         myReportDocument.PrintOptions.ApplyPageMargins(myPageMargins)
      End Sub
      
      static void SetMargins(ReportDocument reportDocument, int left, int top, int right, int bottom)
      {
         PageMargins pageMargins = reportDocument->PrintOptions->PageMargins;
         pageMargins.leftMargin = left;
         pageMargins.topMargin = top;
         pageMargins.rightMargin = right;
         pageMargins.bottomMargin = bottom;
      
         reportDocument->PrintOptions->ApplyPageMargins(pageMargins);
      };
      
      private void SetMargins(ReportDocument reportDocument, int left, int top, int right, int bottom)
      {
         PageMargins pageMargins = reportDocument.PrintOptions.PageMargins;
         pageMargins.leftMargin = left;
         pageMargins.topMargin = top;
         pageMargins.rightMargin = right;
         pageMargins.bottomMargin = bottom;

         reportDocument.PrintOptions.ApplyPageMargins(pageMargins);
      }
      

Inheritance Hierarchy

Object
   ValueType
      PageMargins

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

PageMargins Members
CrystalDecisions.Shared Namespace