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

export : create multiple file #279

Closed
cheanj opened this issue Nov 24, 2014 · 1 comment
Closed

export : create multiple file #279

cheanj opened this issue Nov 24, 2014 · 1 comment

Comments

@cheanj
Copy link

cheanj commented Nov 24, 2014

Hi Thank you for your awesome package.

I wonder if it also allows to create multiple file via Export to CSV.

I tried this but it export only ONE file.

Excel::create('generalInfo', function($excel) use ($general_info) {
$excel->sheet('General Info', function($sheet) use($general_info) {
$sheet->loadView('exports.general_info', $general_info);
});

    })->download('csv');

Excel::create('personalInfo', function($excel) use ($personalInfo) {
$excel->sheet('PersonalInfo', function($sheet) use($general_info) {
$sheet->loadView('exports.personal_info', $personalInfo);
});

    })->download('csv');

Thanks for your help.

@MaatwebsiteSupport
Copy link
Contributor

It's impossible to download multiple files in the same request. You can store() multiple files and later download them as a zip file.

coursera-ricardor added a commit to coursera-ricardor/Laravel-Excel that referenced this issue Oct 21, 2019
Based on the Documentation:

"Both Reader and Sheet have a ->getDelegate() method which returns the underlying PhpSpreadsheet class. This will allow you to add custom macros as shortcuts to PhpSpreadsheet methods that are not available in this package."

Please confirm if It applies to other Events. _(Same change proposed for AfterImport at the moment)_

Reader.php returns 
- a Workbook Object when calling getDelegate()
- a IReader Object when calling getPhpSpreadsheetReader()

Result: 

```
Xlsx {SpartnerNL#280 ▼
  -referenceHelper: ReferenceHelper {SpartnerNL#279}
  #readDataOnly: true
  #readEmptyCells: true
  #includeCharts: false
  #loadSheetsOnly: array:2 [▶]
  #readFilter: DefaultReadFilter {SpartnerNL#271}
  #fileHandle: null
  #securityScanner: XmlScanner {SpartnerNL#291 ▶}
}

```
coursera-ricardor added a commit to coursera-ricardor/Laravel-Excel that referenced this issue Oct 21, 2019
Based on the Documentation:

"Both Reader and Sheet have a ->getDelegate() method which returns the underlying PhpSpreadsheet class. This will allow you to add custom macros as shortcuts to PhpSpreadsheet methods that are not available in this package."

Please confirm if It applies to other Events. _(Same change proposed for AfterImport at the moment)_

Reader.php returns 
- a Workbook Object when calling getDelegate()
- a IReader Object when calling getPhpSpreadsheetReader()

Result: 

```
Xlsx {SpartnerNL#280 ▼
  -referenceHelper: ReferenceHelper {SpartnerNL#279}
  #readDataOnly: true
  #readEmptyCells: true
  #includeCharts: false
  #loadSheetsOnly: array:2 [▶]
  #readFilter: DefaultReadFilter {SpartnerNL#271}
  #fileHandle: null
  #securityScanner: XmlScanner {SpartnerNL#291 ▶}
}

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants