Comments (1)
I think I get the same problem without after_filter
just when I try to use data from another sheet.
My minimal working example:
require 'axlsx'
p = Axlsx::Package.new
wb = p.workbook
# Create some data in a sheet
def month
%w(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec).sample
end
def year
%w(2010 2011 2012).sample
end
def type
%w(Meat Dairy Beverages Produce).sample
end
def sales
rand(5000)
end
def cost
rand(1000)
end
#This works
wb.add_worksheet(:name => "Data Sheet") do |sheet|
sheet.add_row ['Month', 'Year', 'Type', 'Sales', 'Cost']
30.times { sheet.add_row [month, year, type, sales, cost] }
sheet.add_pivot_table 'G4:L17', "A1:E31" do |pivot_table|
pivot_table.rows = ['Month', 'Year']
pivot_table.columns = ['Type']
pivot_table.data = ['Sales', 'Cost']
end
end
#This works not
data = wb.add_worksheet(:name => "Data") do |sheet|
sheet.add_row ['Month', 'Year', 'Type', 'Sales', 'Cost']
30.times { sheet.add_row [month, year, type, sales, cost] }
end
wb.add_worksheet(:name => "Pivot Sheet") do |sheet|
sheet.add_pivot_table 'G4:L17', "'%s'!A1:E31" % data.name do |pivot_table|
pivot_table.rows = ['Month', 'Year']
pivot_table.columns = ['Type']
pivot_table.data = ['Sales', 'Cost']
end
end
p.serialize('test.xlsx')
from activeadmin-axlsx.
Related Issues (20)
- Trailing zeros in column values HOT 1
- Custom helpers not being included, compass watch produces an error. HOT 1
- Active Admin scoped_collection HOT 2
- Not working with AA 1.0.0.pre HOT 3
- Breaking Routes
- Gemfile incompatible with activeadmin master/pre branch HOT 1
- `require': cannot load such file -- activeadmin/axlsx (LoadError) HOT 1
- wrong number of arguments (1 for 0) HOT 14
- "wrong number of arguments (1 for 0)", activeadmin (1.0.0.pre) ruby 2.1.2 and rails 4.1.5 HOT 2
- undefined local variable or method `max_csv_records' in AA 1.0.0.pre HOT 3
- The way to make activeadmin-axlsx work with newest ActiveAdmin 1.0 Rails4 (Tested) HOT 1
- Using only filtered elements in the excel download
- Using activeadmin-axlsx with ActiveAdmin version 1.0.0.pre1 causes a crash HOT 4
- two issues with devise
- index_without_xlsx(options) fails with wrong number of arguments (1 for 0) HOT 1
- 2.0.1 seems to break font-awesome-rails
- Excel cant open this file format error
- dependency was wrong
- Installation dependency axlsx is not recognized
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activeadmin-axlsx.