Referencing parameters in a formula

A formula which references parameters will return values according to the parameter values. To reference a parameter in a formula, follow the syntax: @ParameterName.

Here is an example of a formula which displays the URL for a company. The URL is based on the value for the parameter Company.

  1. Open the demo catalog SampleReports.cat, in the Catalog Browser, expand the desired data source and create a type-in parameter named p_Company of String type (leave the other settings to their default).
  2. In the same data source, create a formula named CompanyURL in the Formula Editor window as follows:

    "http://www." + @p_Company + ".com"

    Here, you can either manually type @p_Company, or you can select it from the Parameters node in the Fields panel (if you choose this option, the @ sign will automatically be inserted).

  3. Insert the formula into a report.
  4. View the report result, and type the string Jinfonet when prompted to enter the parameter value for p_Company. You will then find that the value of the formula becomes http://www.jinfonet.com.

This is a simple example of referencing a parameter in a formula. Here, the formula is placed directly into a report. You will better understand the benefits of referencing parameters in formulas which are used to control object properties.