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

Export to HTML and CSV is not working properly

Answered
Jose Eduardo Almeida asked on January 29, 2024

Export to HTML and CSV is not working properly.
When we are using export to HTML or CSV in the export tab is not working properly and it is bringing code instead of values. Export to Excel is Ok.
Below is the code we are trying:
function exportToExcel() {
flexmonster.exportTo('excel', {useCustomizeCellForData: false});
}
function exportToHtml() {
flexmonster.exportTo('html', {useCustomizeCellForData: false});
}
function exportToCsv() {
flexmonster.exportTo('csv', {useCustomizeCellForData: false});
}
 
function customizeToolbar(toolbar) {
    let tabs = toolbar.getTabs();
    toolbar.getTabs = function() {
    tabs = tabs.filter(tab => tab.id != "fm-tab-connect");
    tabs.unshift({
        id: "fm-tab-newtab",
        title: "Commit",
        handler: newtabHandler,
        icon: this.icons.save
    });
 
    let exportTab = tabs.find(tab => tab.id == "fm-tab-export");
    if (!exportTab) return tabs;
    let exportToExcelTab = exportTab.menu.find(tab => tab.id == "fm-tab-export-excel");
    exportToExcelTab.handler = exportToExcel;
    
    let exportToHtmlTab = exportTab.menu.find(tab => tab.id == "fm-tab-export-html");
    exportToHtmlTab.handler = exportToHtml;
 
    let exportToCsvTab = exportTab.menu.find(tab => tab.id == "fm-tab-export-csv");
    exportToCsvTab.handler = exportToCsv;
 
    return tabs;
    }

5 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster January 30, 2024

Hello Jose,

Thank you for reaching out to us.

Currently, the useCustomizeCellForData option is only supported for Excel export. Our team will add the useCustomizeCellForData export property to CSV and HTML exports in our minor release with the ETA February 19th. Our team will notify you about the release.

You are welcome to contact us in case other questions arise.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster February 20, 2024

Hello, Jose,

We are glad to announce that the useCustomizeCellForData property is now available for export to CSV, HTML, and PDF.

This feature is provided in the 2.9.71 version of Flexmonster: https://www.flexmonster.com/release-notes/version-2-9-71/ 

You are welcome to update the component: https://www.flexmonster.com/doc/updating-to-the-latest-version/ 

Please let us know if the feature works fine for you.

Best regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster February 29, 2024

Hello Jose,

Hope you are doing great!

We were wondering if you had a chance to check the updated version. Could you please confirm if it works for you? 

Looking forward to hearing your feedback.

Kind regards,
Nadia

Public
Thiago Santos June 13, 2024

Hello, Nadia!

 

We still getting issues when we export the table to HTML. Some "styling" are lost as you can see on image on attachments.

 

Thank you,

Thiago!

Attachments:
Screenshot_7.png

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster June 19, 2024

Hi Thiago,

Thank you for the response.

We could not reproduce the described behavior. Firstly, we recommend checking if the version is 2.9.71 or higher. Then make sure that you are using useCustomizeCellForData: false with exportTo API call.

We hope it helps.

Kind regards,
Nadia

Please login or Register to Submit Answer