OLAP formatting and export to Excel

Answered
Alex asked on March 31, 2021

Hello,
We use useOlapFormatting option to show values in the format defined in SSAS. It works fine, but when, for example, a currency value "€ 1.715,93" is exported to Excel, it appears as a string. Is there a solution for it?
I was trying to add a context menu option to dynamically disable formating, but it doesn't work:

        items.push({
        label: "Add/Remove Formatting",
          handler: function() {
              if (pivot.global.options.useOlapFormatting) {
                pivot.global.options.useOlapFormatting = false;
              }
              else {
                pivot.global.options.useOlapFormatting = true;
              }
          }
        }); 

 
Thanks.
 
Regards,
Alex

2 answers

Public
Milena Pechura Milena Pechura Flexmonster March 31, 2021

Hello, Alex,
 
Thank you for posting to our forum.
 
We would like to confirm that Flexmonster provides a solution for this case.
To export the grid cells as numbers without OLAP formatting, please specify useOlapFormattingInExcel: false in the parameters of exportTo() API call.
Here is the example for illustration: https://jsfiddle.net/flexmonster/cbat6xrm/. For further details about customizing the export to Excel, please visit this section of the "Export and print" article.
 
In case you use the export option of the Toolbar, we would like to mention that you can customize the export functionality via beforetoolbarcreated event. Please see the following sample: https://jsfiddle.net/flexmonster/Lw3ze6sh/.
 
Hope our answer helped!
 
Best regards,
Milena

Public
Alex March 31, 2021

Thanks, Milena. It works as expected.

Please login or Register to Submit Answer