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
close icon

Printing doesn't show column with template

Hello,

So I needed to use ng-template in my grid to get specific behavior, I've done my templating according to this thread:

But if I apply templates by mentioned method, the printing page shows empty rows.

Reproduced issue link:

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team May 14, 2019 11:48 AM UTC

Hi Domantas, 

Greetings from Syncfusion support. 

We have validated the provided sample and checked with our end. We suggest you to use the below way to resolve the reported problem. Please refer the below code example and sample for more information. 

import { Component, OnInit, ViewChild, Inject, ViewContainerRef, ViewEncapsulation } from '@angular/core'; 
. . . . . 
 
export class AppComponent implements OnInit { 
 
  constructor(@Inject(ViewContainerRef) private viewContainerRef?: ViewContainerRef) { 
 
  } 
 
  ngAfterViewInit(): void { 
    for (let i = 0; i < this.gridColumns.length; i++) { 
      if (this.gridColumns[i]["field"] == "XML") { 
        this.gridColumns[i]["template"] = this.template; 
        this.gridColumns[i]['templateFn'] = templateCompiler(this.gridColumns[i]["template"]); 
        this.template.elementRef.nativeElement._viewContainerRef = this.viewContainerRef; 
        this.template.elementRef.nativeElement.propName = 'template'; 
      } 
    } 
    this.grid.refreshColumns(); 
  } 



Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon