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.
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 -- Posted via http://www.ruby-forum.com/.
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 -- Posted via http://www.ruby-forum.com/.
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 -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org]On Behalf Of Simo Gal Sent: Wednesday, January 04, 2006 11:14 PM To: rails@lists.rubyonrails.org Subject: [Rails] Re: Rails with ireport 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 -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
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 > railsDataVision 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 -- Posted via http://www.ruby-forum.com/.
thanks that will be very helpful -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org]On Behalf Of Simo Gal Sent: Thursday, January 05, 2006 7:45 PM To: rails@lists.rubyonrails.org Subject: [Rails] RE: Re: Rails with ireport 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 > railsDataVision 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 -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails