netcloudesigns/titleloan-public — Issue #21: Reports in Rails
Author: zeroelink
Created: 2012-02-24 05:48:50+00:00
State: open
Labels: moderate

setup view to display reports. each report may need a query input like a date (you'll have to convert this to epoch when you send it to me). i'll provide you a call you call that returns the pdf data. you'll need code like this to do the download:

output_format = "PDF"
filename = params[:action]+" on "+Time.now.iso8601+"."+ output_format.downcase
puts "FILENAME IS " + filename;
mime_type = Mime::Type.lookup_by_extension(output_format.downcase);
# puts "MIMETYPE IS " + mime_type
send_data(pdf_data, :type => 'application/pdf',
:disposition => 'inline', :filename => filename)