Want to export more than 100 Columns and 400k Rows #2855

Open
opened 4 weeks ago by skyrbs · 3 comments
skyrbs commented 4 weeks ago

Hi Team,

I am trying to export the json data into xlsx file format. Below is one code

const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json); // At this step my page angular getting blank / unresponsive

    const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['file'] };
    
    const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer', bookSST:true,  });
    
    this.saveAsExcelFile(excelBuffer, excelFileName);

I was only able to generate 65k row with this columns counts. i have uploaded the example file format for 1 rows and 106 columns

Thanks in advance for your help.

Hi Team, I am trying to export the json data into xlsx file format. Below is one code ``` const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json); // At this step my page angular getting blank / unresponsive const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['file'] }; const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer', bookSST:true, }); this.saveAsExcelFile(excelBuffer, excelFileName); ``` I was only able to generate 65k row with this columns counts. i have uploaded the example file format for 1 rows and 106 columns Thanks in advance for your help.
Owner

~40M rows will take a while but it should work.

Try dense mode:

const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json, {dense: true});
~40M rows will take a while but it should work. Try dense mode: ```js const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json, {dense: true}); ```
skyrbs commented 3 weeks ago
Poster

Hi Team,

adding dense is giving compile error(screenshot attached). I am using version "xlsx": "^0.18.5"

I have converted aoa_to_sheet also giving dense error(screenshot attached). Without dense only working till 65K rows and 132 Columns

const wb = XLSX.utils.book_new();
    const outputData = json.map( Object.values );
    console.log("Total No of Columns ", Object.keys(json[0]));
    outputData.unshift(Object.keys(json[0]));
    const ws = XLSX.utils.aoa_to_sheet (outputData, { dense:true});
    XLSX.utils.book_append_sheet(wb, ws);
    console.log("File Downloading Started ");
    XLSX.writeFile(wb, excelFileName + EXCEL_EXTENSION,{compression:true, bookType: 'xlsx', type: 'array', bookSST:true});
Hi Team, adding dense is giving compile error(screenshot attached). I am using version "xlsx": "^0.18.5" I have converted aoa_to_sheet also giving dense error(screenshot attached). Without dense only working till 65K rows and 132 Columns ``` const wb = XLSX.utils.book_new(); const outputData = json.map( Object.values ); console.log("Total No of Columns ", Object.keys(json[0])); outputData.unshift(Object.keys(json[0])); const ws = XLSX.utils.aoa_to_sheet (outputData, { dense:true}); XLSX.utils.book_append_sheet(wb, ws); console.log("File Downloading Started "); XLSX.writeFile(wb, excelFileName + EXCEL_EXTENSION,{compression:true, bookType: 'xlsx', type: 'array', bookSST:true}); ```
Owner

You will need to update to 0.19.0 or later. See https://docs.sheetjs.com/docs/getting-started/installation/frameworks for more details.

You will need to update to 0.19.0 or later. See https://docs.sheetjs.com/docs/getting-started/installation/frameworks for more details.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2855
Loading…
There is no content yet.