Coder Social home page Coder Social logo

jruby_jasper's Introduction

Jruby Jasper distributed service

A distributed Ruby class running in Java, called from MRuby to produce Jasper Reports.

Usage

Run: java -jar jruby_jasper.jar (or use the start.sh script.

Configure:

  • config/.env.local for the host/port to listen at.
  • config/log4j2xml for logging settings.

A restart is required for configuration changes to take effect.

Call from client Ruby code:

require 'drb/drb'

SERVER_URI = 'druby://localhost:9998' # Or another ip:port
DRb.start_service
service = DRbObject.new_with_uri(SERVER_URI)
db_opts = DB.opts.select { |k, _| %i[user password port host database].include?(k) },
res = service.make_jasper_report(report_name_without_ext,
                                 path_to_report_name_file,
                                 :pdf, # OR: :xls, :rtf, :csv
                                 db_opts,
                                 params)
puts res[:msg]
File.open('./report_name.pdf', 'w') { |f| f << res[:doc] } if res[:success]
# Do something with res[:msg] if res[:success] is false...

Requirements

  • Java. Versions higher than 8 will display a warning related to Groovy. Can be ignored.
  • Postgresql.

Generate jar file

For development, JRuby 9.2.13 is required.

Run bundle exec warble to generate the jar file.

Generate a distribution zipfile

Run ./build_dist.sh. This will generate the jar file and build jruby_jasper.zip in the dist dir.

Install

See INSTALL.md

jruby_jasper's People

Contributors

jcsjcs avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Patie avatar  avatar Miracle avatar Robyn avatar Thato avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.