HalitTalha / ng-material-extensions

Extended features for @angular/material components
Apache License 2.0
101 stars 52 forks source link

Is it possible to export multiple tables? #18

Open andreElrico opened 5 years ago

andreElrico commented 5 years ago

Is it possible to have like a dialog to chose "m" of "n" mat-tables and export those "m" different table data into 1 xlsx with m named sheets? How could we construct something like this?

HalitTalha commented 5 years ago

Unfortunately currently it is not possible. I'll label this as a feature request. I assume we can provide this feature sometime in the future through a service. Thanks for communicating.

pantonis commented 4 years ago

@andreElrico I managed to do that by calling each exporter

<button type="button" class="buttonExport" (click)="table1Exporter.exportTable('csv', {fileName:'Table 1'});table2Exporter.exportTable('csv', {fileName:'Table 2'})">
    <i class="fas fa-file-excel"></i>
    Export
</button>
znotdead commented 4 years ago

@andreElrico I managed to do that by calling each exporter

<button type="button" class="buttonExport" (click)="table1Exporter.exportTable('csv', {fileName:'Table 1'});table2Exporter.exportTable('csv', {fileName:'Table 2'})">
  <i class="fas fa-file-excel"></i>
  Export
</button>

It looks like it's not one file in XLSX format with 2 sheets you are getting in the end.

chriszrc commented 2 years ago

@andreElrico Yes, this is what I ended up using as well. But in my situation, sometimes I'm using multiple tables to display information in a custom format, but I'd like to export as a single sheet. Any way to combine the datasources perhaps?