DatabaseType - cDRReport¶
Methods - Properties - Events
Method Type¶
Function
Return Type¶
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 whether the used data source is based on DataFlex, ODBC, Runtime Data Source, or SQLite-based data. ODBC data can be divided into standard ODBC data, data from a stored procedure, or an SQL statement.
The use of DatabaseMainType and DatabaseSubType is preferred over using the result of this function for determining which database type is used.
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 performed 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 'Get Database Name'
Procedure OnClick
Integer eDatabaseType eType
String sReportId sFileListName sCatalog
Get OpenReport of oReport to sReportId
If (sReportId <> '') Begin
Get DatabaseType of oReport sReportId to eDatabaseType
Move (eDatabaseType iand C_DatabaseTypeMask) to eType
Case Begin
Case (eType = C_drDF)
Get psDatabaseName of oReport to sFileListName
Case Break
Case (eType = C_drODBC)
Case (eType = C_drSQLite)
Get psDatabaseName of oReport to sCatalog
Case Break
Case End
Send CloseReport of oReport sReportId
End
End_Procedure
End_Object