Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Writing Excel Spreadsheets -- suggestions sought

by glenn (Scribe)
on Sep 13, 2013 at 14:08 UTC ( [id://1053945]=note: print w/replies, xml ) Need Help??


in reply to Writing Excel Spreadsheets -- suggestions sought

Not sure what your collecting or how the excel module works but could you not just watch for the longest string length and use that value at the end?
my $col_width = 10; #default ...#code if (length($variable) > $col_width) { my $col_width = length($variable); } #set column width

Replies are listed 'Best First'.
Re^2: Writing Excel Spreadsheets -- suggestions sought
by SuicideJunkie (Vicar) on Sep 13, 2013 at 14:24 UTC

    The trick is in determining the width of the text in pixels/"inches" rather than characters, so you can set the column width.

    However, there's an easy solution to that; set the text in that column to be a fixed-width font.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1053945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-03-19 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found