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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Printing doesn't show column with template

Thread ID:





144501 May 9,2019 09:25 AM UTC May 14,2019 11:48 AM UTC Angular - EJ 2 1
Tags: Grid
Asked On May 9, 2019 09:25 AM UTC


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:

Thavasianand Sankaranarayanan [Syncfusion]
Replied On 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'; 

Thavasianand S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon