Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Setting format in Excel using perl

by Ratazong (Monsignor)
on Apr 11, 2018 at 06:11 UTC ( #1212654=note: print w/replies, xml ) Need Help??


in reply to Setting format in Excel using perl

Hi jsuresh

As others have shown, it is totally possible to format cells in Excel using perl. However in my experience this is probably not the easiest way.

My typical use-case seems to be similar to yours: fetch some data from some databases, combine it, and present it in Excel-reports. These reports shall be "beautiful", having suitable column widths, suitable text and number formatting, highlighted headers, often cell-borders ...

Creating all this in perl takes time, and makes my code very dependant on the output-format. (E.g. if someone wants the comment-field to be 20% wider, I would have to update the code.)

So I don't start writing to an empty Excel-sheet, but prepare a template. And do all the formatting in this template, using Excel. My script then just writes the data in the corresponding fields/columns, and does not have to care about formatting itself. And finally stores the template under a different filename.

Maybe this approach is also helpful for your future projects

Best regards, Rata

Replies are listed 'Best First'.
Re^2: Setting format in Excel using perl
by jsuresh (Novice) on Apr 11, 2018 at 06:53 UTC
    Hi Rata,

    Yeah, Exactly, I will definitely take your approach for my upcoming projects.Thanks for your support.

    Thanks again,

    Jey

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2020-05-27 22:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (162 votes). Check out past polls.

    Notices?