Is it possible to export a json data getting from a POST method in Angular JS to excel in .csv or .xls format?On click of a button?
Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up
Join them; it only takes a minute:
|
All you have to do is to send a request to your server and this one generates the file, for example csv, and add those headers to the request:
Then your browser will download the file automatically. If you need to generate the file in the browser you can use ng-csv but in my opinion I would use the first one. |
|||
|
before answering your question i would like to know what type of data you are exporting to excel or csv . If u r using ng-csv directive then you can't export your data to excel files . If u are planning ahead to export in other file formats also then there ia a library u can use . alasql.js Here is a link if u are interesed to know more about this library |
|||
|