Skip to content

DatabaseSubType - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

Integer

One of the database sub type constants

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.

Description

Returns the sub-type of the report's used data-source.

A report based on the ODBC driver supports standard access, data returned by a stored procedure, or data returned by an SQL statement.

A report based on the SQLite driver supports standard access and a custom SQL statement.

A report must be opened before this function can be called; otherwise, an error is generated.

This method cannot be used before the report OCX object is initialized. The COM object creation is done as part of the OpenReport method if not done beforehand.

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 'Run Report'

    Procedure OnClick
        Integer eDatabaseMainType eDatabaseSubType
        String sReportId sFileListName sCatalog

        Get OpenReport of oReport to sReportId
        If (sReportId <> '') Begin
            Get DatabaseMainType of oReport sReportId to eDatabaseMainType
            Case Begin
                Case (eDatabaseMainType = C_drDF)
                    Get psDatabaseName of oReport to sFileListName
                    Case Break
                Case (eDatabaseMainType = C_drODBC)
                    Get DatabaseSubType Of oReport sReportId To eDatabaseSubType
                    If (eDataBaseSubType = C_drStandard) Begin
                        Get psDatabaseName of oReport to sCatalog
                    End
                    Case Break
            Case End
            Send CloseReport of oReport sReportId
        End        
    End_Procedure
End_Object

Notes

  • This method was added in v7.0 when the DatabaseType function changed in v6.2.
  • Use of the defined constants (e.g., C_drODBC) instead of the numeric value is preferred as the value may change.