in reply to How to create pivot tables via perl?

rafa,

Check out Creating Pivot tables from Perl, I provided a non Perl solution to this problem which may be of use to you. Populating the Excel file with your data from the database should not be a problem.

Update: If you do need help querying your database check out the DBI module along with Database Programming. Regards using Win32::OLE with Excel have a look at Using Win32::OLE and Excel - Tips and Tricks from the tutorials section of this site. If you have an issue with anything I have mentioned (or anything else related to this task) let us know.

Hope this helps.

Martin
  • Comment on Re: How to create pivot tables via perl?

Replies are listed 'Best First'.
Re^2: How to create pivot tables via perl?
by rafa (Novice) on Feb 01, 2007 at 18:39 UTC
    Thanks Martin. I have read your reply on this query before and have also looked into the other links you mentioned. I'm gonna look again and see if there's anything I missed.

    Most of my knowledge on this are only based on examples I found on the web. As commented by an Anonymous Monk on "Using Win32::OLE and Excel - Tips and Tricks", I too have yet to stumble upon documentation containing all the valid fields and subfields. An example is how to format all the cells of a column as a Number with 2 decimal places, stuff like that.

    To ww, I did try to look for it in "Super Search", but I really haven't found what I am looking for. Just hoping that this time someone can give me an answer. Thanks for the advice nonetheless.

    Rafa

      The easy way is, as always with MS Office automation, to record whatever you're doing with the macro recorder and then translate the created VB code to Perl.

        Thanks for your reply. I tried it and I think it would be the easiest way to go. One can easily translate the basic VB code to Perl. Problem will be converting those that are a little complicated. Have you tried using the Perl Dev Kit on this?
      In addition to the fantastic advice Corion has provided for you, please check out the resources I link to in Re: Excel VB Controls.

      If you hit any problems post the code and the monks will do their best to help you.

      Cheers

      Martin
Re^2: How to create pivot tables via perl?
by smithers (Friar) on Feb 03, 2007 at 22:24 UTC
    You might also consider placing your pivot code in the database in the form of a stored procedure. This centralizes your pivot logic and opens up additional options (i.e. google on pivot table for Oracle PL/SQL or SQL server s-procs, etc. and you will find ample examples).