Unix, Perl, IE, and Excel

Discussion in 'Perl Misc' started by cartercc, Oct 23, 2008.

  1. cartercc

    cartercc Guest

    Here is a question that I guess I should know the answer to, but I
    don't. I have a large (7,000 by 9) dataset that I need make available
    to users through a browser.

    This isn't difficult: I open the file, construct a hash of the index,
    put the hash keys in an <select> element, allow the users to select
    the keys they want, and spit out those records in html. Some users
    want to download the data, so I allow users to either print the data
    to their local printer or download a subset of the dataset constructed
    on the fly.

    Here's the question: I have a user who wants the data embedded in an
    Excel worksheet right on the web page. Can this be done? The web
    server is Apache coming from Linux, but Userland is 100% Windows.

    TIA, CC.
    cartercc, Oct 23, 2008
    #1
    1. Advertising

  2. cartercc

    J. Gleixner Guest

    cartercc wrote:
    [...]
    > Here's the question: I have a user who wants the data embedded in an
    > Excel worksheet right on the web page. Can this be done? The web
    > server is Apache coming from Linux, but Userland is 100% Windows.


    Here's an even better question. What does this have to do with Perl?

    If you use your favorite Internet search engine and look for 'embed
    excel' you'd have found possible solutions. e.g. <iframe>, <object>, ...
    J. Gleixner, Oct 23, 2008
    #2
    1. Advertising

  3. cartercc

    cartercc Guest

    On Oct 23, 6:13 pm, "J. Gleixner" <>
    wrote:

    > Here's an even better question. What does this have to do with Perl?


    I'm using Perl as the programming language to build the app. I use
    Perl to construct PDFs, RTFs, XMLs, and other kinds of documents. I
    also use Perl to build files that open natively in Excel, such as
    CSVs. I was thinking that I could construct a file with Perl in a
    format that could be downloaded via an http request that the browser
    would recognize and open in the appropriate application, like MIDI,
    MP3, swf, and so on. Does this have nothing to do with Perl?

    > If you use your favorite Internet search engine and look for 'embed
    > excel' you'd have found possible solutions.  e.g. <iframe>, <object>, ....


    I did. I routinely use iframes to display non-HTML documents such
    as .txt files, so I tried that first, then the object element, and I
    found some applets that pretty closely mimic Excel. I've about
    concluded that this is impossible except with the Microsoft publishing
    Excel as a web service, which I can't do unless I use a Windows
    server.

    CC
    cartercc, Oct 24, 2008
    #3
  4. cartercc

    J.D. Baldwin Guest

    In the previous article, cartercc <> wrote:
    > Here's the question: I have a user who wants the data embedded in an
    > Excel worksheet right on the web page. Can this be done? The web
    > server is Apache coming from Linux, but Userland is 100% Windows.


    I have been mailing Perl-built Excel spreadsheets for some years with
    the excellent Spreadseet::WriteExcel, about which you can read more at

    http://search.cpan.org/dist/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm
    --
    _+_ From the catapult of |If anyone objects to any statement I make, I am
    _|70|___:)=}- J.D. Baldwin |quite prepared not only to retract it, but also
    \ / |to deny under oath that I ever made it.-T. Lehrer
    ***~~~~----------------------------------------------------------------------
    J.D. Baldwin, Oct 24, 2008
    #4
  5. cartercc wrote:
    > Here's the question: I have a user who wants the data embedded in an
    > Excel worksheet right on the web page. Can this be done? The web
    > server is Apache coming from Linux, but Userland is 100% Windows.
    >


    You can use two Perl modules. Spreadseet::WriteExcel or Text::CSV. For MS-EXcel
    you can use a old but simple trick. Create standard *.csv file but change file
    extension to *.xls :)
    --
    Petr Vileta, Czech republic
    (My server rejects all messages from Yahoo and Hotmail.
    Send me your mail from another non-spammer site please.)
    Please reply to <petr AT practisoft DOT cz>
    Petr Vileta \(fidokomik\), Oct 24, 2008
    #5
  6. >>>>> "cc" == cartercc <> writes:

    >> Here's an even better question. What does this have to do with Perl?


    cc> I'm using Perl as the programming language to build the app.

    So? The answer to the question -- which is really about what format
    MSIE expects to receive when it displays an Excel file in the browser
    window -- would be no different if you were using Ruby, or Python, or
    PHP to produce the output. This makes it ipso facto not a Perl
    question.

    Charlton


    --
    Charlton Wilbur
    Charlton Wilbur, Oct 24, 2008
    #6
  7. cartercc <> wrote:
    >On Oct 23, 6:13 pm, "J. Gleixner" <>
    >wrote:
    >
    >> Here's an even better question. What does this have to do with Perl?

    >
    >I'm using Perl as the programming language to build the app.


    And I am using Perl scripts to manage my flight logs. That doesn't make
    questions about aviation on topic in this NG.

    You tell us what output you expect the Perl script to generate and
    chances are very high someone will tell you how to do it.

    You don't know what output you want in the first place, then ask in a
    group that can tell you what kind of output you want, because _THAT_
    answer doesn't change with your choice of programming langauge.

    >CSVs. I was thinking that I could construct a file with Perl in a
    >format that could be downloaded via an http request that the browser
    >would recognize and open in the appropriate application, like MIDI,
    >MP3, swf, and so on. Does this have nothing to do with Perl?


    Question about how to generate a XYZ-format output: yes.
    Question about what format do I need: no.

    jue
    Jürgen Exner, Oct 24, 2008
    #7
  8. J.D. Baldwin wrote:
    > In the previous article, cartercc <> wrote:
    >> Here's the question: I have a user who wants the data embedded in an
    >> Excel worksheet right on the web page. Can this be done? The web
    >> server is Apache coming from Linux, but Userland is 100% Windows.

    > I have been mailing Perl-built Excel spreadsheets for some years with
    > the excellent Spreadseet::WriteExcel, about which you can read more at
    >
    > http://search.cpan.org/dist/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm

    Seemed to me to be a simple "How do I use Perl to interface with
    <application X>?" type question. Thanks JD for a simple, graceous and
    direct answer. I was thinking the same thing, though I had not had the
    need to actually use that particular CPAN module.

    Now why were those other pinheads to rude and dismissive? Perhaps
    because they let their egos come before their intelligence? That's my
    guess...
    --
    Andrew DeFaria <http://defaria.com>
    Friends help you move. Real friends help you move bodies.
    Andrew DeFaria, Oct 24, 2008
    #8
  9. cartercc

    J. Gleixner Guest

    Andrew DeFaria wrote:
    > J.D. Baldwin wrote:
    >> In the previous article, cartercc <> wrote:
    >>> Here's the question: I have a user who wants the data embedded in an
    >>> Excel worksheet right on the web page. Can this be done? The web
    >>> server is Apache coming from Linux, but Userland is 100% Windows.

    >> I have been mailing Perl-built Excel spreadsheets for some years with
    >> the excellent Spreadseet::WriteExcel, about which you can read more at
    >>
    >> http://search.cpan.org/dist/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm

    > Seemed to me to be a simple "How do I use Perl to interface with
    > <application X>?" type question. Thanks JD for a simple, graceous and
    > direct answer. I was thinking the same thing, though I had not had the
    > need to actually use that particular CPAN module.
    >
    > Now why were those other pinheads to rude and dismissive? Perhaps
    > because they let their egos come before their intelligence? That's my
    > guess...


    A better 'guess' would be that your statement was interpreted
    differently, then what you intended.

    I read 'embedded' as they wanted the application (Excel) 'embedded'
    in the Web page, which requires iframe/object.

    Had you written that sentence to say that you wanted to display
    the data from Excel in HTML tables or using CSS, then you would
    have received a pointer to CPAN or Spreadsheet::WriteExcel much
    sooner.
    J. Gleixner, Oct 24, 2008
    #9
  10. J. Gleixner wrote:
    > Andrew DeFaria wrote:
    >> J.D. Baldwin wrote:
    >>> In the previous article, cartercc <> wrote:
    >>>> Here's the question: I have a user who wants the data embedded in
    >>>> an Excel worksheet right on the web page. Can this be done? The web
    >>>> server is Apache coming from Linux, but Userland is 100% Windows.
    >>> I have been mailing Perl-built Excel spreadsheets for some years
    >>> with the excellent Spreadseet::WriteExcel, about which you can read
    >>> more at
    >>>
    >>> http://search.cpan.org/dist/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm
    >>>

    >> Seemed to me to be a simple "How do I use Perl to interface with
    >> <application X>?" type question. Thanks JD for a simple, graceous and
    >> direct answer. I was thinking the same thing, though I had not had
    >> the need to actually use that particular CPAN module.
    >>
    >> Now why were those other pinheads to rude and dismissive? Perhaps
    >> because they let their egos come before their intelligence? That's my
    >> guess...

    > A better 'guess' would be that your statement was interpreted
    > differently, then what you intended.

    My statement? Which statement? You are unclear.
    > I read 'embedded' as they wanted the application (Excel) 'embedded' in
    > the Web page, which requires iframe/object.

    Hmmm... So you read "I have a user who wants the data embedded *in an
    Excel worksheet* right on the web page" as "I have a user who wants the
    data embedded *in the Web page*" then have the nerve to chastise me
    saying that I interpreted the OP's statement wrongly?!?
    > Had you written that sentence to say that you wanted to display the
    > data from Excel in HTML tables or using CSS, then you would have
    > received a pointer to CPAN or Spreadsheet::WriteExcel much
    > sooner.

    Now you are responding to me but talking to somebody else. Get it
    straight dude!
    --
    Andrew DeFaria <http://defaria.com>
    As long as there are tests, there will be prayer in public schools.
    Andrew DeFaria, Oct 25, 2008
    #10
  11. cartercc

    Bart Lateur Guest

    cartercc wrote:

    >Here's the question: I have a user who wants the data embedded in an
    >Excel worksheet right on the web page. Can this be done? The web
    >server is Apache coming from Linux, but Userland is 100% Windows.


    Yes. Look at Spreadsheet::WriteExcel, a Pure Perl module to generate an
    Excel file (pre 2007). No Windows or MS Office required.

    --
    Bart.
    Bart Lateur, Oct 26, 2008
    #11
    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. dpackwood
    Replies:
    3
    Views:
    1,784
  2. Replies:
    12
    Views:
    1,632
    Dave Thompson
    Jan 10, 2005
  3. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,494
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  4. Robert Wallace

    my own perl "dos->unix"/"unix->dos"

    Robert Wallace, Jan 21, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    274
    Michele Dondi
    Jan 22, 2004
  5. dd007
    Replies:
    19
    Views:
    312
    Bart Lateur
    May 13, 2006
Loading...

Share This Page