DataSource

DataSource is a text function that returns the server name, application name, database, or alias table name of a grid. You can use this function in a text box, text cell, or a row or column heading. The function syntax is:

 <<DataSource("GridName.Axis[ID]”,InfoType)>> 
 

Argument

Description

GridName

Any grid in your report, enclosed in quotes. Required.

Axis[]

A pointer to a design segment of the grid. Axis can be one of the following keywords: row, col, or column, and they are not case-sensitive. For example,

<<DataSource("Grid1.Row[1]",DB)>>

addresses the row axis.

Optional. When not provided, the grid's default information is returned. You use Axis[ID] when a grid has multiple database connections.

ID

Indicates the design-time, row number, or column letter from which the database connection information is retrieved. If ID points to an invalid or non-existent row or column ID, the grid default settings are used. Also, if a grid does not have a secondary database connection, the grid default settings are used. For example,

<<DataSource("Grid1.Col[A]",DB)>>

addresses Column A. If axis is used, then ID is required.

InfoType

One of the following keywords:

  • Server returns the server name.

  • App returns the application name.

  • DB returns the data base name.

  • Alias returns the alias table name. To return the alias, the grid must have the alias table enabled. By default, the alias table is disabled.

  • Name returns the database connection name associated with the specified grid.

Required.

Note:

All arguments are case insensitive.

Example 1:

The following lines use the DataSource function to insert data source information in your report:

This report uses the <<DataSource("Grid1”, App)>>
with the <<DataSource("Grid1”,DB)>> database
located on the <<DataSource("Grid1”,Server)>> server
and uses the <<DataSource("Grid1”, Alias)>> alias table.

Example 2:

The following shows the database name of the data source associated with the heading where the function was entered:

<<DataSource(cur, DB)>>

Note:

This function supports the Current keyword. For information and examples, see Current / Cur Keyword.