Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,519
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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.

  • #3
    New Coder
    Join Date
    Jun 2011
    Location
    India
    Posts
    23
    Thanks
    1
    Thanked 1 Time in 1 Post
    You need Office for the Web components to have Excel interactivity on the internet which are not typically available on shared hosting accounts.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,519
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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.


    .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •