paramQuery grid to pdf

paramQuery grid to pdf

本文关键字:pdf to grid paramQuery      更新时间:2023-09-26

是否可以将paramQuery网格导出为pdf,或者我该怎么做?这就是我创建网格的方式,我想在pdf文件中显示这个网格

createGrid = function(){
    var obj = { 
        width:"100%",
        height : "100%" , 
        title : "grid" , 
        flexHeight : false ,
        resizable : false ,
        draggable : false , 
        scrollModel: {scrollTillLastRow:false, scrollTillLastColumn:true},
        numberCell : true, 
    } ;
    obj.colModel = [
        { 
            title : "Date" , 
            width : 200 , 
            dataType : "string" , 
            dataIndx : "Date" 
        } ,
        { 
            title : "Name" , 
            width : 200, dataType : "string" , 
            dataIndx : "Name"
        } 
    ] ;
    obj.dataModel = {
        data : lstData //this is the object with the information
    } ;
    obj.width = "460px";
    obj.height = "300px";
    var $grid = $ ( "#grid_json" ).pqGrid ( obj ) ;
}
{
            type: 'select',
            label: 'Format: ',
            attr: 'id="export_format" style= "padding: 5% 0"',
            options: [{
              xlsx: 'Excel',
              csv: 'Csv',
              htm: 'Html',
              json: 'Json',
              pdf: 'pdf'
            }]
          },
          {
            type: 'button',
            label: "Export",
            icon: 'ui-icon-arrowthickstop-1-s',
            listener: function () {
              var format = $("#export_format").val(),
                blob = this.exportData({                     
                  format: format,
                  render: true
                });
              if (typeof blob === "string") {
                blob = new Blob([blob]);
              }
              saveAs(blob, "Cost Modeler." + format);
            }
          }

您只需要在工具栏项目中包含此代码