Column object, FactsAxis object, MemberSelector object, Trendline object, ValueLabels object
Enables you to format the numeric values for a Results or Table column, Chart facts axis, OLAPQuery, CubeQuery, and Pivot facts, trend lines and reference line objects (Chart section).
Setting the NumberFormat (Property) corresponds to setting the number format on the Number tab of the Default Formats dialog box.
In the OLAPQuery section, the NumberFormat property is available for objects in the Facts collection.
In the CubeQuery sections, setting the NumberFormat property updates all the fact cells for the selected MemberSelector object in the entire column/row in the native CubeQuery grid and any CubeQuery embedded section objects upon script execution. You can apply number formats by Members of the Measures Dimension as well as Members in any other Dimension. If the MemberSelector object has advanced member selection types, the NumberFormat is applied only to member itself. If members are excluded from selection, the number format is not be applied to any cells. In this case, you should explicitly add all the members to which you want to apply a number format.
For the trend line object, the NumberFormat affects the look of R-Squared value of trend line. The R-Squared parameter (also know as the coefficient of determination) is a value in a [0, 1] range. It shows how good the trend line conforms to data.
For the reference line, the NumberFormat affects the appearance of the values shown on the line.
Interactive Reporting does not validate whether the NumberFormat string is recognized as a valid number format.
NumberFormat property defaults to no value.
Number formats can be applied to particular cell in various ways (GUI with various selection methods, Object Model, and defaults). The order of priority for applying the number format is as follow from lowest to highest priority:
number formats defined in the Number tab of the Default Formats dialog box
number formats defined in the user interface by selecting the column which contain the cell
number formats defined in the user interface by selecting the row which contain the cell
number formats defined in the user interface by selecting the cell
number formats defined in the Object Model for row dimensions and members which correspond to the cell. The settings of posterior dimensions override settings of previous ones.
number formats defined in the Object Model for column dimensions and members which correspond to the cell. The settings of posterior dimensions override settings of previous ones.
This example shows how to apply currency number formatting to data in the Results section:
ActiveDocument.Sections["SalesResults"].Columns["Amount Sales"].NumberFormat="$#,##0.00"
This example shows how to apply a number format to the 100 Column in the CubeQuery section:
ActiveDocument.Sections[“Query”].Columns[“Product”].MemberSelectors[“100”].NumberFormat = “$#,##0.00;[$#,##0.00]