views:

504

answers:

6

I want to add reporting capabilities to my Rails application and I'm struggling quite some time now on which reporting software to use to create my PDF documents.

Until now I'm pretty sure that either Ruport or Prawn are the best way to go.

After experimenting with both of them I find that they both are very powerful and quite universal, but they also have distinct peculiarities and I'm worried that in the long run I might make the wrong choice.

How do Ruport and Prawn compare to each other considerung long-term use in a large and complex application?

  • Maintainability? Will the report generating code grow exponentially? Does the code tend to become brittle?
  • Availability? Will the library still actively maintained in a few years? (ruport-util seems to be somewhat outdated...)
  • Customizability? How easy is it to generate different layouts for different clients using the same codebase?
  • Most important of all: Any other aspects I'm unaware of that I should consider before making a choice?

Thank you in advance!

+4  A: 

If you are generating PDF's offline (that is they don't need to be built dynamically and sent immediately to the user when he requests them) I would recommend using ERb and LaTeX. I've used it successfully to generate reports for survey data. The syntax might be a bit off putting if you have not used LaTeX before but it was worth it in my opinion. I also use gnuplot to generate graphs and plots for inclusion into the reports.

Farrel
I've been burned by Ruport. In fact, I almost don't want to use a reporting system that's built for a specific language, as I don't want to get burned again. But, using LaTeX... wow, I've never considered that as an option, but it may just work! Thank you so much for posting this.
JP
+1  A: 

I say: "Go for Prawn". The reason is that the guy who works on Prawn is active on the Ruby mailing list, while I don't know who handles Ruport.

Trevoke
Both libraries come from the same guy - Gregory Brown. Prawn is later, and I think he may not be the lead on Ruport any more, but he did write the book: http://ruportbook.com/
Mike Woodhouse
That might indicate that Ruport will not be as actively developed as Prawn in the future.
DR
+1  A: 

The only downside I've noticed with Prawn is that you can't have multi-column cells in tables. For example - a header row that spans all columns. I'm guessing the same with Ruport.

Anyone feel free to correct me if I'm wrong - I'd love to use prawn, but need custom tables and don't want to essentially free-hand them.

Currently I'm using HTMLDDOC, which translates html views into pdf documents. The downside with HTMLDOC is the lack of css support.

klochner
+1  A: 

Agreed - go for Prawn. Some comments from using Prawn

  • documentation is good and there are simple examples on how to get started. See Using Prawn in Rails
  • best place to find the examples is in the installed gems - check under the prawn-format and prawn-layout directories
  • you can do most things you need for generating reports, etc.
Grant Sayer
I think it is worth noting that as of prawn 0.7.0+ that prawn-format is no longer supported.
lillq
+3  A: 

I would like to clear the difference between the projects up. Ruport is a minimal framework for building reports that can be output in many different formats. The included PDF formatter uses the old PDF Writer, which is quite full featured and stable but is slow and memory intensive. The goal of Prawn is purely to render PDFs and it will replace PDF Writer in Ruport at some stage.

Andrew France
Considering that Prawn is newer and seems to be developed more actively, I'll place my bet on Prawn.
DR