Hi
Is there a way to set the width of columns in Excel-output to adjust to the length of the content?
I have made a cli command which automates a transform, but out always have too narrow columns.
Hi
Is there a way to set the width of columns in Excel-output to adjust to the length of the content?
I have made a cli command which automates a transform, but out always have too narrow columns.
No. We donât provide a way to change Excel basic formatting. I think it is unlikely that we are ever going to cover the presentation of the data in Excel (column width, font, bold, italic etc).
OK.
I just noticed I can append to a file. So I should be able to make a standard file and make sure to append to it instead of overwriting. I will try this.
I guess that could work.
I donât know if there is any way to make it work with Excel templates.
I do not use the Excel template format.
Just an .xlsx file with the header and a certain column width as the image below. Then the rows are appended to the file.
My cli setup copies the template file in place before the transformation.
@Admin Has there been any other considerations about setting column width in Excel for version 2?
It is somewhere on the wishlist. But setting the styling of a spreadsheet could be a really time-consuming thing to program. I wonder if a âquick and dirtyâ option would be to allow people to specify an existing spreadsheet as a template and use the styling from that to generate a new spreadsheet.
The option to specify a template could cover my use-case.
Weâll try to find the time to look into it more.
YES !! Template, we just need to ensure the existing formatting of the excel is not touched when writing to it.
if you are dealing with automatically modifying or styling your Excel files, have a look at the great PowerShell-module âImportExcelâ by Doug Finke