Specifying How Tables Look
Use table style parameters with any macro that creates a table from scratch, for example the [File.Table:]
, [Jira.Table:]
and [LogicMonitor.InstanceDetailsTable:]
macros. You can specify the style of the table and also which columns you want to display or hide, and the order in which they appear.
For example:
[LogicMonitor.AlertTable: dataPoint=PercentUsed, style=Grid Table 5 Dark - Accent 4, autoFit=Content, columns=Level;DeviceName;DataSourceInstance;StartOnLocal;AckComment, level=Warning]
The available table style parameters are:
- alignment: AlignRowLeft, AlignRowCenter, AlignRowRight
- autoFit: Content, Fixed, Window
- colorTableCell: true or false
- columns: The columns to show. If the columns parameter is not specified, the Macro's default will be used. See below for more details
- criticalCellColor: A Microsoft named color or an HTML-encoded color Color, eg: [A=255, R=192, G=0, B=0]
- emptyTableText: If present, and the table has no rows, the specified text will be inserted in place of the table
- errorCellColor: A Microsoft named color or an HTML-encoded color Color, eg: [A=255, R=192, G=0, B=0]
- hidden: If true, the table will not be written to the report
- orderBy: If present, sorts alphanumerically by this column
- orderByDescending: If present, sorts reverse alphanumerically by this column
- style: Otherwise, use Word's built in Table Styles, or make your own in the Report Template
- skip: Skips the first N rows
- take: If present, only displays the top N rows. Table macros return a maximum of 300 rows unless otherwise specified using this parameter
- thresholdColumn: The threshold column
Colors can refer to a named color or an HTML-encoded color
Note: 'transparent' is a valid color. Also, for any ReportMagic macro parameters that expect a color, assigning an empty string to that parameter means 'the parameter is not set'.
Defining Table Columns
Specify columns of a table by using the columns parameter then adding a ^ character to separate the three parts of each column definition, e.g:
columns=columnheading1^aggregation1^calculation1;columnheading2^aggregation2^calculation2
The three parts that make up a column definition are:
- Column Heading - the value shown in the header cell. This can be any character except , : ; ^ [ ]
- Aggregation - the aggregation to use per cell. This can be First, Last, Min, Max, Mean Property or Calc
- Calculation - the value to show per cell (see below)
You can use the Calc aggregation to perform a calculation on variables or other columns. If you do this, use the variable or column names within curly braces {}, so, for example, a column showing free disk space might be defined thus using Calc aggregation.
Free space in GB^Calc^{Size in GB}-{Used in GB}
Each three-part column is separated by a semi-colon, that is, ReportMagic creates a table column based on data prior to a semicolon. For example, this macro has three columns defined - Name, Size in GB and Used in GB.
[LogicMonitor.InstanceDetailsTable: device=myserver.bobscompany.com, dataSource=WinVolumeUsage-, graphName=VolumeUsage, columns=Name^Last^dataSourceInstanceName;Size in GB^Last^Size;Used in GB^Last^Used, warningLe=20, errorLe=10, criticalLe=5, autoFit=Window]
Note that in the above example you need the legend name of the graph lines (Size, Used), rather than the datapoints named in the DataSource (SizeGB and UsedGB).
If you specify a column where the column heading is the same as the calculation e.g. "Used in GB^Calc^{Used in GB}", this can be shortened to "Used in GB".
That is, the title and calculation are one and the same:
columntitle1;columntitle2;columntitle3