【问题标题】:Error in exporting pdf in JQgrid在 JQgrid 中导出 pdf 时出错
【发布时间】:2018-11-27 21:11:28
【问题描述】:

我想以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"
                    })
                });

【问题讨论】:

    标签: jqgrid jqgrid-formatter jqgrid-php


    【解决方案1】:

    只有在数据类型设置为本地或 loadonce 参数设置为 true 时,才能导出为 PDF、CSV、Excel。

    为了使导出成为可能,您需要取消注释 loadonce : true 并使其处于活动状态。

    更多关于导出功能可以read here:

    【讨论】:

    • 我将 loadonce 参数设置为 true ,它工作正常。非常感谢。 :)
    猜你喜欢
    • 1970-01-01
    • 2016-04-20
    • 1970-01-01
    • 2018-05-03
    • 2019-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-21
    相关资源
    最近更新 更多