Width of columns in Excel-output

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.

1 Like

@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.

1 Like

YES !! Template, we just need to ensure the existing formatting of the excel is not touched when writing to it.

2 Likes

if you are dealing with automatically modifying or styling your Excel files, have a look at the great PowerShell-module “ImportExcel” by Doug Finke :+1:

2 Likes

See Excel styling templates

1 Like