Using CRChart Macros in Crystal Reports

CRChart macros can be inserted in any chart title field (i.e., title, subtitle, footnote, etc.) field in a Crystal Reports chart. Chart titles are defined in the Chart Expert dialog or Chart Options or Titles dialog in some Crystal Reports versions.

Even though macros are defined in the chart title fields, they will not appear as text in your chart. If you need to use a particular title field to define a chart title and to enter a macro, append a tilde (~) character and a space to the title and add the macro after the space. The space after the tilde is important. If it is not included, the macro will be ignored. EXAMPLE:

TitleText~ @3DSCAT

CRChart macros are not case-sensitive. All macros begin with an at-sign (@). There should be no space between the at-sign and the macro (i.e., @SWAP, not @ SWAP). Most macros include one or more parameters that further define the action of the macro. There must be one space after the macro and before the first parameter and a space between each subsequent parameter. EXAMPLE:

@USER_SERIES 2 3.6 3.8 MyNewSeries

Multiple macros may be defined in a single title field. When multiple macros are used, separate each macro with a space. EXAMPLE:

@BP2 @MK 8

If the macro includes a string and multiple macros are defined in the same title field, a tilde (~) character must be appended to the end of the string parameter to indicate the end of the first macro and beginning of the next. EXAMPLE:

@AGL 2 Alias Label~ @BP2

For macros that can be applied to a particular series in a chart, the nSeries parameter defines the series to which the macro is applied. In most cases, the nSeries parameter can be assigned a value in the range: minus one (-1)...n (where: n is the total number of series in the chart). For these macros, minus one is a special value that will apply the macro to all series in the chart. A value of zero (0) selects series 1.