Code Monkey home page Code Monkey logo

jruby-poi's People

Contributors

all4miller avatar dudleyf avatar escudero avatar jacaetevha avatar mccxj avatar olleolleolle avatar phlipper avatar rob99 avatar sdeming avatar timcharper avatar yob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jruby-poi's Issues

Can't running rspec

Can't running rspec with jruby-poi.

$ ruby --version
jruby 1.6.5.1 (ruby-1.8.7-p330) (2011-12-27 1bf37c2) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_04-ea) [darwin-amd64-java]

$ cat Gemfile
source 'http://rubygems.org'
gem 'jruby-poi'
gem 'rspec'

$ cat foo_spec.rb 
require 'rubygems'
require 'rspec'
describe "test"

$ bundle update
$ bundle exec rspec foo_spec.rb

SystemStackError: stack level too deep
    call at org/jruby/RubyProc.java:270
  (root) at /Users/kazuhisa/.rvm/gems/jruby-1.6.5.1/gems/jruby-poi-0.8.2/bin/rspec:16
    load at org/jruby/RubyKernel.java:1063
  (root) at /Users/kazuhisa/.rvm/gems/jruby-1.6.5.1/gems/jruby-poi-0.8.2/bin/rspec:16
    load at org/jruby/RubyKernel.java:1063
   .
   .
   .
   .
   .
  (root) at /Users/kazuhisa/.rvm/gems/jruby-1.6.5.1/gems/jruby-poi-0.8.2/bin/rspec:16
    load at org/jruby/RubyKernel.java:1063
  (root) at /Users/kazuhisa/.rvm/gems/jruby-1.6.5.1/gems/jruby-poi-0.8.2/bin/rspec:16
    load at org/jruby/RubyKernel.java:1063

How should this problem be avoided?

Maybe update the gem version?

Seems the version 0.9.0 has been very dated and needs to be upgraded to the current master version which is compitable with jruby9k.

Cell Formula cache updating difficulties and not intuitive

If you have an Excel file (I was using excel 2010 xlsx format) in which you have a column A that each cell in it is (for example) the sum of the next two cells in column B and C.
If you use jruby-poi to open said file and add values to column B and C on new row (where the value of A was 0 because the formula was there but C and B were empty), then you save the file and open it on Microsoft Excel the value on the new row's A will still be zero despite the fact that B and C are filled.
If you just click on the formula the value will update and you can't even undo back in to the original state. This had let me to conclude that it was formula cache.

I've used a workaround to this issue on code I used jruby-poi to edit a rather big file with a lot of formulas:

%w[jobs defects].each do |sheet_name|
            sheet    = self.workbook.worksheets[ sheet_name ]
            rows     = sheet.rows
            from, to = 2, 70
            rows.each_with_index do |row, i|
                next if i <= from
                #order is important!
                %w[L K D E F N O P Q U V X Y Z W AA AB AC AD AE AF AG AH AI AJ].each do |letter|
                    column = letter.to_number - 1
                   puts sprintf( 'updating formulas on C: %s row %d', letter, i )
                    self.workbook.on_formula_update rows[ i ][ column ]
                end
                break if i >= to
            end
end

Maybe there could be something like setForceFormulaRecalculation as it's described in http://poi.apache.org/spreadsheet/eval.html , maybe there already is, but the gem documentation could use some improvements.

Using Styles ??

I browsed thru the code and found some references to creating/setting styles.

But - I can't find any examples of how to use this. I'd like to know what options to pass to set and clear borders, font weights, and background colors.

Are there any examples that show how to do this??

thanks, Andy

Error when running under JRuby 9.1.0

NoMethodError: undefined method row' for #Java::OrgApachePoiXssfUsermodel::XSSFSheet:0x7f92d2df- US Clients List.xlsm
[] at C:/downloads/jruby-9.1.0.0/lib/ruby/gems/shared/gems/jruby-poi-0.9.0/lib/poi/workbook/row.rb:12
[] at C:/downloads/jruby-9.1.0.0/lib/ruby/gems/shared/gems/jruby-poi-0.9.0/lib/poi/workbook/worksheet.rb:61
block in initialize at C:/downloads/jruby-9.1.0.0/lib/ruby/gems/shared/gems/orca_file_adapters-0.1.0/lib/orca/file_adapters/us_master_list.rb:41
mktmpdir at C:/downloads/jruby-9.1.0.0/lib/ruby/stdlib/tmpdir.rb:89`

jruby 9.1.0.0 (2.3.0) 2016-05-02 a633c63 Java HotSpot(TM) 64-Bit Server VM 24.71-b01 on 1.7.0_71-b14 +jit [mswin32-x86_64]

This may be a windows only problem. A quick test on my mac at home was unable to re-create....

jruby-as corrupt file

Error opening file in Microsoft Office (Windows) file corrupted message.
The following changes using the gem 'jruby-poi'.

  • controller. rb
    def relatorio_candidatos
    if params [: candidate]
    respond_to do | format |
    {format.xls send_data Class.file_name (params [: class] [: object])
    : filename => "file_name.xls"
    : type => "application / xls"}
    end
    end
    end

  • model. rb
    require 'poi'

    self.method def (object)
    candidates Candidato.includes = ([{: person => {: cidade_nascimento =>: state}}: polo: titles,: primeira_opcao,: processo_seletivo]).
    where ("= can.id?", object).
    all

    workbook = POI: Workbook.Open ("# {Rails.root} / lib / file_name.xls")
    workbook.worksheets sheet = ["Sheets"]
    rows = sheet.rows

...

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.