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.

  • 16310
    Offline posted

    Hello Sergio,

    After investigating your inquiry and doing some research, exporting the grid without styles has been determined to be a product idea. You can suggest new product ideas for future versions (or vote for existing ones) at <https://www.infragistics.com/community/ideas>.

    Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.

    Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.

    Thank you in advance to submitting your product idea.

  • 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

  • 70
    Offline posted in reply to Hristo Anastasov

    Yes, in your jsfiddle if you export, the first row (header) is fix in the excel.

    I want not fix any row