How to export an amount of records to excel file #2130
Unanswered
nadar
asked this question in
Questions & Problems
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Q:
How to export a number of records to excel file that match some conditions
I don’t know how to do with luya 😃
Please help me!
A:
Use the ExportHelper::xlsx() method with your custom active query => Build any web thing! — LUYA 2 (which is now extracted to a standalone library, all helper classes yii-helpers/ExportHelper.php at master · luyadev/yii-helpers · GitHub 2)
Q:
This is on every crud, but not easy to learn!
And there are 2 states of a button. at first it "Generate Export" after clicked, It become "Download Export"
Is there any way to 1 click to download a file with a defined amount of rows. I think it about active window
The view with something like:
And the callback function like:
How to make it send the file Data-Export.xlsx to start download
A:
Using (https://luya.io/api/luya-admin-ngrest-aw-ActiveWindowFormWidget#$angularCallbackFunction-detail)
you can do anything with the response with javascript (angularjs). Check the response, there should be an url with the file to download, and then maybe something like this:
Hey @mrtrinhvn i just did a quick test, in order to download the given file you can use the following
angularCallbackFunction
value:Beta Was this translation helpful? Give feedback.
All reactions