LabelAlignment Property

Returns the alignment applied to a cell label in a report.

Syntax

object.LabelAlignment

Applies To

Column Object

Row Object

Discussion

Use this property to determine the alignment for row or column labels, especially for a crosstab that uses different formats for each category.

When you return the label alignment setting for a row or column, the LabelAlignment property applies to the active Report object only. The property does not apply to row or column labels in other reports in the Reports Collection. The default column or row label alignment setting for other reports remains unchanged, unless previously set in the application.

Valid alignment values are

0 = left aligned 1 = center aligned 2 = right aligned 3 = default

Default: 3 (report setting, if no alignment set for label)

Type

Long

Access

Read

Example

This example returns the alignment for the second row and third column labels.

Sub Main()
   Dim objPPRep as Object
   Set objPPRep = CreateObject ("CognosPowerPlay.Report")
   objPPRep.Open "C:\Cubes and Reports\Sample1.ppx"
   MsgBox "The alignment of the second row label is "
_     
      &objPPRep.Rows.Item(2).LabelAlignment
   MsgBox "The alignment of the third row label is "
_
      &objPPRep.Columns.Item(3).LabelAlignment
   Set objPPRep = Nothing
End Sub

Related Topics