Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

create csv file

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how we can create csv file in java and write resultset data inside in tabular form as well as image?
please any one reply as soon as possible.
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSV is simple Coma Seperated Value file you could simple use a PrintWriter to create a file and give it an extension of .csv
 
vipin jain
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
thanks for reply but i alsio want to add image inside csv file.....
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can't put an image in a CSV file, unless you just get the InputStream of the image and read its bytes and store them in the file in some way. and then reconstruct the image in the same way you wrote in the CSV file. however a CSV is used only plain text not for images.
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... so, effectively, you can't keep images inside of CSV files. Would using the XLS file format (used by Excel) be an option? It can accommodate images, and there are Java libraries available that can create them.
 
vipin jain
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Ulf Dittmer ,

Thanks for reply.......
can you please tell me which java library is using for that and if you have that jar please send me.
your every help would be appreciated.
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache POI
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

when it comes to creating excel files, you might want to take a look at jXLS.

jXLS is kind of a templating engine for exel. You create a excel file with tags as a template and jxl populates the template from java beans.

Regards.
Uli
 
Bras cause cancer. And tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!