We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Display customized cell result in exported excel and export multiple sheets in single file

Answered
Amogh Arsekar asked on August 5, 2024

I am using Flexmonster to generate a pivot table based on an IDs which I later replace with labels in the table using the customizeCell function during initialisation. When I do an Excel Export, the resulting file contains the IDs instead of the Labels.

I also have a case where I want to export multiple excel sheets. I am able to export them as individual files but instead, I want to export a single file with multiple sheets.

6 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 5, 2024

Hello!

Thank you for reaching out to us.

Kindly note that Flexmonster can export labels changed in customizeCell() function into Excel, if there are no HTML elements added to the cell.text. Here is the JSFiddle for reference: https://jsfiddle.net/flexmonster/4fmvq6cj/. If you are changing the text with no additional tags, and the customizations are not exported, could you please modify the provided JSFiddle to make your case reproducible on our side?

Regarding your question about exporting multiple Excel sheets, please note that in Flexmonster you can only export one sheet per one Excel file.
However, it is possible to export data as Uint8Array and then add multiple sheets and apply other customizations in the callback handler using any 3rd-party Excel exporting tool.
You can read more about exporting in Flexmonster in our docs: https://www.flexmonster.com/doc/export-report/#programmatically.

Hope you will find our answer helpful.

Kind regards,
Solomiia

Public
Amogh Arsekar August 7, 2024

Hello,

Thanks for the detailed response. I focused on the multiple excel sheet export feature first and got it working using the steps you suggested. The only problem with this approach is any styling changes that I'm doing on the grid are lost on export. I am making specific rows bold and changing the font color. Is there any way I can preserve these styles?

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 7, 2024

Hello!

Thank you for your swift response. We are glad to hear our approach was helpful in configuring export to multiple Excel sheets.

Kindly note that Flexmonster is sharing styles along with data encrypted in Uint8Array. We recommend checking that styles are merged correctly from multiple Excel files into one with any 3rd party Excel library you use.

Hope you will find our answer helpful.

Kind regards,
Solomiia

Public
Amogh Arsekar August 8, 2024

Hello,

I am referring to the styles applied using customizeCellFunction. Those styles are not being exported even by the default flexmonster excel export. I tried export in this Jsfiddle example as well: https://jsfiddle.net/9qagb2xn/. The colors and bold fonts are not exported. I am using Exceljs library for multiple sheet export which supports styling.

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 9, 2024

Hello!

Thank you for getting back to us.

Please note that CSS styles applied to the Flexmonster component using the customizeCell function are not exported to Excel. As a possible workaround, we suggest styling cells using conditional formatting: https://www.flexmonster.com/doc/conditional-formatting/.

Hope you will find our answer helpful.
Feel free to ask if you have any further questions.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster August 21, 2024

Hello!

Hope you are doing well.

Our team is wondering if you had some time to check our previous response. Could you please let us know if there are any further questions?

Looking forward to hearing from you.

Kind regards,
Solomiia

Please login or Register to Submit Answer