Printing quality documents (invoices, etc..) from rails

Thanks for the info alex

All i really want to do is easily print quality invoice (+other)
documents from within Rails. THe info is already in the mysql
database, so rails has full access.

Is there an easy way to do it?

Thanks,
Chris

I’m just about to cross this bridge myself with an app I’m working on.
PDF::Writer seems to be a pretty good solution - you can make a PDF
file look pretty much as good as you want, and PDF::Writer seems to be
a good compromise between ease of use and capability as far as
generating PDFs goes.

Check the sample code to see how it works.

Regards

Dave M.

I’m looking at using JasperReports with rails:

http://wiki.rubyonrails.org/rails/pages/HowtoIntegrateJasperReports

Looks interesting.

Has anyone had any experience with JasperReports?

It is used in a java project that I’m on at work. I haven’t had too much
contact with that
part of the project, but the guy who’s doing it seems very pleased with
Jasper reports. I
think it might not be as powerful/easy-to-use/well-documented as the
$$$$ report engines
out there, but it’s hard to beat for the price.

I skimmed through this wiki page and have to say that the “execute a
shell script”
approach isn’t the best idea. As the author points out towards the
bottom, you wind up
starting the jvm every time… ugh. And the scripts are
platform-dependent.

I’m pretty sure Jasper comes with servlets that you can drop into tomcat
or jetty. You
could have the servlet container running on it’s regular port of 8080
but only accepting
connections from localhost. Or, you could seemlessly blend the jasper
reports stuff with
the rails app by proxying the url pattern for reports
(mydomain.com/reports) to the
servlet container in your web server config.

Or, just to be extremely buzzword compliant, you could do it as a web
service! :expressionless:

Now, this isn’t to say that any of this is trivial if you haven’t done
it… but it’s
always good to learn new things, right? You could take the script
approach to get it
working and then replace it with a daemon approach when you get it
figured out.

b

PS: we trained the client to use the iReport
(http://ireport.sourceforge.net/) gui tool
for Jasper Reports and they’ve been very pleased (heh, started asking if
they could
update their data with ireport!).