Skip to content

Enabling Time Zone for Operational Reports

For Generated RDFs

  • For RDFs that are generated through the model & not modified yet, enable the Time Zone functionality by adding the "TimestampTZRef" code generation property and setting its value to "server" or "site" in the report model file.
report      GeneralLedgerRow;
component   GENLED;
logicalunit GeneralLedgerRowRep;

codegenproperties {
   SchemaSourceName "GeneralLedgerRowRep";
   GenerateRdf "yes";
   TimestampTZRef "server";
}
  • For 'SITE', provide an additional 'SiteAttributeXpath' parameter
report MrbLabel;  
component CHMGMT; 
logicalunit MrbLabelRep; 

codegenproperties {   
SchemaSourceName "MrbLabelRep";    
GenerateRdf "yes";   
TimestampTZRef  "site(mrb_head_api.get_contract(mrb_number))";   
SiteAttributeXpath "mrb_label_rep/heads/head/mrb_number"; }
report MrbLabel;  
component CHMGMT; 
logicalunit MrbLabelRep; 
codegenproperties {   
SchemaSourceName "MrbLabelRep";    
GenerateRdf "yes";   
TimestampTZRef  "site(contract)";   
SiteAttributeXpath "mrb_label_rep/heads/head/contract"; }

For Modified RDFs

  1. For RDFs generated through the model & modified, enable Time Zone functionality by adding 'SERVER' as the last parameter in the 'Report_SYS.Define_Report_' call in the report RDF file.

    Report_SYS.Define_Report_('&REP1VIEW', '&MODULE', '&LU', 'General Ledger Report', '&REP1TAB', '&PKG..&REP1METHOD', 0, NULL, NULL, NULL, 'PLSQL1.2', 'TRUE', 'Financials', 'General Ledger', 'SERVER');
    

    For 'SITE', provide an additional 'SiteAttributeXpath' parameter to get the site value from data xml.

  2. Report_SYS.Define_Report_('&VIEW','&MODULE','&LU','Material Review Board Label','&TABLE','&PKG..&METHOD',10, NULL, NULL, NULL, 'PLSQL1.2' ,'TRUE','Sales','Customer Order', 'SITE(MRB_HEAD_API.GET_CONTRACT(MRB_NUMBER))', 'MRB_LABEL_REP/HEADS/HEAD/MRB_NUMBER');

    Ensure that the specified path is located within the reports' header block. If the path is placed inside a data block and no data is found for that block, the site cannot be identified. As a result, the report's time zone will be left empty, leading to the absence of the Execution Date, Created Date, and Ordered Date in the report.

  3. Also, inside the report method, locate the ‘Xml_Record_Writer_SYS.Create_Report_Header’ call, ensuring the report result key is passed as the last parameter.

    Xml_Record_Writer_SYS.Create_Report_Header(xml_, '&VIEW', package_name_, result_key_).
    
  4. When working with multiple sites and different time zones, locate ‘Xml_Record_Writer_SYS.Convert_Site_Time’ and ensure that time values are converted based on the report's modeled time zone.

    Xml_Record_Writer_SYS.Add_Element(xml_stream_, 'PLANNED_START', Xml_Record_Writer_SYS.Convert_Site_Time(result_key_, rec.planned_start_time, rec.work_task_site) );
    

Handling reports with a customized order report page

