title: PrimeNG export to CSV
body: <p>I have a <code>PrimeNG grid</code> and the data served by the <code>PrimeNG</code> is from a service which have server side paginated data and from the server we would receive only our current page record.</p>
  
  <p>I have my <code>HTML</code> code as below:</p>
  
  <pre><code> &lt;p-dataTable *ngIf="displayTable" #dataTable [value]="JSONArray"
              [lazy]="true" [responsive]="true" [rows]="10"
              [paginator]="true" selectionMode="single" 
              [(selection)]="selectedEvent" 
              (onRowSelect)="onRowSelect($event)" 
              [pageLinks]="5" [(first)] = "first"
              class="ui-datatable-scrollable-wrapper view-table" 
              [totalRecords]="totalRecords" (onLazyLoad)="loadCarsLazy($event)"&gt;
              &lt;p-header&gt;
                  &lt;div class="ui-helper-clearfix"&gt;
                      &lt;button type="button" pButton icon="fa-file-o" iconPos="left"
                    label="CSV" (click)="dataTable.exportCSV()" style="float:left"&gt;
                      &lt;/button&gt;
                  &lt;/div&gt;
              &lt;/p-header&gt;
              &lt;p-column field="col1" header="Column 1"&gt;&lt;/p-column&gt;
              &lt;p-column field="col2" header="Column 2"&gt;&lt;/p-column&gt;
              &lt;p-footer&gt;
                  &lt;div&gt;
                  &lt;/div&gt;
              &lt;/p-footer&gt;
  &lt;/p-dataTable&gt;
  </code></pre>
  
  <p><code>JSONArray</code> variable will only have 10 records (my page size), but we want to export all the data from the server. Let say I have 5 page, I would like to export all the 50 records.</p>
  
  <p><code>dataTable.exportCSV()</code> is only exporting my current page 10 record only. Is there any way to export all the 50 records?</p>