Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Export grid without style
posted

Hello,

I am exporting a grid using: $.ig.GridExcelExporter.exportGrid(...);

Can I export the grid without style?

I only watch the options tableStyle and gridStyling, but i can't set none style. 

Thanks you and kind regards.

Parents
No Data
Reply
  • 16310
    Verified Answer
    Offline posted

    Hi Sergio,

    Actually your requirement is achievable right away using the current API. To have the data exported and no style applied you need to:

    1. Set gridStyling to none on the igGridExcelExporter
    2. Clear formatting on the header cells in the headerCellExported callback
    3. Remove the Excel worksheet table (it brings styling with it out of the box) in the exportEnding event

    $.ig.GridExcelExporter.exportGrid($("#grid"), {
      gridStyling: "none"
     },
     {
     headerCellExported: function (e, args) {
      args.xlRow.getCellFormat(args.columnIndex).formatOptions($.ig.excel.WorksheetCellFormatOptions.none);
     },
     exportEnding: function (e, args) {
      args.worksheet.tables().removeAt(0, false);
     },
    });

    Please see this jsfiddle and let mek now if you have other questions, I will be glad to help.

    Hristo

Children