• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How create csv format from existing pdf format in Jsf?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 28140
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 28140
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic