Export fails with TextColumn::make()->numeric() in Filament v4 (The column [x] is not mounted to a table) #234
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing information
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pxlrbt/filament-excel#234
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi 👋
I’m running into an issue when trying to export a Filament v4 table that contains a numeric column defined like this:
in my UsersTable.php
And after I try to export I got this error: The column [age] is not mounted to a table.
Steps to reproduce
Thanks for reporting. I try to reproduce and fix this in the upcoming weeks.
I have the same problem with
->dateTime()columnsSame error with a custom query that adds a raw select that's not in the model.
@howdu Can you share the code for that?
@pxlrbt yeah realised it's specifically when using numeric: https://flareapp.io/share/xPQdBgXm
Seems to be erroring when it hits this line and calls
getTableon the column.I have the exact same issue with ->money()
Works without it.
While the problem is being fixed, and for anyone interested, you can use money(), numeric(), etc. in your tables without getting an error if you format the columns in which you have used them in the ExcelExport::make(). NumberFormat has lots of formats you can use. An example:
Yep, same problem here, with numbers and dates
@pxlrbt This is again an issues since the v3.2.1 version
@Jacobtims Duuh, thanks for reporting. That version was supposed to fix the issue for queues, too. I need to look into this.
@Jacobtims I just tested this with
->numeric()but didn't get an issue. Can you share an example that's not working?I have the problem on the following table columns:
The datetime columns are casted in my model class:
@Jacobtims Hope this helps - I had the same issue and I manage to fix date columns ->dateTime() by adding a default date time format like this:
->dateTime('d.m.Y H:i')
@KasparAas That makes sense. Maybe the easiest fix would be to provide a default format for the export.
I made some progress on this one. Just need to figure out how to fix the queued exports. 😵💫
Hey everybody, I hoped this issue is fixed with the latest version. Please try and report any issues. Thanks!