Custom Fields in Reports¶
Content¶
Overview¶
Custom Fields can be added to your reports. Those will appear in the Report Designer tool or Report Studio Designer tool based on the layout type and can be added to layouts as regular fields. The only requirement is that the report should have been enabled for Custom Fields.
Most standard IFS reports have been enabled. This means the RDF has been updated to include the Custom Fields connected to the Logical Units that the report is based upon. If you prefer to enable your reports, visit the instructions here.
By default, all enabled reports will bring Custom Fields into the report data (XML). However, this can be turned off in case of performance issues. Each Custom Field has an attribute column called Enabled for Reports that controls this.
Configure Custom Fields in Reports¶
Every report that should have custom fields enabled must be modified in the RDF file. Reports not changed will not have custom fields available. Customers should edit the layout to show custom fields on the actual printout.
Having the correct access privileges¶
To add custom fields to reports or to use the Report Designer online mode a developer should have necessary access privileges to access certain forms and logical units. Therefore a user should have the FND_ENDUSER and FND_DEVELOPER roles assigned. If you are using the Report Studio Designer tool, the user should have the FND_DESIGNER_REPORT role assigned.
In addition to that, users need to complete the following configurations on the ENTITY CONFIGURATIONS page.
To add custom fields to layouts in IFS Cloud, follow these steps:
- Enable Custom Attributes Framework: Ensure the Custom Attributes Framework parameter is enabled on the System Parameters page.
- Select Entity: Choose the relevant entity (e.g., ProductCatalog for Product Catalog reports) where you want to add custom fields.
- Define Custom Attributes: Create new custom fields, specifying their attributes (type, data type, text properties).
- Enable for Reports: Mark the Enabled on Reports field for each custom field.
- Publish Changes: Approve and publish the entity changes.
Adding the Custom Field data to the Reporting XML¶
Three changes to the RDF code are required for each LU in each report¶
- Connect LU:s (often more than one) to a Report Block using a metadata method call. Also, clear the table from connections to keep a well-maintained Metadata table.
- Bring up the rowkey(s) in the cursor.
- Make a call(s) to add custom fields to the XML.
Code modification needed¶
Newly generated RDFs from the Developer Studio (after APP8 SP1) will contain the new changes required for supporting custom fields. Existing RDFs have to be modified according to the below-shown changes.
DEFINE PKG = MODULE_RPI
DEFINE VIEW = MODULE_REP
...
CREATE OR REPLACE VIEW &VIEW AS
Report_SYS.Define_Report_('&VIEW','&MODULE','&LU', 'Component Information','&TABLE','&PKG..&METHOD',7);
Report_Lu_Definition_API. Clear_Custom_Fields_For_Report(‘MODULE_REP’);
Report_Lu_Definition_API.Enable_Custom_Fields_for_LU(‘MODULE_REP’, ‘Module’, ‘MODULES/MODULE’);
CREATE OR REPLACE PACKAGE BODY &PKG AS
...
CURSOR get_module IS
SELECT module, name, description, version, version_desc, rowkey
FROM module_tab
WHERE Report_SYS.Parse_Parameter(module, component_) = 'TRUE'
AND Report_SYS.Parse_Parameter(version, version_) = 'TRUE';
...
BEGIN
...
FOR master_ IN get_module LOOP
... IF (do_xml_) THEN
.
.
Xml_Record_Writer_SYS.Add_Custom_Fields(xml_stream_, ‘Module’,master_.rowkey,‘MODULE_REP’, lang_code);
Xml_Record_Writer_SYS.End_Element(xml_stream_, 'MODULE');
END IF;
END LOOP;
Report_Lu_Definition_API.Clear_Custom_Fields_For_Report(<Report_Id>)
Variable | Description |
---|---|
Report_Id | Id of the report. This is generally the report view name. |
Report_Lu_Definition_API.Enable_Custom_Fields_for_LU(<Report_Id>, <LU name>, <XML Xpath>)
Variable | Description |
---|---|
Report_Id | Id of the report. This is generally the report view name. |
LU name | The name of the Logical Unit where the custom fields are add to. |
XML Xpath | The path in the Report Schema where the custom fields should be add at design time. |
Xml_Record_Writer_SYS.Add_Custom_Fields(<Xml_Stream>, <LU name>, <Row_key>, <Report_Id>, <Language>)
Variable | Description |
---|---|
Xml_Stream | The CLOB field in the RDF which has the generated XML data |
LU name | The name of the Logical Unit where the custom fields are added. |
Row_key | Row key of the custom field |
Report_Id | Id of the report. This is generally the report view name. |
Language | If the Logical Unit |
Adding Custom Fields data fields onto the Report Layout¶
The layout should be manually altered to place the desired custom fields in the desired place on the layout. When operating in the online mode the report designer tool is capable of identifying the available custom fields of the report. More information can be found in Report Designer guide.
When using IFS Report Studio Designer, you can view available(added via Entity Configurations) custom fields within the JSON data source. Read more details on Report Studio Designer Guide
Controlling Custom Fields on Reports¶
1. Report level controlling¶
The entire Report can be enabled or disabled for custom fields, this can be done from the report definition.
2. Attribute level controlling¶
Each Custom field can be individually controlled, whether it is possible to add it to a report or not, this can be done from the particular custom fields.
Q & A¶
1. What if rowkey is missing in my table/view?¶
In views, it is called the objkey, and in tables, it is called the rowkey. If it is missing, you are unable to use Custom Fields for this LU. Therefore, you should skip it.
2. Where do I place the Custom Field XML?¶
Place it as the last simple item just before the first new block.
3. I do everything right, but why there is no Custom Field shows up in the XML?¶
- Check the report Configuration whether the report has been enabled for custom fields.
- Check in IFS Cloud that a Custom Field attribute has been added to the LU you are connecting.
- Check if the RDF business logic has the necessary code to generate the XML with the custom field.
- Check if data is available for the Custom Field you added.