Displaying prefixes and suffixes for cell items
Sample script file: CellPrefixAndSuffixUsage.mrs
This example script is based on the Employee Data SAV sample data set. See
Running the sample table scripts.
You can attach a prefix or suffix to a cell item, to provide additional information for a cell. For example, you can add a currency symbol to cells, as shown in the following example:
.AddNew("Table2", _ "salary{base() [IsHidden=True]," + _ "Mn 'Lowest' min(salary), Mx 'Highest' max(salary)," + _ "Av 'Average' mean(salary) [Decimals=0]} * gender", _ "Salary level by gender of employee") .Table2.CellItems[0].Prefix = "$" ' Salary values are in dollars
This creates the following table:
You can also use the prefix or suffix property to add annotations to a cell item. For example, if you have a set of tables that all display values in months, you can add the suffix “months” to the default Count cell item using the following script:
TableDoc.Default.CellItems[0].Suffix = " months" 'include a space before the text
This adds the text after the cell item, as shown in the following table:
See also