adding an excel worksheet to a generetad excel file via perl

Discussion in 'Perl Misc' started by FlorianKraft@gmx.de, Apr 17, 2007.

  1. Guest

    Hi,

    I'm currently working an a solution for exporting data from an oracle
    database into an excel file, which is produced daily und therefore
    kept up-to-date.

    The solution works nice, the file is exported evey day with correct
    data - but there's a small flaw. For the usage of this data a
    disclaimer is provided as an extras excel worksheet within the
    workbook - the problem is, that currently every small change (e.g.
    management, contact, etc.) mut be implemented as a series of functions
    bulding up the extra sheet and adding it to the gernerated file - it
    thereby feels as if one has to do it manually all the time, which
    requires some unterstanding of the code as well as time, as the
    disclaimer data often changes in its measures (cell widths, etc.)

    I now had the idea to change this system, allowing normal users to
    easily access the disclaimer and thereby stop punishing me with
    senseless extra work for every small change. Therefore i made an extra
    Excel file, containing just the disclaimer so it could be easy for
    anyone to change it.

    The problem now is - how do i add such a file as an extra worksheet? i
    tried some things up to now - which involves completely parsing it via
    Spreadsheet::parseExcel, spllitting up the data in an array and a hash
    (cell contens and cell formats) an then trying to rewrite it via
    Spreadsheet::WriteExcel. It seems somehow incompatble when writing the
    data read (as it is somehow complicated to find out backgroundcolours,
    internal graphics, cell-merging, and so on)

    I do not have the option of another module (Win32::OLE will not work
    due to the fact that i just have a Linux System) nor do i have the
    time for a complete rewrite of the original code of the export script.

    So does anyone have an idea how to read a single worksheet of an
    existing excel file (e.g. disclaimer.xls) and adding it into a
    generated one?

    thanks,

    florian
     
    , Apr 17, 2007
    #1
    1. Advertising

  2. Mirco Wahab Guest

    wrote:
    > [a] disclaimer is provided as an extras excel worksheet within the
    > workbook - the problem is, that currently every small change (e.g.
    > management, contact, etc.) mut be implemented as a series of functions
    > bulding up the extra sheet and adding it to the gernerated file - it
    > thereby feels as if one has to do it manually all the time, which
    > requires some unterstanding of the code as well as time, as the
    > disclaimer data often changes in its measures (cell widths, etc.)
    >
    > I now had the idea to change this system, allowing normal users to
    > easily access the disclaimer and thereby stop punishing me with
    > senseless extra work for every small change. Therefore i made an extra
    > Excel file, containing just the disclaimer so it could be easy for
    > anyone to change it.
    >
    > The problem now is - how do i add such a file as an extra worksheet? i
    > tried some things up to now - which involves completely parsing it via
    > Spreadsheet::parseExcel, spllitting up the data in an array and a hash
    > (cell contens and cell formats) an then trying to rewrite it via
    > Spreadsheet::WriteExcel. It seems somehow incompatble when writing the
    > data read (as it is somehow complicated to find out backgroundcolours,
    > internal graphics, cell-merging, and so on)


    Of course I don't know all of the complexities
    involved with your xls report generation, but
    here's how I'd do that ...

    You said the problem is some "small other excel file"
    with necessary extra data - that gets updated occasionally?

    An excel table is in most cases 'a table'. Therefore, I'd
    write a small Perl script that reads the 'extra file' at
    times and puts it into a new table of the main db (oracle
    or whatever) if something changed.

    On generation of the "real report" xls, I'd just 'select'
    the data together with the real data and put each in its
    place in the generated file.

    Don't know if that would work in your case,

    Regard

    M.
     
    Mirco Wahab, Apr 17, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. harshan
    Replies:
    0
    Views:
    526
    harshan
    Jul 20, 2004
  2. =?Utf-8?B?U2hhbyBZb25n?=

    How to delete an Excel worksheet by using ASP.NET?

    =?Utf-8?B?U2hhbyBZb25n?=, May 10, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    1,140
    Martin Dechev
    May 12, 2004
  3. dd007
    Replies:
    0
    Views:
    424
    dd007
    May 24, 2006
  4. Pam
    Replies:
    7
    Views:
    331
  5. Katja
    Replies:
    1
    Views:
    217
Loading...

Share This Page