Skip to content

RemoveRecordSortField - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

Boolean

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.
iSortFieldIndex The N-th record sort field defined in the report.

Description

Removes the specified record sort from the record sorts defined by the record sort expert or added via AddRecordSortField from the report. Sort fields start counting from 0.

The function returns true if the operation was successful.

If a sort field index number is passed that does not exist, the action will be ignored, and no error will be given.

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 oRunReportButton is a Button
    Set Label to 'Run Report'

    Procedure OnClick
        String sReportId
        Boolean bDone

        Get OpenReport of oReport to sReportId
        If (sReportId <> '') Begin
            Get RemoveRecordSortField Of oReport sReportId 0 to bDone
            Send OutputReport of oReport
            Send CloseReport of oReport sReportId
        End
    End_Procedure
End_Object