Set minimum width for BOM description column

This commit is contained in:
AJ
2025-10-01 09:42:01 -04:00
parent 58269f9761
commit f1fc105a1b

View File

@@ -285,10 +285,22 @@ namespace ExportDXF.Services
{
worksheet.Column(col).AutoFit();
if (worksheet.Column(col).Width > MAX_COLUMN_WIDTH)
// Special handling for Description column (assuming it's column 4)
if (col == 4) // Description column
{
worksheet.Column(col).Width = Math.Max(worksheet.Column(col).Width, 30); // Minimum 30 units
if (worksheet.Column(col).Width > 50) // Maximum 50 units
worksheet.Column(col).Width = 50;
}
else if (worksheet.Column(col).Width > MAX_COLUMN_WIDTH)
{
worksheet.Column(col).Width = MAX_COLUMN_WIDTH;
}
else
{
worksheet.Column(col).Width += COLUMN_PADDING;
}
}
// Add borders if enabled