Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/routes/excelGenerator/excelGeneratorModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export const ExcelGeneratorRequestBodySchema = z
title: z.string().optional().openapi({
description: 'The title of the table, which will be displayed in the first row.',
}),
startCell: z.string().openapi({
description: "The starting cell (e.g., 'A1') where the table will begin.",
startCell: z.string().optional().default('A1').openapi({
description:
"The starting cell (e.g., 'A1') where the table will begin. Defaults to A1 if not specified.",
}),
columns: z
.array(
Expand Down
2 changes: 1 addition & 1 deletion src/routes/excelGenerator/excelGeneratorRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function execGenExcelFuncs(sheetsData: SheetData[], excelConfigs: ExcelCo

sheetsData.forEach(({ sheetName, tables }) => {
const worksheet = workbook.addWorksheet(sheetName);
tables.forEach(({ startCell, title, rows = [], columns = [], skipHeader }) => {
tables.forEach(({ startCell = 'A1', title, rows = [], columns = [], skipHeader }) => {
const startCol = columnLetterToNumber(startCell[0]); // Convert column letter to index (e.g., 'A' -> 1)
const startRow = parseInt(startCell.slice(1)); // Extract the row number (e.g., 'A1' -> 1)
let rowIndex = startRow; // Set the initial row index to startRow for each table
Expand Down