We are trying to make csv file from the data fetching from mysql db using java.Based on the requirement don't want to save the csv anywhere instead the client need to directly download it.All this should work in a single click.In front end we are using angularjs. Can anyone guide as with the best way to implement the requirement.Thanks in advance.
Asked
Active
Viewed 58 times
-2
-
[create CSV file in java](https://stackoverflow.com/questions/10462507/any-good-library-to-read-and-write-csv-files) and send it to the user – Kepotx Jun 27 '18 at 08:29
-
You have to start with something: write the code to export the DB into CSV with fixed destination in the file system. then work from there to get destination from user – Sharon Ben Asher Jun 27 '18 at 08:30
-
how is it any different from generating html from db data? You are still doing some text formatting. – gagan singh Jun 27 '18 at 08:42
1 Answers
-1
You could try with this library for Angular JS: ng-csv. First of all get the data in your controller, make an array with your data and use it with ng-csv as described in the github repository page. It takes less than 10 minutes to make it work.

Bastián Díaz Olave
- 52
- 5
-
Please don't post framework recommendations as an answer. Also, please refrain from telling people something "takes less than 10 minutes" or that something is easy - someone unfamiliar with this may require significantly longer, and may not be easy to them. Aside from that: The question itself is off-topic, as it's very broad, and there simply isn't a "best" way. – David Makogon Jul 01 '18 at 00:56