Microsoft Word Report Alignment Configuration

If a button-specific configuration file specifies at least one column, the table cells will be formatted according to the button-specific configuration file.  If the button-specific configuration file does not specify any columns, the column cells will be laid out by the AddColumn function calls in the page’s code-behind file.

Column layout using button-specific configuration files

By way of example, if the overridden property for horizontal alignment is “Left”, “Right”, “Center”, or “Middle”, the text will be aligned accordingly.  However, if it is “Default”, the horizontal alignment will be determined by the parameters specified in the AddData function calls in the page’s code-behind file.  The following example illustrates this.

Overridden properties from the .word files are:

<Column>

     <Header>

          <Value>Postal Code</Value>

          <Style>

              <HorizontalAlign>Default</HorizontalAlign >

          </Style>

     </Header>

     <Detail>

          <Value>${Customers.PostalCode}</Value>

          <Style>

              <HorizontalAlign>Default</HorizontalAlign >

          </Style>

     </Detail>

</Column>

AddData function call in the page’s code-behind file:

report.AddData("${Customers.PostalCode}",

     record.Format (CustomersTable.PostalCode),

     ReportEnum.Align.Left,

     100)

To determine the horizontal alignment for the column header and column detail, your application looks at the Header and Detail tags for the column detail.  In this example, the Value tag contains the “${Customers.PostalCode}” substitution parameter.  Your application determines the default horizontal alignment for “${Customers.PostalCode}”.  The third parameter of the AddData function call tells your application the default horizontal alignment is “left”, so left alignment is applied to the column header and column detail.  Since your application determines horizontal alignment for both the column header and column detail using the same Value tag, column headers and column bodies are always have the same default horizontal alignment.

If the Value tag specifies several substitution parameters or other strings, the horizontal alignment will be “left” regardless the parameters specified in the AddData function calls.  For example:

However, if the overridden ReportDirection property is “True”, horizontal alignment for the entire report will be swapped.

Customizing report layout with AddColumn function calls

Column headers and column bodies can be controlled via the AddColumn function calls in the page’s code-behind file, for example:

report.AddColumn(CustomersTable.CustomerID.Name,

     ReportEnum.Align.Center,

     "${Customers.CustomerID}",

     ReportEnum.Align.Left, 15)

The second parameter specifies the horizontal alignment for the column header.  The forth parameter specifies the horizontal alignment for the column detail.  However, keep in mind that if the overridden ReportDirection property is ‘True’, horizontal alignment for the entire report will be swapped.

Horizontal alignment of page headers and footers

The left of page header and footer are aligned to the left.  The center of page header and footer are aligned to the middle.  The right of page header and footer are aligned to the right.  Keep in mind that if the overridden property of ReportDirection is true, horizontal alignments for the whole report will be swapped in all circumstances.  In addition, the left of page header and footer are shown on the right side.  The right page header and footer are shown on the left side.

See Also

Customizing Microsoft Word Report Configuration Files

Text Substitution Parameters for Titles, Headers, Footers and Columns

Microsoft Word Report Alignment Configuration

Microsoft Word Report Language and Culture-Based Configuration

Customizing Microsoft Word Report Code