My client wants to be able to display a .xls spreadsheet on a webpage eachday.

Is this possible?

How is this done?

Thanks,

Kevin.

    Yes, it's possible.

    By providing a link to the spreadsheet, and telling the web server to serve it with a Content-Type of application/vnd.ms-excel.

      I don't want to link to the .xsl file. It must be displayed on the webpage itself.

      How do I do this?

      thanks,

      Kevin.

        What do you want with the excel file? Show it as and excel spreadsheet? Of table, or?

        Anyway. there is a bnch of functions out there. If it is CSV you could just read the file with fgetcsv

          OK I'll explain the entire olan. Please could you help me out with it.

          1/ Admin uploads excel file into database table.

          2/ Webpage displays the contents of excel file - either as table or as an excel file embedded in html.

          3/ So the end user just visits the webpage and before his/her eyes are the contents of the excel file.

          How do I do this please?

          Thanks,

          Kevin.

            Thanks leatherback.

            Been looking at that. Doesn't give any examples on displaying the excel file content though.

            Do you know where I can find any examples or tutorials on this?

            Thanks,

            Kevin.

              8 days later

              Anyone know of any tutorials on the Spreadsheet_Excel_Reader???

                from the helpfile INCLUDED in the package:

                INTRODUCTION
                Read data from Excel spread sheets without Microsoft!
                Provides an API to allow any application to read Excel
                documents. Written in PHP. Based on the the Java version by Andy Khan.

                LINKS

                OpenOffice.org's Documentation
                http://sc.openoffice.org/excelfileformat.pdf

                OLE2 Storage Documentation
                http://jakarta.apache.org/poi/poifs/fileformat.html

                Java API for reading, writing and modifying the contents of Excel spreadsheets
                http://www.andykhan.com/

                CONTACT
                Vadim Tkachenko
                vt@apachephp.com

                INFO
                For use encoding you must have installed iconv extension, otherwise data output in unicode

                HOW TO USE
                see example.php

                  Hi,

                  The below code is to display all data from an excel page in a table. How do I fix the table right for it to display correctly.

                  How do I set font type, size, color, etc. I want to make it small enough to fit on my webpage.

                  thanks.

                  <table>
                  <tr>
                  <?php
                  
                  echo '<table>';
                  echo '<tr><td></td><td>';
                  
                  for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) {
                  	for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) {
                  		echo '</td><td></td><td>';
                  		echo $data->sheets[0]['cells'][$i][$j];
                  		echo '</td></tr>';
                  	}
                  	echo "\n";
                  
                  }
                  
                  echo '</td><tr></tr>';
                  echo '</table>';

                  Kevin.

                    OK. It displays roight now. Only that it add a load of empty rows and columns.

                    Any idea why this is so??

                    Here's my code now...

                    echo '<table>';
                    echo '<tr><td></td><td>';
                    
                    for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) 
                    {
                     	echo '<tr><td>';
                    	for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) 
                    	{
                    		echo $data->sheets[0]['cells'][$i][$j];
                    		echo '</td><td></td><td>';
                    	}
                    	echo '</td></tr>';
                    	echo "\n";
                    
                    }
                    
                    echo '</td><tr></tr>';
                    echo '</table>';

                    Using CSS for the formatting anyway.

                    Cheers,

                    Kevin.

                      Write a Reply...