       worksheet.getRow(currentRow + lastRowIndex).height = 25; // adjust height for Total

            worksheet.getRow(currentRow).height = 30; // adjust height for Heading

            // Auto-adjust column widths
            worksheet.columns.forEach(column => {
                let maxLength = 2;
                column.eachCell({ includeEmpty: true }, cell => {
                    const value = cell.value ? cell.value.toString() : '';
                    maxLength = Math.max(maxLength, value.length);
  