• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How create csv format from existing pdf format in Jsf?

 
Parveen thakur
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends , Good morning to all of you?

I have a problem to create .CSV format in jsf. Actully I have successfully created .PDF files of my jasper report form jrxml in jsf. I have created a BO for fields of jasper report,and crate a seprate dao for database connectivity . and In handler I have write the code to genterate the pdf file now I want to create .csv format using this data ? Please Help me . If any related link with example.


The following code is working fine for Pdf format now I want to create csv format .


Thanks in advance .


Thanks & Regards :

Parveen Thakur.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would do far better to use a servlet or JSP to do this kind of stuff. JSF is designed for forms processing, not document processing, and forcing it to create documents is comparatively messy.

In fact, for a CSV file, a straight JSP without JSF can be quite simple indeed. Essentially, just a useBean tag, a JSTL loop, and template of the CSV line to output with EL expressions to retrieve the row properties.

Plus, of course, the JSP elements that set the content-type.
 
Parveen thakur
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tim ,
Thanks for reply ? I have code for csv ,but now the problem is the report is not show properly when I open it in notepad.It will add ,,,,, with document .....Please see below the repot formt.

and provide some solution for this problem.

My Report,,,,,,,,,
,,,,,,Print Date:,22/06/2012 16.37.45,,
,,,My Report Name,,,,,,
,Product:,,,Firss,,,,,
,, Mode:,,,Firt,,,,
,,,,, DBA,,,,
,,Job Name:,,,,,,,
,,,,,Default,,,,
,, Stream:,,,,,,,
,,,,,FF_None,,,,
,,Moe Mode:,,,,,,,
,,,,,12012,,,,
,,Totald:,,,,,,,
,,,,,5112,,,,
, Rejects:,,,,,,,
,,,,,5000,,,,
,,Total ted:,,,,,,,
,,,,,,,,(Page 1 of,1)
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That, in fact is how it should look in Notepad. Notepad is a dumb text editor and it shows the actual CSV text.

If you want the CSV to display in a more "report-like" format, you need to import it into Excel, not Notepad.
 
Parveen thakur
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tim,
How are you? I am using excel as compare to notepad the report open good , But the problem is that data is not shown under the same column

Please sir suggest me !
Screenshot.png
[Thumbnail for Screenshot.png]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic