export sum at the end
Is there a way to sum the totals of an exported table at the end of the excel file automatically ?
34 Replies
Yes, you can sum the totals of an exported table
As far as i know, there are serveral ways to solve it
Do you have a link to the documentation ? I didn't see it here
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export
Just a sum in the current row.
@Takashi do you have any documentation or something I can read to implement this ?
I have no any documentation.
but if you want, I will give you full explanation
Would appreciate that. I already had to do a modifyed query on the table to sum and group alot of the values for export.
Just trying to figure where in the process to add a row on the bottom of the export totalling it with out having to reopen the file
So, did you install the Laravel Excel package?
No using filament to do the export.
Since it is built in
Well, I think you should install Laravel Excel Package first.
composer require maatwebsite/excel
Will I have to rebuild this exporter from scratch ? Why add a package when filament "should" be able to do it ?
it is not absolutely ncessary to install that package.
but using Larave Excel is the most straightforward and powerful way to handle exports in Filament
especially when you need to customize the export
you want to implement this using only Filament?
Aight will look into the documentation of it. And ideally. I already built the export in filament using table data that I plan to expand on. I just trying to figure out how to add a row at the end.
I see, I will share source code with you
Well, I checked it again
but without installing Laravel Excel package, it is impossible to implement
So got to rebuild this thing ?
if you need dynamic Excel features like sum totals or formulas in the exported file, you must use Laravel excel along with Filament
Well I don't need it to be doing functions just out put the data
Cause i need CSV and PDF as well. PDF is the next one i needed to do after this.
so, you want to add the sum totals in the end of CSV or PDF too?
Yep PDF shouldn't be hard since it is just a thing that saves an HTML page as pdf.
right, so, I think we should solve them one by one
CSV and Excel are made together in filament
got it.
Well, filament provide us with only some simple features
you want to use advanced features related to Excel
I think you should install laravel excel package
Aight. Will take a look. This sucks puts me behind schedule what I promised my boss 😦
Well, I can help you if you want
I mean sure. How would you help ?
Installed the excel
Apparently already there for other exports from old dev
how many developers are there in?
Took over from the old dev that moved on haha
Small company
you have any the other projects or jobs for me?
huh ?
Well, I am looking for a job now
Ah. I know my boss doesn't have the budget for any other dev 😦
I am going to be working on a go project soon but need to start that still lol
could you please let me know your skype id or telegram link to keep in touch with you?
I don't use either of those. Just discord and teams
okay, contact me anytime if you need any help!