JQgrid导出pdf报错
Error in exporting pdf in JQgrid
我想以pdf形式导出详细信息file.Pdf已下载但只有headers表示产品,数量,价格,总计仅缺少内容的body表示产品详情。
$("#list_records_view").jqGrid({
url: "view.php?name="+sample,
datatype: "json",
mtype: "GET",
colNames: ["Product", "Price", "Qty", "Total", "Date"],
colModel: [
{ name: "product" },
{ name: "price" },
{ name: "qty" },
{ name: "total" },
{ name: "date" }
],
pager: "#perpageview",
rowNum: 10,
rowList: [10,20],
sortname: "id",
sortorder: "asc",
height: 200,
width: 780,
viewrecords: true,
//loadonce: true,
gridview: true,
//editurl: "clientArray",
caption: ""
});
$("#export").on("click", function(){
$("#list_records_view").jqGrid("exportToPdf",{
title: 'Customer Report',
orientation: 'portrait',
pageSize: 'A4',
description: 'Purchase Report',
customSettings: null,
download: 'download',
includeLabels : true,
includeGroupHeader : true,
includeFooter: true,
fileName : "jqGridExport.pdf"
})
});
仅当数据类型设置为本地或 loadonce 参数设置为 true 时,才能导出为 PDF、CSV、Excel。
为了使导出成为可能,您需要取消注释 loadonce : true 并将其激活。
关于导出特征的更多信息可以是 read here:
我想以pdf形式导出详细信息file.Pdf已下载但只有headers表示产品,数量,价格,总计仅缺少内容的body表示产品详情。
$("#list_records_view").jqGrid({
url: "view.php?name="+sample,
datatype: "json",
mtype: "GET",
colNames: ["Product", "Price", "Qty", "Total", "Date"],
colModel: [
{ name: "product" },
{ name: "price" },
{ name: "qty" },
{ name: "total" },
{ name: "date" }
],
pager: "#perpageview",
rowNum: 10,
rowList: [10,20],
sortname: "id",
sortorder: "asc",
height: 200,
width: 780,
viewrecords: true,
//loadonce: true,
gridview: true,
//editurl: "clientArray",
caption: ""
});
$("#export").on("click", function(){
$("#list_records_view").jqGrid("exportToPdf",{
title: 'Customer Report',
orientation: 'portrait',
pageSize: 'A4',
description: 'Purchase Report',
customSettings: null,
download: 'download',
includeLabels : true,
includeGroupHeader : true,
includeFooter: true,
fileName : "jqGridExport.pdf"
})
});
仅当数据类型设置为本地或 loadonce 参数设置为 true 时,才能导出为 PDF、CSV、Excel。
为了使导出成为可能,您需要取消注释 loadonce : true 并将其激活。
关于导出特征的更多信息可以是 read here: