Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODS Excel, how does column width work?! 1

Status
Not open for further replies.

Katie6

Programmer
Jun 12, 2007
58
GB
Hi there,

I'm using ODS to export to Excel (see code below), but I am baffled by the column width option. When I set column width to 20 and another column width to 10, the column set to 20 is not twice as wide as the column width = 10! Can someone explain how the column width works (e.g. what are the units of measurement?), because I am having to use trial and error which is very time consuming?!

Many thanks,

Katie

Code:
	ods tagsets.excelxp style=XLStatistical options
	(sheet_name='Report'
	sheet_interval='none' /*Put more than one table on the same sheet*/
	absolute_column_width='10,15,30,10,15,14,11,10,11,9,17,12,11, 15, 8, 8, 12, 13' /**/
	zoom='100' /*Reduce this number to make the page appear smaller*/
	/*&L = left, */
	Print_header='&L&"Arial,bold"&17Department Name
&14&"Arial,regular"Company&R&"logo"&40abc'
	Print_footer='&L&"Arial"&14&a&RPage &P/&N'
	orientation='Landscape' scale='70'
	AutoFilter='all'
	Frozen_Headers='yes'
	bcolor='#fff'
	hcolor='#5d5d5d'
	);
 
Hi Katie,
I'll be honest, I've used this extensively, but never really paid much attention to the meaning of the numbers in the column width option, and tend to do it alot by trial and error (AKA Sub-it-and-see).
As a general rule, I've found that a 10 digit date takes about "8", and I tend to base it off of that, do an estimate run, then after that, tweak it where necessary. I think most of the problem is probably down to Excels way of dealing with data and files (I.E. it does whatever it damn well pleases with it regardless of what you want).
As for "20" not being double the size of "10", I'd not noticed this, I'll have a play and see if I can work it out later. Sometimes the answer is buried in the XML, if the XML shows a width doubled, then it's down to Excel I'm afraid.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Thanks Chris,

I had a thought that it might be percentages, so I'll investigate that. Just wanted to check that I wasn't being a complete wally and missing something obvious!

Thanks again,

Katie
 
Wally? Now there's a phrase I haven't heard in a while. :)
If you HAVE missed something obvious, it's something I've missed as well.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top