Flexgrid export to excel header

Posted by: cgordon on 6 November 2024, 10:07 am EST

    • Post Options:
    • Link

    Posted 6 November 2024, 10:07 am EST

    I am working with the FlexGrid to export excel. The issue I’m having is to add a header/title to the export. Not the column header but the sheet header.

    Any suggestions on how I can accomplish this.

    Thanks

  • Posted 7 November 2024, 3:25 am EST - Updated 7 November 2024, 3:38 am EST

    Hi Craig,

    To add a workbook row at the top of the exported Excel please refer to the following sample application:

    For more information on modifying WorkbookRow, please refer to the following pages of our documentation:

  • Posted 8 November 2024, 9:43 am EST

    Hi,

    I was able to add the row, but unable to style it. I tried setting the cell.style or row.style using wijmo.xlsx.WorkbookStyle.

    styleHeader = new wijmo.xlsx.WorkbookStyle({

    fill: { color: ‘#FFD3D3D3’ },

    font: {

    color: ‘#555555’,

    bold: true,

    size: 24,

    italic: true

    },

    hAlign: ‘Right’,

    wordWarp: true

    });

    How can I set this correctly.

    Thanks

  • Posted 11 November 2024, 1:28 am EST

    Hi Craig,

    It seems that you are incorrectly creating the WorkbookStyle object. The constructor for the WorkbookStyle does not accept any parameters.

    Sample Code:

    _style = new wjXlsx.WorkbookStyle();
    _style = {
            fill: { color: '#FFD3D3D3' },
            font: {
              color: '#555555',
              bold: true,
              size: 24,
              italic: true,
            },
            hAlign: wjXlsx.HAlign.Right,
            wordWarp: true,
          };
    

    For more information on this, please refer to the following pages of our documentation: WorkbookStyle constructor

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels