2017-04-17 38 views
0

在使用pdfmake的AngularJS中,我能夠將標題導出爲pdf。
使用exporterPdfHeader。UI-Grid導出器 - 導出兩個單獨的標題

下面是代碼:

$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? (gridOptions2)。任何援助將是一個很大的幫助。

回答

0

在列內我可以在導出UI網格時創建不同的頭文件。

$scope.gridOptions.exporterPdfHeader = {   
      columns: [ 
       {   
       margin: [206, 0, 0, 0], 

       image: //long url, 
       width: 200, 
       height: 58,     
       }, 
       { 
       margin: [ -160, 60, 33, 0 ], 

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

        body: [ 

         [ ], 
        ]   

        } 

       } 
      ]    
    };