There are certain customized Order Report dialogs within certain product areas. Here is a short guide to handle those.

  1. Add a time zone group box (TimeZonesGroup) to the Assistant page with a drop-down control for the end-user to select a time zone value:
        group TimeZonesGroup for ReportVirtual {
        label = "Time Zone";
        visible = [TimeZoneMode = "SERVER"];

        @DynamicComponentDependency APPSRV   
        lov TimeZoneRef with ReferenceIsoTimeZoneSelector {
            size = Medium;
            search = TimeZoneCode, Description;
            }
        }`

  1. Define the attributes used in the ReportVirtual record inside the projection file:
        virtual ReportVirtual {
            attribute TimeZone Text {
                fetch = "TIME_ZONE";
                label = "Time Zone";
                maxlength = 200;
                required  = [false];
                editable  = [true];
            }

            @DynamicComponentDependency APPSRV
            reference TimeZoneRef(TimeZone) to IsoTimeZone(TimeZoneCode) {
                label = "Time Zone";
            }

            attribute TimeZoneEnabled Text {
                fetch = "Report_Definition_Api.Get_Time_Zone_Mode('GENERAL_LEDGER_ROW_REP')";
            }
        }

  1. When the print operation executes, the time zone value needs to be added to the report attribute string before calling the Report_Format_API.Create_New_Report method in the reporting framework.
FUNCTION Print_Genled_Report___ (
key_ IN Report_Virtual_Key ) RETURN NUMBER IS

    result_key_             NUMBER;
    rec_                    Report_Virtual_Rec;
    oldrec_                 Report_Virtual_Rec;
    report_attr_            VARCHAR2(32000) := NULL;
    parameter_attr_         VARCHAR2(32000) := NULL;
    distribution_list_      VARCHAR2(2000)  := Fnd_Session_API.Get_Fnd_User;
    report_id_              VARCHAR2(100)   := 'GENERAL_LEDGER_ROW_REP';

BEGIN
      rec_ := Get_Record___ (key_);

      Client_SYS.Clear_Attr(report_attr_);
      Client_SYS.Add_To_Attr('REPORT_ID', report_id_, report_attr_);
      Client_SYS.Add_To_Attr('TIME_ZONE', rec_.time_zone, report_attr_);
      Add_To_Parameter_Attr___(rec_, parameter_attr_);

-- Validation of the report parameters are handled in the report package method.
result_key_ := Report_Format_API.Create_New_Report(report_attr_, parameter_attr_, distribution_list_);
oldrec_ := rec_;
rec_.result_key := result_key_;   CRUD_Update___(oldrec_, rec_);
RETURN result_key_;
END Print_Genled_Report___;`

Adding "Time_Zone" to the layout file and the report schema file

Copy and paste the content below into the report schema file under the PROCESSING_ATTRIBUTES attributes section.

<xs:element name="PROCESSING_ATTRIBUTES">
<xs:complexType>              
<xs:all minOccurs="1" maxOccurs="1">                
<xs:element name="TIME_ZONE" nillable="true">                 <xs:simpleType>                   
<xs:restriction base="xs:string">                    
<xs:maxLength value="200"/>                   
</xs:restriction>                 
</xs:simpleType>                
</xs:element>                
<xs:element name="EXECUTION_TIME" type="xs:dateTime"/>

Copy and paste the content below into the report layout file under the TANDARD_TRANSLATIONS\ATTRIBUTE_DISPLAY_TEXTS section.

<xs:element name="STANDARD_TRANSLATIONS">             
<xs:complexType>              
<xs:all minOccurs="1" maxOccurs="1">                
<xs:element name="ATTRIBUTE_DISPLAY_TEXTS">                 <xs:complexType>                   
<xs:all minOccurs="1" maxOccurs="1">                    
<xs:element name="TIME_ZONE" nillable="true">                      <xs:simpleType>                        
<xs:restriction base="xs:string">                         
<xs:maxLength value="200"/>                       
</xs:restriction>                      
</xs:simpleType>                    
</xs:element>                    
<xs:element name="EXECUTION_TIME" nillable="true">

Put the translated time zone display text attribute as a label and the processing attribute as a value under the processing information section on the first page.

  • In the RDF file, the attribute data types are set using column comments in the report view. If the view comments' data type is DATE, it won't be used for time zone operations. However, if the column types are DATE/DATETIME or DATE/TIME, they will affect the time zone functionality.
  • If a report does not contain any such columns (Date/DateTime or Date/Time), then, there will be no effect of timezones on those reports.
  • If a report's data is ordered through a background process without displaying the order report assistant, then the working time zone will be used as the selected time zone for the report.

Note: The Model, newly generated schema, report layout & the modified RDF(if any with Time Zone information) should be checked into the source repository to get the Time Zone changes into your report successfully.

Known Limitations

  1. For site time zone reports when applying date values as parameters for reports, please note that they will remain in your local time zone. Date values are not automatically converted to different time zones.

  2. When using XPath expressions, avoid adding date/time values before the specified position in the path of the XML.

    ex: If you have an XPath expression like //Order/OrderDate, adding a date value before OrderDate (e.g., 2023-12-31//Order/OrderDate) would likely result in an error or unexpected behavior.