1

Here is the component.html code.

<ejs-pivotview #pivotview id='PivotView'
[dataSourceSettings]=dataSourceSettings
allowExcelExport='true'
allowConditionalFormatting='false'
allowPdfExport='true'
showToolbar='true'
allowCalculatedField='true'
showFieldList='true'
showGroupingBar='true'
[chartSettings]='chartSettings'
expandAll='true'
exportAllPages='true'
enableVirtualization='true'
height='500'
[gridSettings]='gridSettings'
[displayOption]='displayOption'
locale='es'
[toolbar]='toolbarOptions'
width="getWidth()"
>

And in component.ts

import {
    FieldListService, CalculatedFieldService,
    ToolbarService, ConditionalFormattingService,
   ToolbarItems, DisplayOption, GroupingBarService,
   IDataOptions, VirtualScrollService
} from '@syncfusion/ej2-angular-pivotview';
//...
//...
declare var require: any;
@Component({
  selector: 'app-repo-pivote',
  templateUrl: './repo-pivote.component.html',
  //encapsulation: ViewEncapsulation.None,
  styleUrls: ['./repo-pivote.component.css'],
  providers: [CalculatedFieldService, ToolbarService, ConditionalFormattingService, FieldListService, GroupingBarService,VirtualScrollService]
})

Data is over 30K rows.

With this error.

enter image description here

When I drop the enableVirtualization parameter it exports well.

UPDATE

This is a simple project that shows the problem.

https://stackblitz.com/edit/angular-ivy-747r19?file=src/app/app.component.html

  • Please provide a minimal reproducible example that clearly demonstrates the issue you are facing. https://stackoverflow.com/help/minimal-reproducible-example Ideally someone could drop the code into a online IDE like https://stackblitz.com and immediately get to work solving the problem without first needing to re-create it. – Juan Vicente Berzosa Tejero Dec 28 '21 at 09:43
  • I created a small project on stackblitz.com to recreate the problem, the error doesn't appear but when the excel button is clicked, nothing happens, if the enableVirtualization='true' property is deleted, it exports well, but for the data amount the page begins to lag. – Alejandro Vargas Dec 28 '21 at 19:10

1 Answers1

0

I could resolve it with this

import {
  ExcelExportService,
  PDFExportService,
} from '@syncfusion/ej2-angular-pivotview';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  encapsulation: ViewEncapsulation.None,
  styleUrls: ['app.component.css'],
  providers: [
    ExcelExportService,
    PDFExportService,
  ],
})

In the import I added ExcelExportService and PDFExportService, also in the component providers too.