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

Adding style to sheets #40

Closed
ghotgalkar opened this issue Mar 9, 2014 · 3 comments
Closed

Adding style to sheets #40

ghotgalkar opened this issue Mar 9, 2014 · 3 comments

Comments

@ghotgalkar
Copy link

How do you use the view across all the sheets? Currently only the first sheet has the styles in the view applied to it. The code I use is below:

$excel_file = Excel::loadView("export.excel")
->sheet('Daily')->with( $daily_array )->setColumnWidth( $widths )->setColumnFormat( $formats )
->sheet('Hourly')->with( $hourly_array )->setColumnWidth( $widths )->setColumnFormat( $formats )
->setTitle('WebsiteExport');

$excel_file->export('xls');

The Column width and format works fine.

@ghotgalkar ghotgalkar reopened this Mar 9, 2014
@ghotgalkar
Copy link
Author

I have currently sorted this by using the PHPExcel object inside laravel4-PHPExcel object

@MaatwebsiteSupport
Copy link
Contributor

Sorry for the late answer, soon we will look into a more Laravalesque way of doing it :)

@MaatwebsiteSupport
Copy link
Contributor

Example usages:

Excel::loadView('excel.reports')
    ->sheet('Daily', function($sheet) use($dailyReports) {

        $sheet->withReports($dailyReports);

    })->sheet('Weekly', function($sheet) use($weeklyReports) {

        $sheet->withReports($weeklyReports);

    })->setTitle('Reports')->export('xls');

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