Skip to content

psDatabaseConnection - cDRReport

Methods - Properties - Events

Type

String

Default

None

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

If the datasource is DataFlex (DatabaseType = C_drDF), this property holds the DF_OPEN_PATH used to locate the DataFlex filelist and tables.

If the datasource is ODBC (DatabaseType = C_drODBC, C_drSP or C_drSQL), this property holds the ODBC connection string (e.g. DSN=Dynamic AI Library Demo;DBQ=C:\Program Files\Dynamic AI\Dat\Dynamic AI Library Demo.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5).

If the datasource is RDS (Runtime Datasource, DatabaseType = C_drRDS), this holds the static name "Runtime Datasource".

This property cannot be used before the report OCX object is initialized. The COM object creation is - when not done before - created as part of the OpenReport method.

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 eDatabaseType
        String sReportId sDatabaseConnection

        Send RunReport of oReport

        Get psReportId of oReport to sReportId
        Get psDatabaseConnection of oReport sReportId to sDatabaseConnection
        Get DatabaseType of oReport sReportId to eDatabaseType
        If (eDatabaseType = C_drDF) Begin
            Send Info_Box ('paths = ' + sDatabaseConnection)
        End
        If (Low (eDatabaseType) = C_drODBC) Begin
            Send Info_Box ('connection string = ' + sDatabaseConnection)
        End
        If (eDatabaseType = C_drRDS) Begin
            Send Info_Box ('connection string = ' + sDatabaseConnection)
        End
    End_Procedure
End_Object