2016-07-15 80 views
0

我需要打印(發送到打印機)的所有100元在我分頁NG-重複 ,而我在頁面angularjs我需要打印分頁NG重複所有頁面

我試圖用顯示20元AngularPrint,但它沒有工作,因爲它只打印一頁

任何想法請嗎?

這是我的代碼

<table class="table table-bordered"> 
      <thead> 
       <tr class="info"> 
        <th ng-click="sort('client')" class="col-md-1" rowspan="2" style="text-align: center; vertical-align: middle;"> 
         Klant 
         <span class="glyphicon sort-icon" ng-show="sortKey=='client'" 
           ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> 
        </th> 
        <th class="col-md-2" colspan="2" style="text-align: center; vertical-align: middle;"> 
         Total 
        </th> 
        <th ng-click="sort('difference')" class="col-md-1" rowspan="2" style="text-align: center; vertical-align: middle;"> 
         Difference 
         <span class="glyphicon sort-icon" ng-show="sortKey=='difference'" 
           ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> 
        </th> 
        <th ng-click="sort('percentage')" class="col-md-1" rowspan="2" style="text-align: center; vertical-align: middle;"> 
         Difference % 
         <span class="glyphicon sort-icon" ng-show="sortKey=='percentage'" 
           ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> 
        </th> 
       </tr> 
       <tr class="info"> 
        <th ng-click="sort('firstYear')" class="col-md-1" style="text-align: center; vertical-align: middle;"> 
         {{ criteria.firstYear }} 
         <span class="glyphicon sort-icon" ng-show="sortKey=='firstYear'" 
           ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> 
        </th> 
        <th ng-click="sort('secondYear')" class="col-md-1" style="text-align: center; vertical-align: middle;"> 
         {{ criteria.secondYear }} 
         <span class="glyphicon sort-icon" ng-show="sortKey=='secondYear'" 
           ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span> 
        </th> 
       </tr> 
      </thead> 
      <tbody class="searchable"> 
       <tr ng-repeat="stat in stats | orderBy:sortKey:reverse" ng-class="stat.total1 >= stat.total2 ? 'danger-row':'success-row'"> 
        <td>{{ stat.companyAbbrev }}</td> 
        <td class="td-right">&euro; {{ stat.total1 | number : 2}}</td> 
        <td class="td-right">&euro; {{ stat.total2 | number : 2 }}</td> 
        <td class="td-right">{{ stat.difference | number : 2 }}</td> 
        <td class="td-right">{{ stat.percentage| number : 2 }} %</td> 
       </tr> 
      </tbody> 
     </table> 

回答

0

我不知道肯定,但這個聽起來像元素的網格?你用什麼網格?我知道AngularUI Grid已經打印並導出爲ex​​cel功能和大量支持文檔。由於它的範圍,實施起來也可能有點令人生畏。

要回答您對打印功能的評論,請查看此鏈接:exporting data tutorial當您單擊示例中的菜單按鈕並選擇導出到pdf時,它會在單獨的瀏覽器選項卡中打開PDF,您可以保存或打印。

+0

我添加了我的代碼 –

+0

好吧,我看到你選擇使用圖形和角度自己的網格。從靈活性的角度來看,這樣做效果很好,但有時候利用所有準備好的其他解決方案都很好。我在這裏看到的似乎非常適合Angular UI Grid。鑑於它似乎沒有做可編輯的網格材料,重構不應該那麼困難。 –

+1

我可以重構我的代碼,但我想確保找到我的問題的解決方案,什麼是使用的soluation,以便我可以打印完整的網格? –