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

How to have multiple sheets and also give specific column names to the same? #344

Open
SawantTejas opened this issue Dec 29, 2023 · 0 comments

Comments

@SawantTejas
Copy link

I want to specify different column names for multiple sheets having different columns

Consider the following example where I have two sheets: Product Validity and ID Warranty. Now I want to specify different names for the fields of both sheets. How do I achieve that? Currently I am able to only mention Product Name and it applies to both sheets. I want to have a different name for the second sheet. I am unable to find any reference to achieve this so far

$sheets = new SheetCollection([
            'Product Validity' => $data1
            'ID Warranty' => $data2
        ]);
return (new FastExcel($sheets))->download('Export.xlsx', function($event){
            return [
                'Product Name' (ID Name) => $event->key, 
                'Product Validity' (ID Warranty) => $event->date, 
            ];
        });

Would appreciate any help or guidance for the same.

@SawantTejas SawantTejas changed the title [QUESTION] How to have multiple sheets and also give specific names to the same? [QUESTION] How to have multiple sheets and also give specific column names to the same? Dec 29, 2023
@SawantTejas SawantTejas changed the title [QUESTION] How to have multiple sheets and also give specific column names to the same? How to have multiple sheets and also give specific column names to the same? Mar 4, 2024
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

1 participant