Skip to content

RecordSortCount - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

Integer

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 number of record sort fields defined in the report. The record sort fields are added to the report in the designer by the record sort expert and via the programming language using AddRecordSortField.

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 it has not been done beforehand.

DataFlex Framework usage

  • Web
  • Windows
  • FlexTron

Sample

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

Object oShowRecordSortCountButton is a Button
    Set Label to 'Show Record Sort Count'

    Procedure OnClick
        String sReportId
        Integer iCount

        Get OpenReport of oReport to sReportId
        If (sReportId <> '') Begin
            Get RecordSortCount of oReport sReportId to iCount
            Send Info_Box iCount 'Number of record sorts defined'
            Send CloseReport of oReport sReportId
        End
    End_Procedure
End_Object