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

Print problems

Hello,

I have problems with printing grid.

1. I am having different grids in my program. When I try to print first grid for the first time - I get data correctly. After that I am trying to print different grid I get data from WebAPI but in print dialog I see "No records to display" and header like previous grid:
First try to print:


Second try to print different grid:

But with this try in my Network tab I can see that data from WebAPI was get correctly:



2. I am getting data for my grid using WebAPI. I am getting  records and also count. How can I get this count number in my component?

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team August 23, 2019 10:42 AM UTC

Hi AC, 
 
Greetings from Syncfusion support. 
 
Query 1: Showing “No records to display” when we click for print Grid.  
 
We have prepared a sample with your mentioned scenario but unfortunately we are unable to reproduce the issue from our end. 
 
 
Please provide the following details for better assistance. 
 
  1. Share the complete Grid rendering code.
  2. If possible try to reproduce the issue in the attached sample.
  3. Whether the mentioned issue is reproducing when we click for print else if we do some other operations after clicking the print.  
  4. Do you have WebAPI adaptor in both Grid sample ?
 
Query 2: How can I get this count number in my component? 
 
We can get the total records count in Grid by using the pageSettings API in Grid. 
 
In the below code example we have get the total records count in an external button click event. 
 
[app.component.html] 
 
<button id="RecordCount" (click)="RecordCountClick()">Get total record count</button> 
 
----------------------------------------------------------------------------------------------------------------------- 
[app.component.ts] 
 
export class AppComponent { 
 
    . . . . 
     
    RecordCountClick(args) { 
        console.log(this.grid.pageSettings.totalRecordsCount) 
    } 
 
    . . . . 
 
} 
 
 
We have prepared  a simple sample in the following link. 
 
 
Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon