A Lookup (or Lookup-list) is a list of values from which the user chooses when running a report -- the result is used as the value of a report parameter. Lookups can be single-select or multi-select.
Lookups are created and managed via Tools > Admin Tools > Lookups (which you're reading about now). A lookup is associated with a report parameter for use at run-time via Admin Tools > Reports. The same lookup can be used in multiple report parameters.
The example below shows a multi-select Lookup list in use. The corresponding report parameter is a list of Customer Numbers. The user can select one or more items.
Mercury passes the set of selected items to the report’s stored procedure as a comma-delimited list of values.
Lookup-lists are populated based on stored procedures that retrieve the appropriate data from your database(s).
There are three steps involved in setting up a Lookup.
A Lookup-list includes the following:
To open the Manage Lookups window:
Adding a new row makes the *entire grid* editable. In addition to your new Lookup, you can also edit any or all existing Lookups as you see fit. And you can add as many new rows as you wish.
The grid columns are:
Below the main grid, additional fields appear that must be completed.
Field Name | The field name returned by query. |
Caption | The field name as you want it to appear in the Lookup list when it is displayed to the user. In the above example, the lazy user left the caption as “Cmpnynam”! A better caption might have been “Company Name”.
|
Format String | The display format to use for dates, times, and numbers. Supports typical Excel-style notation (e.g. "##,###.00") as well as standard .NET abbreviations. See this Microsoft article for information on standard format strings. |
Sort Index | The precedence of the field when used for sorting, relative to other sort-fields. Sort-index is meaningful only when the report is sorted by multiple fields. |
Sort Order | Ascending or Descending (the default is Ascending). |
Display Member | The field whose values are shown in the report’s Parameters grid after the user has selected the desired item(s) The Lookup must have exactly one Display Member. |
Value Member | The "key" field whose values will be passed to the report’s stored procedure when the user runs the report. The Lookup must have exactly one Value Member. The Value Member and the Display Member can be the same field. |
Visible | Determines whether the field is shown in the list when it is displayed to the user at runtime. Depending on the results of your query, you may not need all the fields to be displayed in the list shown to the user running the report.
|
Click Save to create the Lookup. (This will save all changes that you have made.)
A new row will appear at the end of the grid. All of the values are identical to the original Lookup except the Name, which is blank.
Select the Lookup that you want to remove.
To make a Lookup available to an end-user running a report, the Lookup must be associated with the appropriate report parameter.