Class: JasperReportRegister
- Inherits:
-
Object
- Object
- JasperReportRegister
- Defined in:
- backend/app/model/reports/jasper_report_register.rb
Class Method Summary (collapse)
-
+ (Object) register_report(opts)
-
+ (Object) register_reports
this registers the reports so they work in the URI.
Class Method Details
+ (Object) register_report(opts)
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'backend/app/model/reports/jasper_report_register.rb', line 22 def self.register_report(opts) # futz to get the class name correct if opts["report_type"] == 'json' ancestor = Object.const_get( "JSONReport" ) else ancestor = Object.const_get( "JDBCReport") end report = "#{opts["uri_suffix"].split("_").map { |w| w.capitalize }.join }Report" klass = Object.const_set( report, Class.new(ancestor) ) klass.send( :register_report, opts) end |
+ (Object) register_reports
this registers the reports so they work in the URI
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'backend/app/model/reports/jasper_report_register.rb', line 9 def self.register_reports begin Array(StaticAssetFinder.new('reports').find_all("report_config.yml")).each do |config| begin yml = YAML.load_file(config) self.register_report(yml) end end rescue NotFoundException $stderr.puts("NO JASPER REPORTS FOUND") end end |