Skip to content

SetReportLocaleAndLanguage - cDRReport

Methods - Properties - Events

Method Type

Method

Return Type

None

Arguments

Argument Description
sReportID ID of a report. Must be ID of a report
sLanguage A language name to be converted to a LCID (Locale Identifier) value
sParameterName Name of an integer report parameter to store the LCID value. When not needed, pass an empty string.

Description

The method uses a Windows API call to convert the language name (e.g., en-US, nl-NL, etc.) into a Locale Identifier (LCID). A part of the returned value is used to set piReportLanguage. The method can also look up a report parameter with the passed name and assign the LCID value to this parameter. This parameter can then be used in the locale report option.

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 OnInitializeReport
        String sReportId sLanguage

        Get psReportId to sReportId

        WebGet psClientLanguage of ghoWebApp to sLanguage
        Send SetReportLocaleAndLanguage sReportId sLanguage 'ReportLanguage'
    End_Procedure
End_Object

The above example is aimed at using the web. The psClientLanguage is not an existing web property.

Starting with DataFlex 20.1, it is possible to use pasBrowserLanguages. That makes the example:

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

    Procedure OnInitializeReport
        String sReportId 
        String[] sLanguages

        Get psReportId to sReportId

        WebGet pasBrowserLanguages of ghoWebApp to sLanguages
        Send SetReportLocaleAndLanguage sReportId sLanguages[0] 'ReportLanguage'
    End_Procedure
End_Object