Skip to content

psFilterValue - 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.
iFilter The 0-based index of the filter.

Description

Sets/Gets the N-th filter value of a report.

Filters can be added in the designer via the filter expert dialog or via the AddFilter method. Trying to set psFilterValue of a non-existing filter does not do anything and gives no error.

Use this property together with psFilterField

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'

    Procedure OnInitializeReport
        String sReportId

        Forward Send OnInitializeReport

        Get psReportId to sReportId
        // Following code assumes there is one filter defined in the report definition
        Set psFilterField sReportId 0 to '{Titles.YearPublished}'
        Set peFilterOperator sReportId 0 to C_drGreaterThanOrEqual
        Set psFilterValue sReportId 0 to 1963
    End_Procedure
End_Object

Object oRunReportButton is a Button
    Set Label to 'Run Report'

    Procedure OnClick
        String sReportId sFilterValue

        Send RunReport of oReport

        Get psReportId of oReport to sReportId
        Get psFilterValue of oReport sReportId 0 to sFilterValue
        // Do something with the returned value
    End_Procedure
End_Object

Notes

  • The above code assumes there is at least one filter defined.