This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Binary Data in CSV Report Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Binary Data in CSV Report" Watch "Binary Data in CSV Report" New topic
Author

Binary Data in CSV Report

sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
Hi,
One of the data is in the binary format(img) and i need to generate the csv report,Hence the better approach would be to use servlets than JSP. Am i right?
regards
sudha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41177
    
  45
Yes, JSPs can't be used to generate binary content; you'll need to use servlets.

But CSV is a text format - it can't handle binary data either. Were you thinking of encoding your binary data so that it becomes ASCII, maybe using something like base-64?


Ping & DNS - my free Android networking tools app
sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
i dont know how to write the img data into the csv. From my understanding, i can write the image data in the csv if i use the base-64 format in the response object..let me try
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41177
    
  45
CSV is ill-suited to handle large data items like an ASCII-encoded image. A better way might be to store the image separately, and just put the name of the image file in the CSV, so that an application reading the CSV can find it. That way you wouldn't need to encode the image, too, thus making it usable as it is (which it wouldn't be if encoded).
 
wood burning stoves
 
subject: Binary Data in CSV Report
 
Similar Threads
Formatting CSV Files using java??
Open CSV file in Excel not IE
Approach to validate objects in list
I want to open an excel report and not its creation at some location
Jasper Csv export : remove title and footer and remove wrap text