[英]Is there any way/working libraries to export my React Table to downloadable excel sheet (xls or xlsx, csv will not work) - React
This is my Demo in CodeSandbox - https://codesandbox.io/s/2wp7jk23kr 这是我在演示CodeSandbox - https://codesandbox.io/s/2wp7jk23kr
If possible, you can kindly fork/modify to show how to introduce this feature to my table. 如果可能,您可以进行派生/修改以显示如何将此功能引入到我的表中。
Yes you can use react-data-export library. 是的,您可以使用react-data-export库。 Just give your table dataset to library.
只需将表数据集提供给库。 Here is an example:
这是一个例子:
<ExcelFile element={<button className="btn btn-primary">Download Excel</button>}>
<ExcelSheet data={this.props.dataSet} name="Employees">
<ExcelColumn label="#" value="sira"/>
<ExcelColumn label="Sicil" value="userID"/>
<ExcelColumn label="T.C. Kimlik No" value="tcKimlikNo"/>
<ExcelColumn label="Adı" value="ad"/>
<ExcelColumn label="Soyadı" value="soyad"/>
<ExcelColumn label="Klavye Türü" value="klavyeTur"/>
</ExcelSheet>
</ExcelFile>
Chech the details from here: https://www.npmjs.com/package/react-data-export 从此处检查详细信息: https : //www.npmjs.com/package/react-data-export
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.