Unix, Perl, IE, and Excel

C

cartercc

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.
 
J

J. Gleixner

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>, ...
 
C

cartercc

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
 
J

J.D. Baldwin

P

Petr Vileta \(fidokomik\)

cartercc said:
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 :)
 
C

Charlton Wilbur

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
 
J

Jürgen Exner

cartercc said:
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
 
A

Andrew DeFaria

J.D. Baldwin said:
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...
 
J

J. Gleixner

Andrew said:
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.
 
A

Andrew DeFaria

J. Gleixner said:
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!
 
B

Bart Lateur

cartercc said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top