Forum: Ruby on Rails How to change CSV properties.....

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 venkat yejarla (Guest)
on 2006-05-18 06:36
(Received via mailing list)
Hello Good morning to all,


I am doing reports in ruby on rails,i am trying to export data throgh
excel in CSV format.Now i want to set the font to the text exported to
excel sheet.How can i set font..please help me regarding this ...


my sample code was like this...

report = StringIO.new
CSV::Writer.generate(report, ',') do |csv|
	csv << ['Invoice History List']
	csv << [nil,"#{((@start_date).to_s).gsub('-','/')}"]
	csv << [nil]
end

report.rewind
send_data(report.read,
	:type => 'text/csv; charset=iso-8859-1; header=present;',
	:filename => 'invoicehistoryreport.csv', :disposition => 'attachment')




please help me regarding this issue...
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-18 08:43
(Received via mailing list)
venkat yejarla wrote:
> Hello Good morning to all,
>
>
> I am doing reports in ruby on rails,i am trying to export data throgh
> excel in CSV format.Now i want to set the font to the text exported to
> excel sheet.How can i set font..please help me regarding this ...
>
<snip>
> please help me regarding this issue...

CSV files are raw text.  They have no concept of representational
formatting.  Fonts are the responsibility of the application that reads
them, not something you'll have any control over at the web-app end.
This topic is locked and can not be replied to.