如何在.net中使用jQuery导出excel,pdf的动态数据表

问题描述:

如何动态数据表导出excel,pdf在.net中使用jQuery



函数ExportExcel(){

$( #btnExportExcel)。点击(功能(e){

window.open('data:application / vnd.ms-

how to do dynamic data table to export excel , pdf using jQuery in .net

function ExportExcel() {
$("#btnExportExcel").click(function (e) {
window.open('data:application/vnd.ms-

(#btnExportExcel)。点击(function(e){

window.open('data: application / vnd.ms-
("#btnExportExcel").click(function (e) {
window.open('data:application/vnd.ms-


首先你必须以json或者json的形式检索数据表xml客户端使用ajax。

之后使用它..



first of all you have to retrive datatable in form of json or xml an client side using ajax.
after that use this..

window.open('data:application/vnd.ms-excel,' + your data(in json or xml format));







另一种方法是根据你的数据格式创建html表e(隐藏)。






Another way create html table as per your datatable formate (hidden).

window.open('data:application/vnd.ms-excel,' +


' #yourDivData')。html());
('#yourDivData').html());