【问题标题】:UI-Grid exporter - exporting two separate headersUI-Grid 导出器 - 导出两个单独的标题
【发布时间】:2017-04-17 19:13:58
【问题描述】:

在使用 pdfmake 的 AngularJS 中,我能够将标题导出为 pdf。
使用 exporterPdfHeader。

代码如下:

$scope.gridOptions.exporterPdfHeader = {

        margin: [30, 5, 30, 10],

        table: {    
            widths: [ '*', '*', '*' ],

            body: [

              [ 'Region: ' + $scope.region, 'Group: ' + $scope.group, 'MC: ' + $scope.mc /*, 'The last one'*/ ],
              [ 'District #: ' + $scope.district, 'Route #: ' + $scope.route, 'Week Ending Date: ' + $scope.weekEndDate, /*, 'Value 4' */],    


            ]


          }

    };  

现在我要做的是导出另一个标题,其中包含图像。我不能在这个标题中同时做这两个。有没有办法可以导出另一个单独的标题?或者将此标题内的图像创建为单独的行?也许创建另一个gridOptions? (网格选项2)。任何帮助都会有很大帮助。

【问题讨论】:

    标签: javascript angularjs pdf ui-grid pdfmake


    【解决方案1】:

    当您导出 ui-grid 时,我能够在列中创建不同的标题。

    $scope.gridOptions.exporterPdfHeader = {        
                columns: [
                    {           
                    margin: [206, 0, 0, 0],
    
                    image: //long url,
                    width: 200,
                    height: 58,                 
                    },
                    {
                    margin: [ -160, 60, 33, 0 ],
    
                    table: {                        
                        widths: [ '*', '*', '*' ],
    
                        body: [
    
                          [ ],   
                        ]           
    
                      }
    
                    }
                 ]               
        };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-22
      • 1970-01-01
      • 2016-04-11
      • 1970-01-01
      • 1970-01-01
      • 2018-07-23
      相关资源
      最近更新 更多