开发者

how to embed a live excel spreadsheet in html

hi i would like to know how i can embed a excel spreadsheet in a web page and ch开发者_Python百科ange the excel numbers on the hosted file and this in turn automatically changes the webpage sheet?

would like to know if there is a jquery, javascript, css etc code to help me out

for example, book1.xls will be uploaded to the server and index.html will reflect book1.xls as a table in it. when i update book1.xls, it should automatically show in index.html the changed cells.

thanks in advance


The simple way to actually connect to an XLS is through VBScript, but your server will have to support it (which most do).

Another way would be add an ODBC to your servers connectors pointing to your XLS or MDB or whatever Microsoft data file you choose and use JavaScript or any number of languages to connect to it, retrieve data, make changes, etc. The downside is that you must have Administrative rights to the computer hosting the file. You can use a homecomputer to use as server for that file only for instance and link it to your website, but it will affect loading speeds. This will however require you to take a closer look at your home internet security...!!!...but will enable you to make 'live' changes without going to your website. This method is often used for webshops and online catalogues, places where data can change on a daily basis but a database server is undesirable.

The simplest and easiest way is as mentioned before the use of GoogleDocs, but that will require conversion of the document. You won't be using your XLS as datafile. The downside here is that if you make any changes offline (not through the website) the changes will also not be visible, because you'll be editing a completely different file. So you'll need to convert and upload it to GoogleDocs each and every time.

As you can see the method used greatly depends on how often you plan on updating the data, how much traffic you expect and how secure you want it to be.


A "live" spreadsheet can be shown in a web page via an iframe containing a Google Doc spreadsheet. You cut 'n paste the iframe markup from Google Docs and drop it into your web page. The spreadsheet is editable in GDocs. The iframe view can be set to automatically update when the ss is edited.

Perhaps, this is too bland a solution. But it works. I use it all the time.


I doubt you can do that directly from an .xls file, but if you save your Excel file as .csv, you can read a .csv file via jQuery.

There's a plugin here that displays data from a csv file as a table: http://plugins.jquery.com/project/csv2table

The same/similar question is also asked in these posts:

  • Read Excel data with JQuery
  • How to parse an excel file in JavaScript?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