You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, i am facing an issue while merging the cells using excelJs, below is the code where i want to merge the cells from B1 to C1, instead of merging the cell it duplicates the value of B1 into C1.See the Attached screenshot.
Lib version: 4.4.0
`async getProjectReport(data) {
try {
// Create a new workbook and add a worksheet for the report
const workbook = new ExcelJS.Workbook();
const worksheet = workbook.addWorksheet('Project Report');
// Add headers for the project data table
worksheet.addRow(['Project No.', 'Project Name']).font = {
bold: true,
};
// merge cells
worksheet.mergeCells('B1:C1');
// Set column widths for the project data table
worksheet.columns = [{ width: 12 }, { width: 30 }, { width: 15 }];
const projectDetailsRow = worksheet.addRow(['1', 'Project Abc']);
// Write the workbook to a buffer and return it
const buffer = await workbook.xlsx.writeBuffer();
return buffer;
} catch (error) {
throw new Error(error);
}
}`
The expected behaviour:
I want an output like the attached screenshot
I also tried the below function to acheive the output i want but got the same result // merge by start row, start column, end row, end column (equivalent to K10:M12) worksheet.mergeCells(1,2,2,3);
The text was updated successfully, but these errors were encountered:
So, i am facing an issue while merging the cells using excelJs, below is the code where i want to merge the cells from B1 to C1, instead of merging the cell it duplicates the value of B1 into C1.See the Attached screenshot.
Lib version: 4.4.0
`async getProjectReport(data) {
try {
// Create a new workbook and add a worksheet for the report
const workbook = new ExcelJS.Workbook();
const worksheet = workbook.addWorksheet('Project Report');
}`
The expected behaviour:
I want an output like the attached screenshot
I also tried the below function to acheive the output i want but got the same result
// merge by start row, start column, end row, end column (equivalent to K10:M12) worksheet.mergeCells(1,2,2,3);
The text was updated successfully, but these errors were encountered: