DataSource

DataSource is a text function that returns the application name, database, or alias table name of a grid. Use DataSource in a text box, text cell, or a row or column heading.

Syntax:

<<DataSource("GridName.Axis[ID],Info Type")>>

Argument Description

GridName

(Required) Any grid in a report, enclosed in quotes.

Axis[]

(Optional) A pointer to a design segment of the grid. Axis can be one of the following keywords: row, col, or column, and it is not case-sensitive.

For example,

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

When Axis is not provided, the grid's default information is returned. Use Axis when a grid has multiple database connections.

ID

(Required if Axis is used) Indicates the design-time, row number, or column letter from which the database connection information is retrieved. If ID points to an invalid or nonexistent row or column ID, the grid default settings are used. In addition, if a grid does not have a secondary database connection, the grid default settings are used.

For example,

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

InfoType

(Required) One of the following keywords:

  • App returns the application name.

  • DB returns the database 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.

Note:

"Server" is not supported as an argument for InfoType. for Planning data sources.

Note:

All arguments are case insensitive.

Example 1:

Insert data source information in your report:

<<DataSource("Grid1", App)>>

Example 2:

Show the database name of the data source associated with the heading where the function was entered:

<<DataSource(cur, DB)>>

Note:

DataSource supports the current keyword. See Using the Current/Cur Keyword in a Text Function.