We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error when exporting grid to PDF

Good Afternoon.
When I'm exporting the grid to PDF and my grid having footer aggregates, in the exporting PDF aggregates are not showing.


Another problem is that after exporting to PDF, in the rendered grid and the last two footers totals are showing multiple times.


Thank you.

Attachment: testej2_b18224e.7z

5 Replies

HJ Hariharan J V Syncfusion Team May 14, 2019 11:55 AM UTC

Hi Isaias, 
  
Thanks for contacting Syncfusion support. 
  
We have validated the reported problem and we found the angular Ng-template have some technical limitation while compiling Ng-template so we suggest you to render the aggregates in type script way to overcome the reported problem.  
  
Please refer the following code example and modified sample for more information. 
 
  <ejs-grid #grid [dataSource]='data' [allowPdfExport]='true' [aggregates]='aggregates'[toolbar]='toolbar' (toolbarClick)='toolbarClick($event)' 
            [allowResizing]="true" [allowGrouping]="true" [groupSettings]="groupOptions"> 
    <e-columns> 
      . . . . 
      <e-column field='Freight' headerText='Freight' type='number' width='120' format='C2'  [enableGroupByFormat]='true'></e-column> 
    </e-columns> 
  </ejs-grid> 
 
  
this.aggregates =  [{ 
      columns: [{ 
          type: 'Sum', 
          field: 'Freight', 
          format: 'C2', 
          groupFooterTemplate: '<b><font color="blue">Tot:${Sum}</font></b>' 
      }] 
    }, 
    { 
        columns: [{ 
            type: 'Sum', 
            field: 'Freight', 
            format: 'C2', 
            footerTemplate: '<b><font color="blue">Gen.Tot:${Sum}</font></b>' 
        }] 
    }]; 
  } 
  
 
  
  
Regards, 
Hariharan 



IC Isaias Chalvatzoglou May 14, 2019 12:53 PM UTC

Hi Hariharan,

Problem solved

Thank you


HJ Hariharan J V Syncfusion Team May 15, 2019 07:05 AM UTC

Hi Isaias,

Thanks for your update.

We are happy to hear that your requirement has been resolved.

Regards,
Hariharan



BA Babar Ali replied to Hariharan J V November 27, 2020 10:28 AM UTC

Hi Isaias, 
  
Thanks for contacting Syncfusion support. 
  
We have validated the reported problem and we found the angular Ng-template have some technical limitation while compiling Ng-template so we suggest you to render the aggregates in type script way to overcome the reported problem.  
  
Please refer the following code example and modified sample for more information. 
 
  <ejs-grid #grid [dataSource]='data' [allowPdfExport]='true' [aggregates]='aggregates'[toolbar]='toolbar' (toolbarClick)='toolbarClick($event)' 
            [allowResizing]="true" [allowGrouping]="true" [groupSettings]="groupOptions"> 
    <e-columns> 
      . . . . 
      <e-column field='Freight' headerText='Freight' type='number' width='120' format='C2'  [enableGroupByFormat]='true'></e-column> 
    </e-columns> 
  </ejs-grid> 
 
  
this.aggregates =  [{ 
      columns: [{ 
          type: 'Sum', 
          field: 'Freight', 
          format: 'C2', 
          groupFooterTemplate: '<b><font color="blue">Tot:${Sum}</font></b>' 
      }] 
    }, 
    { 
        columns: [{ 
            type: 'Sum', 
            field: 'Freight', 
            format: 'C2', 
            footerTemplate: '<b><font color="blue">Gen.Tot:${Sum}</font></b>' 
        }] 
    }]; 
  } 
  
 
  
  
Regards, 
Hariharan 


Hi Hariharan,
Is there any updates regarding this solution by using ng-template in footer or I will use this solution? 


BS Balaji Sekar Syncfusion Team November 30, 2020 12:28 PM UTC

Hi Babar Ali, 
 
Currently we do not have support for render the Aggregate feature through Ng-template so we suggest you to render Aggregate feature using type script way  
 
Regards, 
Balaji Sekar 


Loader.
Live Chat Icon For mobile
Up arrow icon