I'm working on my first custom dashboard with a Excel export button on it.
What I want to do is onclick of the button in the dashboard call a method witch exports the excel and start a download to a client.
Where I am now:
I have a controller with a method that exports the excel if I call it directly in the url. It returns a response with a excel file generated with epplus.
On the dashboard I have a button and I can call the url. The file it downloads is not the excel file but something that looks like a guid without a extension.
How can I get the generated file (response) to go to the backoffice?
I found a simple solution, that's putting the link to the file in the href of anchor. But now there is no way to check if something went wrong wile generating the file.
So for me the preferred way would be to run it through a angular controller.
As I remembered this was a security issue in my case and I ended up using the workaround stated above. We dropped the client so I didn't investigate further. I am curious if you find anything though.
I got it to work, but had to manually edit the dashboard config file :( hopefully v8 is a bit better for modding.
I am outputting my file from a controller which is using the UmbracoAuth and the button on the panel uses a POST form submission. The controller function returns a FileResult object that I construct in my code, this automatically becomes a download when returned.
I dislike angular (why the overhead of two lots of MVC patterns?) so I avoid using it whenever possible.
Excel export in custom dashboard
Hi all,
I'm working on my first custom dashboard with a Excel export button on it.
What I want to do is onclick of the button in the dashboard call a method witch exports the excel and start a download to a client.
Where I am now:
I have a controller with a method that exports the excel if I call it directly in the url. It returns a response with a excel file generated with epplus.
On the dashboard I have a button and I can call the url. The file it downloads is not the excel file but something that looks like a guid without a extension.
How can I get the generated file (response) to go to the backoffice?
Thanks a lot guys!! Frans
I found a simple solution, that's putting the link to the file in the href of anchor. But now there is no way to check if something went wrong wile generating the file.
So for me the preferred way would be to run it through a angular controller.
Anybody?
I am doing this at the moment, I will let you know if I find a solution, did you find anything that does not require modding the core config file?
Wow, this is a while ago :P
As I remembered this was a security issue in my case and I ended up using the workaround stated above. We dropped the client so I didn't investigate further. I am curious if you find anything though.
:D
I got it to work, but had to manually edit the dashboard config file :( hopefully v8 is a bit better for modding.
I am outputting my file from a controller which is using the UmbracoAuth and the button on the panel uses a POST form submission. The controller function returns a FileResult object that I construct in my code, this automatically becomes a download when returned.
I dislike angular (why the overhead of two lots of MVC patterns?) so I avoid using it whenever possible.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.