Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-21-2012, 07:10 PM   PM User | #1
guard503
New to the CF scene

 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
guard503 is an unknown quantity at this point
Embed Excel in web page

Hello all. I have a web page and am wanting to embed an excel document into a page so that users can log in and fill out the document (a time sheet) and then have a submit or email button or something similar to save the document on my server with a custom name according to their username or send an email with the document attached.

Any help would be greatly appreciated.

Thanks.
guard503 is offline   Reply With Quote
Old 02-21-2012, 08:51 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,042
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
Whatever they do, save it as a CSV (comma separated variable) file. .csv
Those will automatically open with Excel even if you open it from the website itself.

The only thing you lose is RTF rich text formatting. But I would guess it's the
values that you're interested in, not the Excel sheet layout itself. To me, the .csv
would be the easiest way. You can also combine them all into one .csv before
you open it if you want.

Run this little PHP script test. Save this script as "test.php" run it,
and then try to open the "test.csv" file using your browser.
PHP Code:
<?php
$text
="
Smith, John, 12345, xxx,
Johnson, Richard, 3243, xxx,
Anderson, Jane, 5674, xxx,
"
;
$file="test.csv";
$fw fopen($file'w') or die("can't open file");
fwrite($fw$text);
fclose($fw); 

echo
"<br /><br />
<a href='test.csv'>Open me</a>
"
;
?>
Make sure the directory you upload in has permission to write to a file.


.

Last edited by mlseim; 02-21-2012 at 10:26 PM..
mlseim is offline   Reply With Quote
Old 02-22-2012, 05:55 AM   PM User | #3
nehadas87
New Coder

 
Join Date: Jun 2011
Location: India
Posts: 23
Thanks: 1
Thanked 1 Time in 1 Post
nehadas87 is an unknown quantity at this point
You need Office for the Web components to have Excel interactivity on the internet which are not typically available on shared hosting accounts.
nehadas87 is offline   Reply With Quote
Old 02-22-2012, 02:23 PM   PM User | #4
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,042
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
But I think it's a one-way street.
Excel only needs to be able to FTP a .csv or .xml file to a website directory.
There are no other exchanges of data.

So, it's just a file transfer only.

Either Excel does it, or you save the Excel file as a .csv file and upload it using FTP or PHP.
With limited computer knowledge, the user might not know how to "save-as" and upload the file.
That's why I'm pushing toward the automatic FTP idea.


.
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:43 PM.


Advertisement
Log in to turn off these ads.