Skip to content

TableAliasName - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

String

Arguments

Argument Description
sReportID ID of the report. Can be ID of the main report or the ID of a sub-report. This argument can be passed as an empty string. The empty string can be written as C_USEMAINDRREPORTID.
iTable The N-th table number of the report. Table numbers start at zero.

Description

Returns the alias name of the tables in the report. The alias name is the name the report developer entered when a table was added 2 or more times. If a table is used once, the alias name is the same as the table name (psTableName). The alias name is the table name to pass as tablename for a function like AddFilter.

This method cannot be used before the report OCX object is initialized and a report is opened (OpenReport).

DataFlex Framework usage

  • Web
  • Windows
  • FlexTron

Sample

Object oReport is a cDRReport
    Set psReportName to 'MyReport.dr'
End_Object

Object oRunReportButton is a Button
    Set Label to 'Show table and table alias names'

    Procedure OnClick
        Integer iTables iTable
        String sReportId sTableName sTableAliasName

        Get OpenReport of oReport to sReportId
        If (sReportID <> '') Begin
            Get TableCount of oReport sReportId to iTables
            Decrement iTables
            For iTable From 0 To iTables
                Get psTableName of oReport sReportId iTable to sTableName                
                Get TableAliasName of oReport sReportId iTable to sTableAliasName
                Showln 'Table ' iTable ': ' sTableName ' ' sTableAliasName
            End
            Send CloseReport Of oReport sReportId
        End
    End_Procedure
End_Object