简体   繁体   English

在网站上显示带有图表的 Excel 电子表格

[英]To Display Excel Spreadsheet with Charts on Websites

Is there anyway to display Excel Spreadsheet with charts (Live, does not need to be editable) on Websites?无论如何要在网站上显示带有图表(实时,不需要可编辑)的 Excel 电子表格?

Currently I have some Excel reports with charts.目前我有一些带有图表的 Excel 报告。 I am building a website to display these spreadsheet data.我正在建立一个网站来显示这些电子表格数据。 The spreadsheet doesn't need to be editable.电子表格不需要可编辑。 But I want it to be displayed right away, instead of a link downloading it locally every time and open it.但我希望它立即显示,而不是每次都在本地下载并打开它的链接。

Is there anyway easy way I can do this?有没有简单的方法可以做到这一点?

Some methods that I have researched but would not work in my case:我研究过但在我的情况下不起作用的一些方法:

  1. Google Doc谷歌文档

  2. Saving as html output in excel (I want it to be automatically. All the spreadsheet generation/ HTML code creation would be in linux)在 excel 中保存为 html 输出(我希望它是自动的。所有电子表格生成/ HTML 代码创建都在 linux 中)

  3. Sharepoint共享点

Thanks!谢谢!

I would suggest to utilize Excel Services for that purpose.我建议为此目的使用Excel Services

Prerequisite: Excel Services service application has to be configured先决条件:必须配置Excel Services 服务应用程序

Prepare excel data准备excel数据

Assume the following excel file假设有以下excel文件

在此处输入图片说明

that contains the following items in the workbook:包含工作簿中的以下项目:

Important: Before uploading file into SharePoint library, go to File -> Browse View Options -> choose Items in the Workbook as demonstrated below.重要提示:在将文件上传到 SharePoint 库之前,请转到File -> Browse View Options -> choose Items in the Workbook如下所示。 Then save file and upload it into SharePoint Documents library.然后保存文件并将其上传到 SharePoint Documents库。

在此处输入图片说明

Once the excel file is uploaded into Documents library the chart could be rendered in browser using the following endpoint:将 excel 文件上传到Documents库后,可以使用以下端点在浏览器中呈现图表:

Url: https://contoso.sharepoint.com/_vti_bin/ExcelRest.aspx/Documents/sample.xlsx/Model/Charts('Chart1')
Method: GET

Results结果

Display chart on page via ScriptEditor /ContentEditor web part通过ScriptEditor /ContentEditor Web 部件在页面上显示图表

Content: <img src="/_vti_bin/ExcelRest.aspx/Documents/sample.xlsx/Model/Charts(%27Chart1%27)" alt=""/>

在此处输入图片说明

References参考文献

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

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