Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Customize Igx Grid Excel Export Background Color

Customize Igx Grid Excel Export Background Color

New Discussion
Vikram Reddy
Vikram Reddy asked on Jul 20, 2022 1:37 PM

HI Team,

After exporting igx – grid  to excel . The excel is background color is in blue and white color as per our application constancy i need to display in white color . Could you please  help me in this . please find attached screen shots expected and actual  result.

Thanks

Vikram

Sign In to post a reply

Replies

  • 0
    Georgi Anastasov
    Georgi Anastasov answered on Jul 20, 2022 1:37 PM

    Hello, Vikram

    I have been looking into your question and after an investigation I have determined that by design when you are using the IgxExcelExporterService the grid is exported as table with default design. In order to export the data in different format or use different table design I could suggest using our Excel Library and create a custom button in the grid's toolbar similar to the default which would create a new workbook with the required content on click.

    In order to use the Excel Library you need to add the following dependencies: "file-saver", "igniteui-angular-core" and "igniteui-angular-excel" as well as the Excel Utility class.

    Afterwards, you could load the grid's data into worksheet and export it to Excel without creating a table which would look similar to the attached screenshot. A sample illustrating my suggestion could be found here.

    If you need to create excel table with such content my suggestion is to create a WorksheetTable and set its style in order to display the data depending on your requirement my suggestion is using the following approach which I left as comment in the attached sample:

    worksheet.tables().add("A1:D" + (this.localData.length + 1), true, workbook.standardTableStyles().item("TableStyleLight1"));
    worksheet.tables(0).displayBandedRows = false;

    Please test it on your side and let me know if you need any further assistance with this matter.

    Regards,

    Georgi Anastasov

    Software Developer

    Infragistics

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Vikram Reddy
Favorites
0
Replies
1
Created On
Jul 20, 2022
Last Post
3 years, 7 months ago

Suggested Discussions

Created by

Created on

Jul 20, 2022 1:37 PM

Last activity on

Feb 17, 2026 8:08 AM