Customizing Excel File

Answered
Leo Chan asked on February 26, 2024

Hi Flexmonster Team,
I've tried exportTo() to export data to an Excel file. I noticed that:

  • Collapsed Data Cells are not bolded
  • Collapsing / Expanding rows or columns are not available in the Excel file

Are there any built-in functions to deal with the issues?
Furthermore, is there any way to encrypt the file with a password given by user?
 
Thanks,
Leo

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster February 26, 2024

Hello Leo,

Thank you for reaching out to us.

Currently, there is no feature for making the collapsed cells bold in Excel export out of the box. Since every cell's style can be unique - such a function would take a lot of time. Therefore, an export report with different cell styles is impractical because it would last much longer.
Regarding collapsing and expanding columns and rows, Flexmonster exports all the data visible on the grid to the static Excel file. This way, while the rows are collapsed on the grid, the exported Excel only contains the collapsed data.
As a workaround, you can use export customization and follow these steps to customize the exported file:

  1. Use the destinationType: "plain" parameter of the exportTo() API call to retrieve the grid content as a Uint8Array returned in the callbackHandler.
  2. Use a 3rd party library (e.g., SheetJS) to process the resulting Uint8Array and apply the necessary changes, such as encrypting the file with a password or making some cells bold.

We hope it helps. You are welcome to contact us in case other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer