Hi @layaRaja-3410,
To set the column widths you need to create a Columns element which can contain one or more Column children.
Each Column class can apply to more than one column in the Excel file. The Min and Max properties define the first and last column that the Column applies to (inclusive).
For example, you could use the following code to set the column width in the WriteExcelFile method:
The WriteExcelFile method: 219735-sourcecode.txt
Then the generated excel like this: by using the above columns, the first and second columns' width is 20, the third and fourth columns' width is 50, and other columns is the default width.
Note1: Any columns not covered by the Column classes will have a default width.
Note2: All properties of the column (Min, Max, Width, CustomWidth) should be specified. Otherwise Excel will decide that the file is corrupted.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion