Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Change Interactive Grid column dinamically not working when download to Excel

Luis RGAug 9 2022

Hi, i'm changing the headers of my interactive grid with this code in Attributes -> JavaScript Initialization Code, it works fine changing the column names, but when I download it to excel it set columns names in excel with the original names.
Thanks in advance.
function( options ) {
var colOptions = options.columns;
var nombrecol=""
for (let i = 1; i < colOptions.length; i++)
{
let isHidden = colOptions[i].isHidden,
igColHeading = colOptions[i].name;

if (colOptions\[i\].name==='ID\_ORIGEN') nombrecol="Centro de Costos";  
if (colOptions\[i\].name==='ID\_GASTO') nombrecol="Tipo de Gasto";  
if (colOptions\[i\].name==='ID\_RUBRO') nombrecol="Rubro";  
 if(!isHidden)    
{  
colOptions\[i\].heading.heading = nombrecol;  
}  

}
return options;
}

Comments
Post Details
Added on Aug 9 2022
0 comments
215 views