Forum: Ruby on Rails Rails with ireport

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.
Dc906dfeaa19b1d9872255515eea4aba?d=identicon&s=25 Paul Chin (Guest)
on 2006-01-04 02:30
(Received via mailing list)
Hi all, since there isn't good reporting for rails, I'm thinking to use
jasper report instead.  Can anyone tell me how can I integrated them
together?  especially how can I pass parameter from rails to jasper
report.
B0d6fda6fabb8cda27b5e6dde2dc2ac3?d=identicon&s=25 Simo Addsw (gal)
on 2006-01-04 16:13
Paul Chin wrote:
> Hi all, since there isn't good reporting for rails, I'm thinking to use
> jasper report instead.  Can anyone tell me how can I integrated them
> together?  especially how can I pass parameter from rails to jasper
> report.

I don't know it, but you see how ruby datavision bridge works
(http://rubyforge.org/projects/rdb/).

Some days ago, I created a small ruby library that reads iReport files
and produces PDF output (using ruby fpdf); it is very incomplete and
supports only few features (no data grouping, for example); if you are
interested, you can find it at
http://www.addsw.it/wiki/doku.php?id=repy_jasper

Regards
 Simo
F8fd54072606eaf5603484e756672034?d=identicon&s=25 John Wells (Guest)
on 2006-01-04 17:28
Paul Chin wrote:
> Hi all, since there isn't good reporting for rails, I'm thinking to use
> jasper report instead.  Can anyone tell me how can I integrated them
> together?  especially how can I pass parameter from rails to jasper
> report.

I did this once from PHP <-> Jasper. The way I accomplished it was by
setting up a servlet that would read a database table and load various
parameters from it, consequently handing those parameters to a report
job and running the report. The report was then handed back as a pdf to
the browser.

Not very complicated at all. I had a PHP report "controller" that PHP
scripts could call into and set parameters in the table, and the
controller would then call out to the servlet's url.

You could simply pass them via a http post, but I found this unwieldy
after awhile.

HTH,

John
Dc906dfeaa19b1d9872255515eea4aba?d=identicon&s=25 Paul Chin (Guest)
on 2006-01-05 01:21
(Received via mailing list)
thanks.

do you know how can I just call the shell to run a java program passing
rails parameter along that actually run the jasper report to generate
the report.

the next part I'm not sure how, can to pass the output page back to
rails
B0d6fda6fabb8cda27b5e6dde2dc2ac3?d=identicon&s=25 Simo Addsw (gal)
on 2006-01-05 12:44
Paul Chin wrote:
> thanks.
>
> do you know how can I just call the shell to run a java program passing
> rails parameter along that actually run the jasper report to generate
> the report.
> the next part I'm not sure how, can to pass the output page back to
> rails

DataVision bridge first creates a xml file containing rails report
parameters, then creates a commandline string like "java -cp
<package.jar> <ClassName> <options>".
Options contains parameter file name, output file name, database
settings and other.
Then, executes the report with
  system( "#{command_line}" )
Finally, in the controller, send the report to the browser with:
  send_file( <output file name>, :stream => false )

This works because it is possible to execute DataVision from the command
line. I dont't know if JasperReport also supports this feature (
otherwise, you can create a small java program that read parameters from
a file and uses JasperReport engine to generate and export report to a
file)

 Simo
Dc906dfeaa19b1d9872255515eea4aba?d=identicon&s=25 Paul Chin (Guest)
on 2006-01-06 02:13
(Received via mailing list)
thanks that will be very helpful
This topic is locked and can not be replied to.