@@ -151,14 +151,6 @@ function SearchBox<T extends string>({ | |||||
}); | }); | ||||
}); | }); | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Style for cell A1: Font size 16 and bold | // Style for cell A1: Font size 16 and bold | ||||
if (worksheet['A1']) { | if (worksheet['A1']) { | ||||
worksheet['A1'].s = { | worksheet['A1'].s = { | ||||
@@ -202,6 +194,14 @@ function SearchBox<T extends string>({ | |||||
while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | ||||
lastRowOfFirstTable++; | lastRowOfFirstTable++; | ||||
} | } | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Format filename with date | // Format filename with date | ||||
const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | ||||
@@ -151,14 +151,6 @@ function SearchBox<T extends string>({ | |||||
}); | }); | ||||
}); | }); | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Style for cell A1: Font size 16 and bold | // Style for cell A1: Font size 16 and bold | ||||
if (worksheet['A1']) { | if (worksheet['A1']) { | ||||
worksheet['A1'].s = { | worksheet['A1'].s = { | ||||
@@ -202,6 +194,14 @@ function SearchBox<T extends string>({ | |||||
while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | ||||
lastRowOfFirstTable++; | lastRowOfFirstTable++; | ||||
} | } | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Format filename with date | // Format filename with date | ||||
const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | ||||
@@ -151,14 +151,6 @@ function SearchBox<T extends string>({ | |||||
}); | }); | ||||
}); | }); | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Style for cell A1: Font size 16 and bold | // Style for cell A1: Font size 16 and bold | ||||
if (worksheet['A1']) { | if (worksheet['A1']) { | ||||
worksheet['A1'].s = { | worksheet['A1'].s = { | ||||
@@ -202,6 +194,14 @@ function SearchBox<T extends string>({ | |||||
while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | ||||
lastRowOfFirstTable++; | lastRowOfFirstTable++; | ||||
} | } | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Format filename with date | // Format filename with date | ||||
const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | ||||
@@ -151,14 +151,6 @@ function SearchBox<T extends string>({ | |||||
}); | }); | ||||
}); | }); | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Style for cell A1: Font size 16 and bold | // Style for cell A1: Font size 16 and bold | ||||
if (worksheet['A1']) { | if (worksheet['A1']) { | ||||
worksheet['A1'].s = { | worksheet['A1'].s = { | ||||
@@ -202,6 +194,14 @@ function SearchBox<T extends string>({ | |||||
while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | ||||
lastRowOfFirstTable++; | lastRowOfFirstTable++; | ||||
} | } | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Format filename with date | // Format filename with date | ||||
const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | ||||
@@ -151,14 +151,6 @@ function SearchBox<T extends string>({ | |||||
}); | }); | ||||
}); | }); | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Style for cell A1: Font size 16 and bold | // Style for cell A1: Font size 16 and bold | ||||
if (worksheet['A1']) { | if (worksheet['A1']) { | ||||
worksheet['A1'].s = { | worksheet['A1'].s = { | ||||
@@ -202,6 +194,14 @@ function SearchBox<T extends string>({ | |||||
while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | while (worksheet[XLSX.utils.encode_cell({ c: 0, r: lastRowOfFirstTable })]) { | ||||
lastRowOfFirstTable++; | lastRowOfFirstTable++; | ||||
} | } | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Format filename with date | // Format filename with date | ||||
const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | ||||
@@ -151,14 +151,6 @@ function SearchBox<T extends string>({ | |||||
}); | }); | ||||
}); | }); | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Style for cell A1: Font size 16 and bold | // Style for cell A1: Font size 16 and bold | ||||
if (worksheet['A1']) { | if (worksheet['A1']) { | ||||
worksheet['A1'].s = { | worksheet['A1'].s = { | ||||
@@ -205,6 +197,14 @@ function SearchBox<T extends string>({ | |||||
// Insert the first data form into the worksheet at the desired location | // Insert the first data form into the worksheet at the desired location | ||||
XLSX.utils.sheet_add_aoa(worksheet, firstTableData, { origin: { c: 0, r: lastRowOfFirstTable } }); | XLSX.utils.sheet_add_aoa(worksheet, firstTableData, { origin: { c: 0, r: lastRowOfFirstTable } }); | ||||
// Apply calculated widths to each column, skipping column A | |||||
worksheet['!cols'] = colWidths.map((width, index) => { | |||||
if (index === 0) { | |||||
return { wch: 8 }; // Set default or specific width for column A if needed | |||||
} | |||||
return { wch: width + 2 }; // Add padding to width | |||||
}); | |||||
// Format filename with date | // Format filename with date | ||||
const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | const today = new Date().toISOString().split('T')[0].replace(/-/g, '_'); // Get current date and format as YYYY_MM_DD | ||||