Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last page data is missing in the export #157

Open
BoppertF opened this issue Oct 26, 2022 · 1 comment
Open

Last page data is missing in the export #157

BoppertF opened this issue Oct 26, 2022 · 1 comment
Assignees
Labels
bug Something isn't working exporter

Comments

@BoppertF
Copy link

BoppertF commented Oct 26, 2022

Angular CLI: 6.2.9
Node: 14.18.1
Angular: 6.1.10
mat-table-exporter: "^1.2.5"
angular/material: "6.4.7"

Hello,
I found this issue: Last page data is missing in the export for large datasets #14
but there was no solution to it.

I got the same error in my project. However, the last page is generally not included. Not just for large datasets.
I found a solution. In your implementation you use following code line:
public getPageCount(): number { return this.getPaginator().getNumberOfPages(); }

My solution was to add " + 1" :
public getPageCount(): number { return this.getPaginator().getNumberOfPages() + 1; }

I think the problem comes with paginator.getNumberOfPages() returning "0" for one page and "1" for two pages and so on.

Since I'm not able to update my project angular version yet, a fix for the older version would be great.

@HalitTalha HalitTalha added bug Something isn't working exporter labels Oct 27, 2022
@HalitTalha HalitTalha self-assigned this Oct 27, 2022
@HalitTalha
Copy link
Owner

Hi @BoppertF , thank you for tracking this down.
This used to work, actually, maybe the indexing behavior has changed after a specific angular release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter
Projects
None yet
Development

No branches or pull requests

2 participants