Questions tagged [roo-gem]

Roo is a ruby gem which provides an interface to Open Office, Excel, and Google Spreadsheets.

Roo is a ruby gem which provides an interface to Open Office, Excel, and Google Spreadsheets.

For more information see the gem documentation page and the github project page

69 questions
0
votes
1 answer

Ruby on Rails Roo Import Excel Return NIL

So, I am developing an Ruby on Rails website to import an Excel file into our website. I followed RailsCasts and using Roo gem. All are working, but when the import process done, all fields are nil. When I checked with raise, I found out that the…
Irwan
  • 543
  • 1
  • 5
  • 18
0
votes
1 answer

I need to generate a array of subarray from row1 and row1 of sheets 1 and 2 of excel using roo gem and ruby

I have the following code require 'rubygems' require 'roo' class ExcelReader dataarray = Array.new(); dataarray_new = Array.new(); workbook = Roo::Spreadsheet.open('C:\data\testexcel.xlsx') worksheets = workbook.sheets …
Dhanya
  • 1
  • 1
0
votes
1 answer

unknown attribute in rails 5

Hey I am trying to import one excel file from my sheet to database but I don't know something is not working getting unknown attribute : My sheet is like this : name title jalebi samosa s1 s2 s3 1 4 7 7 7 7 …
Nilay Singh
  • 2,201
  • 6
  • 31
  • 61
0
votes
1 answer

Rails Roo gem .xlsx output contains the object not the output of method

I am using the Roo gem to output a spreadsheet from a Rails app. One of my columns is a hash (Postgres DB). I would like to format the cell contents into something more readable. I am using a method to return a human readable cell. The column data…
Beartech
  • 6,173
  • 1
  • 18
  • 41
0
votes
0 answers

Rails How to get encoding of file Excel

Iam using Rails to build my website. My website only allow user upload excel files in encoding UTF8. Iam using gem Roo to read file .xlsx. However I can't get encoding of a file .xlsx. I used gem CharlockHolmes, however it don't return encoding of…
Quy Nguyen Vu
  • 181
  • 2
  • 13
0
votes
1 answer

How do I assign user_id and journal_id to the Deal model instance imported from excel (Rails)

I have implemented excel import (using spreadsheet and roo gems) in my rails app for Deal model. Deal model belongs to User and Journal. I need to attribute current_user.id and @journal.id to each imported deal. This is what I have…
electrify
  • 155
  • 1
  • 10
0
votes
1 answer

How do excel cells have to be formatted to be read as cell_type [:datetime] by Roo?

I am trying to read DateTime objects from an Excel spreadsheet using the Roo gem. I am able to successfully read cells that are formatted as Dates with the type *3/14/15 (with the asterisk denoting that the format is based on my regional date and…
DanHam
  • 340
  • 2
  • 17
0
votes
0 answers

undefined method `fetch_value' for nil:NilClass

I'm using a words_import class/controller to allow me to validate my words as I import them from a csv file or excel spreadsheet. Unfortunately I'm receiving an error: undefined method 'fetch_value' for nil:NilClass When I attempt to load the…
Bret
  • 23
  • 4
0
votes
1 answer

I would like to parse csv by ruby to create a report

I have a csv report with two rows which has headers of "Date" & "Customer_name": ["Date", "Customer_Name"] ["Monday", "John"] ["", "David"] ["", "Sam"] ["", "Kenny"] ["Tuesday", "Mary"] ["", "Jade"] ["", "Lindsay"] ["Wednesday", "Tom"] ["",…
0
votes
0 answers

Spreadsheet not saving to Rails database

I've managed to get a spreadsheet parsed through my Rails 5 app using the Roo gem, but once it finishes the process it doesn't seem to save to the database. Here is my code: require 'roo' xlsx =…
Dave C
  • 367
  • 5
  • 19
0
votes
1 answer

Saving Blank Excel Cells to Rails Postgres Database

I've managed to get the Roo Gem working so that I can import an Excel file and save it to the database of my app. This has been successful a few times, but it appears that in spreadsheets that contain blanks in certain rows it brings up an error. My…
Dave C
  • 367
  • 5
  • 19
0
votes
0 answers

How do I get XLS data to appear in CSV form the same way it displays in the file?

I’m using Rails 4.2.7 and am using the roo-xls gem. I parse my .xls file using the following code book = Roo::Spreadsheet.open(file_location) sheet = book.sheet(0) text = sheet.to_csv arr_of_arrs = CSV.parse(text) One oddity I’m noticing, is that…
Dave
  • 15,639
  • 133
  • 442
  • 830
0
votes
1 answer

Validation problems while creating record through file import using Roo gem and following railscast

I am trying to create records through file imports format can be csv excel etc and I have implemented it following the Railscast396. but as I import file it says "Validation failed: Email can't be blank, Password can't be blank. Here is my code …
0
votes
0 answers

Rails roo, Integer value is converted by datetime

I'm trying to read xlsx file using roo gem, and I have a problem. When I read a integer value '693837900371', rails convert 'Sat, 19 Feb 1899665549'. I do not find any solution to solve it.
WitchOfCloud
  • 115
  • 9
0
votes
0 answers

Downloaded .xlsx files not working with roo

In ruby while working with excel worksheets, i am using "roo" gem. It is working well with the local files associated with my system. But when i download a new excel file from internet and opening it with 'roo' throws error like…
Anonymous
  • 1
  • 2