Skip to content

PageLayerId - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

String

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.
iPageLayer The N-th pagelayer defined.

Description

Returns the ID of the N-th pagelayer in a report. Can be used to replace a pagelayer at runtime.

This method 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 EnumeratePageLayers String sReportId
        Integer iPageLayers iPageLayer
        String sPageLayerId sPageLayerName

        Get PageLayerCount sReportId to iPageLayers
        Decrement iPageLayers
        For iPageLayer from 0 to iPageLayers
            Get PageLayerId sReportId iPageLayer to sPageLayerId
            Get PageLayerName sReportId iPageLayer to sPageLayerName
            Showln sPageLayerId ' ' sPageLayerName
        Loop
    End_Procedure
End_Object

Object oOpenReportButton is a Button
    Set Label to 'Open Report'

    Procedure OnClick
        String sReportId

        Get OpenReport of oReport to sReportId
        If (sReportId <> '') Begin
            Showln 'Report ID Main Report: ' sReportId
            Send EnumeratePageLayers of oReport sReportId
            Send CloseReport of oReport sReportId
        End
    End_Procedure
End_Object