From f1fc105a1bde3962e09e06b0a49590521d7a0c6b Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 1 Oct 2025 09:42:01 -0400 Subject: [PATCH] Set minimum width for BOM description column --- ExportDXF/Services/BomExcelExporter.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ExportDXF/Services/BomExcelExporter.cs b/ExportDXF/Services/BomExcelExporter.cs index 7f5051d..cec30e9 100644 --- a/ExportDXF/Services/BomExcelExporter.cs +++ b/ExportDXF/Services/BomExcelExporter.cs @@ -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