Skip to main content
Solved

Excel Writer and column widths and text formatting


vxn43
Supporter
Forum|alt.badge.img+17

Hello, 

I am exporting addresses from an Enterprise GDB into an Excel spreadsheet. I have created the Excel Writer, and it successfully writes the data to the spreadsheet. But when I open the spreadsheet, the column widths are crazy wide, and the names are not bold or centered. Is there a way to control the column widths and column names (make them bold and centered)?

 

The screenshot below shows the Excel Writer (“Template”) and the parameters I have set. 

 

Best answer by s.jager

By default the Excel writer sets the column width to whatever the data type is. But if you set them all to 0 on the User Attributes tab of the writer, it will actually set the width of the column to whatever is the widest value in that column (Similar to what Excel itself does when you select the whole sheet, and double-click on the border between two columns in the Excel header!).

You can also freeze the first row under Advanced:

Not everything you want, but it already makes a difference.

View original
Did this help you find an answer to your question?

3 replies

crutledge
Enthusiast
Forum|alt.badge.img+28
  • Enthusiast
  • March 15, 2025

Hi ​@vxn43 

I hear you. Sometimes you look at the excel output from a workbench and it’s just unreadable. Then we end up re-formatting everytime.

As a solution I would suggest taking that output spreadsheet and format it how you want it. Names, Column Widths, even colours, etc(pic1 below). You can then save this as _template.xlsx and use it as a template in the Parameters of the Excel Writer(pic 2 below). As long as your Address Table and Output from the Workbench retains the same schema (which it should) then you can start writing the data at Row 2, Output Field names=No (pic 3 below) and that should work well for you.

It takes just a quick sec to set up and then never have to worry about it again.

Hope that helps! Good Luck!
 

 


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • March 16, 2025

Another solution would be to edit the Cell Width and Formatting under the User Attributes section of your writer Feature Type. The ExcelStyler may also be helpful. Just depends what you are trying to do what will work best.


s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • Best Answer
  • March 17, 2025

By default the Excel writer sets the column width to whatever the data type is. But if you set them all to 0 on the User Attributes tab of the writer, it will actually set the width of the column to whatever is the widest value in that column (Similar to what Excel itself does when you select the whole sheet, and double-click on the border between two columns in the Excel header!).

You can also freeze the first row under Advanced:

Not everything you want, but it already makes a difference.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings