Disable exporting field caption on condition

Hi
i want to switch “export caption” on/off on condition.
and use this for example :

 public function pageExporting(&$doc)
    {
          
       Config("EXPORT_FIELD_CAPTION, false");
       
        return true; 
    }

but it doesn’t work. what is the problem?

It is too late to set Config("EXPORT_FIELD_CAPTION") in Page_Exporting. You may set $this->ExportFieldCaption.

1 Like

Which version are you using?

i am using 2024.16 version

To which format did you export? Using any extension such as PhpSpreadsheet?

yes i am using phpspreadsheet , and when i change it in config file, it works fine.
but i want to manage it on condition.

You need to use:

$this->setFieldProperties("ExportFieldCaption", false);
1 Like

i really appreciate you, it works fine.