ExportCSV Column Question/Issue on joinFields


#1

I’m trying to implement a UI action button that will export a CSV from a KendoGrid, but I’m having issues with the resulting export not showing the proper value / unit symbol for a column (Consumption). This issue occurs for columns are are using joinFields to connect a value and its corresponding unit, but all others are fine.

Example: what should come out as “1.03 CCF” is blank, and “0 CCF” comes out as “0.0”

  1. Tried UIActionEnterpriseExportCSV, but the resulting CSV did not have the correct result for Consumption. See above example for what it comes out as
  2. Also tried UIActionAllFieldsExportCSV, but also no success. I’ve been testing possible variations of altering the format for this columns, but the resulting CSVs also have similar results to the first one

Code Snippet of the KendoGrid Component from the .ui file.
{
“id”: “consumptionKWH”,
“label”: “{~EnergyManagement.Account.BillingAccountSummaryKendoGrid.consumption~}”,
“field”: “consumption.value”,
“format”: {
“funk”: “joinFields”,
“record”: true,
“args”: [
[
{
“field”: “consumption.value”,
“format”: {
“precision”: 1
}
},
{
“field”: “consumption.unit.id”,
“format”: “unitSymbol”
}
],
" "
]
},
“align”: “left”,
“sortable”: true
},

Any help would be appreciated!


#2

I’m afraid none of the CSV exporters support formatters that reference other fields, UIViewKendoGrid has custom logic for formatters with "record": true that passes the current item so the formatter can reference other fields.

Please create an enhancement ticket for UIActionEnterpriseExportCSV. We have to take two things into consideration:

  1. It doesn’t currently pass arguments
  2. It has to use the record flag to change the value passed to be the record instead of the field value.

If you need a workaround, I’d recommend you to create a server side API that provides the data in the exact format that you want.