Skip to content

[ASK] Suggestion - how to further format and stylize generated XLSX file? #149

Discussion options

You must be logged in to vote

Basicly What you suggested and then add some sugar around it to make it work :)

// Implementing WithEvents interface is necessary
class WorkPresenceReportExport extends ExcelExport implements WithEvents
{
    // do not forget use RegistersEventListeners trait
    use RegistersEventListeners;

    // ... REST OF MY CUSTOM EXPORT CODE ...

    public function registerEvents(): array
    {
        return [
            AfterSheet::class => function (AfterSheet $excel) {
                // Get sheet object
                $sheet = $excel->getSheet();

                // Insert rows
                $sheet->insertNewRowBefore(1, 4);

                // Align cell text to center
                $s…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@andrej-gravik
Comment options

@pxlrbt
Comment options

@andrej-gravik
Comment options

Answer selected by pxlrbt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #148 on November 28, 2023 12:20.