Skip to content

ReportCacheFileName - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

Boolean

Arguments

Argument Description
sExtension Filename extension for the cache filename to generate.

Description

This function creates a filename based on a UUID (Universally Unique Identifier) and the passed extension. No file is generated.

The function uses the DataFlex RandomHexUUID function and the ReportsCacheFolder for the path.

Requires the USE of WinUUID.pkg.

This function is only available for DataFlex 17.1 and higher and is designed to be used with the Web Application Framework.

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 sFileName
        drPDFExportOptions PDFReportOptions

        Get OpenReport of oReport to sReportId
        If (sReportId <> "") Begin
            Get DefaultPDFExportOptions of oReport to PDFReportOptions
            Set pPDFExportOptions of oReport to PDFReportOptions

            Get ReportCacheFileName of oReport '.pdf' to sFileName
            If (sFileName <> "") Begin
                Send ExportReport of oReport C_drPDF sFileName
            End
            Send CloseReport of oReport sReportId
        End
    End_Procedure
End_Object