crystal-reports Shared variables


  • Shared NumberVar x;
  • Shared StringVar y := "Hello, World!";


Shared variables allow values to be used at any point in the processing of the report. Similar to a global variable, the shared values can also be accessed by subreports. This allows for a more direct method of comparison and allows the developer to circumvent the strict nature of the top-to-bottom report evaluation.

A shared variable can be defined, set, or recalled in any valid formula field. Their most common use is to store information that would otherwise be forgotten or inaccessible at a later stage in the report.