Author Topic: PQGrid export - left align numeric column header in excel file  (Read 436 times)

gopigupta

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 37
    • View Profile
PQGrid export - left align numeric column header in excel file
« on: November 14, 2022, 03:44:04 pm »
I am using standard grid export function to export grid data into excel. The export is working correctly but the only issue I am facing is the alignment of numeric column's headers(float, int datatypes). They are aligning to right and I want them to be left aligned. I tried to use halign: "left" property which shows column header left aligned on grid but in the export file column header appears right aligned. I am using FlieSaver.js file to save blob into excel.

Please let me know any work around.


below code is used to export grid into excel file.

function ExportGridView() {
    blob = gridobj.exportData({
        format: 'xlsx',
        nopqdata: true,
        render: true,
    });
    if (typeof blob === "string") {
        blob = new Blob([blob]);
    }
    saveAs(blob, "filenametest.xlsx');   //call to FileSaver.js file
}
« Last Edit: November 14, 2022, 05:37:47 pm by gopigupta »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: PQGrid export - left align numeric column header in excel file
« Reply #1 on: November 15, 2022, 05:12:30 pm »
Header styles are not exported to Excel.

You can make the export 2 step process ( grid -> workbook -> xlsx ), identify the cell in workbook and add align property to the cell.