☝️Small business or a startup? See if you qualify for our special offer.
+

Format every column/row for export to Excel.

Answered
Accobat Development asked 5 days ago

Dear Flexmonster Team,

I have developed an export function intended for transferring data to Excel. However, I am encountering an issue where certain column types display values merely as 0s and 1s, while others render as raw HTML.

Is there a method to format each column exclusively for Excel export without affecting the current grid display?
Here is the function:

    private async exportToExcel() {
        const downloadService = this.pbiviz.host.downloadService;

        this.flexmonster.exportTo("excel", { destinationType: "plain", useCustomizeCellForData: false }, async (result: ExportResult) => {

            const base64 = this.uint8ArrayToBase64(result.data);

            const fileName = "myfile.xlsx";
            const fileType = "base64";

            // POWER BI DOWNLOAD SERVICE
            downloadService
                .exportVisualsContent(base64, fileName, fileType, "xlsx file")
                .then((success: boolean) => {
                    if (!success) {
                        console.error(`Failed to download ${fileName}`);
                    }
                });
        });

  }

 

br,
Christopher

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster 2 days ago

Hello Christopher,

Thank you for contacting us.

We could not reproduce the described behavior on our side. Please edit the following JSFiddle to show us the issue: https://jsfiddle.net/flexmonster/3axzdr94/. It would greatly help us.

Looking forward to hearing from you.

Kind regards,
Nadia

Please login or Register to Submit Answer