Dynamic Report In Ruby On Rails

In my recent work i have face some difficulties for generating different report for different organization or client using same application,because every client have their own reporting format.

Like SAAS based application if it is generate some MIS report and if client require some more or less information depending upon his requirement we can give some editable facilities to edit and generate report.

So to fulfill this kind of requirement user editable report which contains Markup + ruby code for reporting purpose.
I am using liquid ,acts_as_flying_saucer,rchart,textile/Html for generating report.

Basic steps to achieve this functionality:

  1. Create generic templates that contain(Html+Liquid) used widely for all organiztion.
  2. After Creating generic template if client needs some customization as per their reporting format . Let us take their report format and develop their custom report template.
  3. Generate Report against Template , process template content and display or generate report as per need.

Short introduction of liquid

What is Liquid?

Liquid markup language.Liquid is a “safe, customer facing template language for flexible web apps”.
More info you can found http://www.liquidmarkup.org/

Why Liquid?

  • Allowing user to change appearance of application without running insecure code.
  • Render templates directly from the database.

More info about liquid you can found http://github.com/tobi/liquid

Dynami Report Class Diagram

So to generate Report use Report Template,In Report Template content contains liquid+HTML/Textile .This content is rendered when generating report and generate report content which mostly contains HTML and Generate report based on it.

May be i can’t explain full functionality due to lack of time and content,i have just implemented code for that and hosted on github.

Any question regarding this you can write comment,or drop me a mail.

2 comments On Dynamic Report In Ruby On Rails

  • So, I tried to get your example going on 1.9, but couldn’t get the PDF to generate, got errors for libgd (using homebrew on mac)

    dyld: Symbol not found: _overflow2
    Referenced from: /usr/local/lib/libgd.2.dylib
    Expected in: flat namespace

    Google not really helping.

    I am sure it’s just me doing something dumb, but if you have a suggestion…

    • Hi,
      I am using rchart for plotting graph.which require libgd library.
      There are 2 ways to over come this first just comment out code or second try to use updated gem of rchart,and see if gd library is properly install or not.

Leave a Reply to Ruprict Cancel Reply

Your email address will not be published.

Site Footer