我想以pdf文件的形式导出详细信息.Pdf已下载,但只有标题表示产品,数量,价格,总数仅缺少内容的正文表示产品详细信息。
$("#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"
})
});
答案 0 :(得分:0)
只有将数据类型设置为local或loadonce参数设置为true,才能导出为PDF,CSV,Excel。
为了使导出成为可能,您需要取消注释loadonce:true并使其处于活动状态。
有关导出功能的更多信息可以是read here: