简体   繁体   English

如何将Excel工作表嵌入网页以进行编辑并将其上传到数据库

[英]How to embed excel sheet to web page for editing and uploading it into database

--> I'm getting iframe code to embed in microsoft excel. ->我正在将iframe代码嵌入到Microsoft Excel中。 But I can see the sheet only in the web page. 但是我只能在网页上看到表格。

--> I want to edit the embedded sheet and I want to add a button to upload that embedded sheet into test link database. ->我要编辑嵌入表,并想添加一个按钮将嵌入表上传到测试链接数据库中。 Can anyone please help me? 谁能帮帮我吗? Is there any plugin to do it? 有插件可以做吗?

Method 1. You can create a google spreadsheet and there is an option to publish it to web and get the embed code for iframe. 方法1.您可以创建一个Google电子表格,并且可以选择将其发布到网络上并获取iframe的嵌入代码。 The iframe code can now be used in any webpage. 现在,可以在任何网页中使用iframe代码了。 The sheet will get displayed in the webpage but you wont be able to edit the cells. 该工作表将显示在网页中,但您将无法编辑单元格。

Method 2. You can create a google spreadsheet. 方法2。您可以创建一个Google电子表格。 You can directly use the spreadsheet url (eg: https://docs.google.com/spreadsheets/d/1jTvLJsqOVOnmCrNCCqoUs9vRJkYrD_kJRLyY/edit#gid=0 ) which you see in your browser's address bar and use it as the src to iframe in your webpage. 您可以直接使用在浏览器的地址栏中看到的电子表格网址(例如: https : //docs.google.com/spreadsheets/d/1jTvLJsqOVOnmCrNCCqoUs9vRJkYrD_kJRLyY/edit#gid=0 )并将其用作对iframe进行内嵌的src网页。 The spreadsheet will get displayed in your webpage and you can also edit the cells in it. 该电子表格将显示在您的网页中,您也可以在其中编辑单元格。 Thanks to the x-frame-options header which google has not applied/checked. 多亏了Google尚未应用/检查的x-frame-options标头

Sync Data between Sheet and DB: 在工作表和数据库之间同步数据:

  1. You can write a macro code/ Google Script function which will get triggered/ executed on various events such as sheet open, row edited, button clicked etc. In the code you can create a JDBC connection to your database such as MYSQL, MSSQL, Mongo etc and sync the rows as per your logic. 您可以编写一个宏代码/ Google Script函数,该函数将在各种事件(如打开表,编辑行,单击按钮等)时触发/执行。在代码中,您可以创建与数据库的JDBC连接,例如MYSQL,MSSQL,Mongo等等,并根据您的逻辑同步行。 https://developers.google.com/apps-script/ https://developers.google.com/apps-script/

  2. You can also use plugins such as Zapier, Kloud.io etc to sync the data (Bidirectional) between the sheet and your preferred DB. 您还可以使用Zapier,Kloud.io等插件在工作表与首选DB之间同步数据(双向)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM