Excel file being downloaded when Export Button is clicked. The generated Excel file. Browser Compatibility. View Demo. Related Articles. Add Comments. Thank you for the feedback. The comment is now awaiting moderation. You will be notified via email when the author replies to your comment. Please select a comment to reply. CreateResponse HttpStatusCode. OK ; result. To download a file using the AngularJS, you should create a service layer and controller layer to handle your download file.
FromDate, filter. We will convert data to Blob, then you can download it by using saveAs blob, 'Invoice.
FileSaver is the solution for client-side file storage and is perfect for web applications that need to create files or to save sensitive information that shouldn't be sent to an external server.
Improve this answer. Ankesh Ankesh 4, 3 3 gold badges 34 34 silver badges 75 75 bronze badges. I'm getting this error: Type 'Object' is not assignable to type 'BlobPart'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
Type 'Object' is not assignable to type 'string'. No more error. But the problem is I cant get the filename. It returns null. Thank you. I exactly followed your codes and I added Zarna Borda suggestion.
Both your answers complete the solution. Dhaval Dhaval 5 5 silver badges 16 16 bronze badges. Pascal Tovohery Pascal Tovohery 5 5 silver badges 17 17 bronze badges. Like I said I don't want to supply filename in the client, like hello. Di you not read this line? Besides, if really I did not say what I wanted, but clearly I said what I don't want.
Therefore, the least thing you can do is not to suggest what I don't want. Collectives on Stack Overflow. Learn more. How to export data to excel with AngularJS? Ask Question. Asked 5 years, 7 months ago. Active 5 years, 3 months ago.
Viewed 5k times. Improve this question. Musa Tammeny Tammeny 11 1 1 silver badge 5 5 bronze badges. Add a comment.
0コメント