Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

spreadsheet::writeExcel Grouping/Outline

by omikirani (Initiate)
on Sep 16, 2013 at 22:42 UTC ( [id://1054342]=perlquestion: print w/replies, xml ) Need Help??

omikirani has asked for the wisdom of the Perl Monks concerning the following question:

Excel can automatically add Group totals by inserting a row in-between, can spreadsheet::writeExcel do it in similar fashion?
In the example given in documentation, the Group Totals must be programatically derived, could this be automated? I am new to Perl and have enjoyed the ease of generating Excel documents but got stuck here... Thanks.

  • Comment on spreadsheet::writeExcel Grouping/Outline

Replies are listed 'Best First'.
Re: spreadsheet::writeExcel Grouping/Outline
by runrig (Abbot) on Sep 16, 2013 at 22:51 UTC
    Excel can automatically add Group totals by inserting a row in-between, can spreadsheet::writeExcel do it in similar fashion?

    No, you'll have to detect the change in column values and write the subtotal rows yourself. The library won't execute macros for you.

      Thanks for your response. I am actually trying to program a generic Excel reporting module which (for now) does not know how many columns/rows it will have to write to Excel and will not know what columns it should group with.
      Any suggestions on any other perl lib which could run excel macros if I could programatically tell it which column(s) it should use while grouping..
      (At this time I am not aware if the macro commands could be lined up for future execution when the excel file is opened)

        Any suggestions on any other perl lib which could run excel macros..
        Win32::OLE perhaps...if you are running on Windows, and have Excel installed. But really, as you are creating a report, you should know which columns to group by, and which columns to subtotal. Even Excel asks you to confirm if it has guessed correctly when you hit the subtotal button. You could write a 'group by'/subtotal 'these' columns subroutine if you want to be generic about it. But then you would have to write the subtotal rows as you are writing the report, because the non-OLE library (AFAIK) cannot 'insert' rows between already written rows.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-16 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found