Questions tagged [axlsx]

Ruby, JRuby and Rubinius Office Open XML (xlsx) generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification.

axlsx
Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

Ruby - Cannot save formatted spreadsheet locally

I'm having an issue when trying to save a formatted spreadsheet locally to my computer. The purpose of the program is to consolidate units to reorder based on a master spreadsheet and save it locally. ...
Zach S's user avatar
  • 13
0 votes
0 answers
26 views

How to make graph on pivot table in axlsx gem

In axlsx ruby gem making graph on a result of a pivot table is ending in error: ArgumentError (Missing cell B228 for the specified range B228:B233) This makes me think that pivot table data is not ...
TheR's user avatar
  • 63
0 votes
1 answer
226 views

Set cell type in Axlsx

I need to create a excel sheet with the following headers: Date, Check in, Break in, Break out, Check out, Note Below those headers I want to add 100 empty rows of which the first column must be type: ...
Hackman's user avatar
  • 1,679
0 votes
0 answers
42 views

Add custom abbreviation format for cells using AXLSX gem

I am using the caxlsx gem to export some data and I need to add custom abbreviation formatting for cells on a specific column to add units of T(trillions), B(billions), and M(millions) to the end. So: ...
user17443811's user avatar
0 votes
0 answers
151 views

export graphs in excel with rails

I am using axlsx gem in my application to export data to excel sheet. On other hand I am using [quickchart]api to show graph on frontend. Is there anyway to use quickchart api in .xlsx template or any ...
umer butt's user avatar
0 votes
1 answer
125 views

How do I add sort to column headings in a caxlsx Pivot Table

I've got a pivot table (see code below) where the source raw data is already sorted by client, year, and month. This means the row headings (A=Client, B=Year) are automatically sorted with the data, ...
James's user avatar
  • 669
0 votes
1 answer
35 views

CAXLXS spreadsheet cells without colors when open with excell

I´m generate an spreadsheet with colors into cells, and when I a open the file with Open office or google spreadsheet works fine, but when with Excel the colors desappear. Code: respond_to do |format| ...
Carlos Daniel's user avatar
1 vote
0 answers
76 views

legend color are not proper showing in axlsx stacked bar chart

I'm working on the xlsx chart generation and for that using axlsx gem.I'm looking for the option to show correct legend (label) color. right now, not showing correct color in stacked Bar chart. Please ...
Hardika Desai's user avatar
1 vote
0 answers
52 views

caxlsx / axlsx Pivot Table ignore blanks and remove totals

Following this example: https://github.com/caxlsx/caxlsx/blob/master/examples/pivot_table_example.md and in my implementation I am getting the totals and blanks in the pivot tables. Anyway to remove ...
Dan Tappin's user avatar
  • 2,870
0 votes
1 answer
389 views

caxlsx / axlsx Pivot Table on separate sheet

I am trying to follow this example: https://github.com/caxlsx/caxlsx/blob/master/examples/pivot_table_example.md This code works fine in my existing workbook export. I am trying to add a pivot table ...
Dan Tappin's user avatar
  • 2,870
1 vote
0 answers
158 views

How to add background patterns to Excel cells with axlsx?

I create xlsx-files with axlsx (3.0.0.pre) with different cell formats. Example: require 'axlsx' Axlsx::Package.new do |axlsxpackage| axlsxpackage.workbook{|wb| wb.styles do |style| ...
knut's user avatar
  • 27.6k
0 votes
1 answer
981 views

caxlsx gem: generated excel file displays #<Axlsx::Worksheet:0x0000559d7e487dc8>

I have a simple example, that when Excel file is generated contains #<Axlsx::Worksheet:0x0000559d7e487dc8>. I would like the Excel file to contain "Keys Available to be Assigned And Their ...
Chris's user avatar
  • 382
0 votes
1 answer
211 views

Ruby on Rails: define custom cell name using rails axlsx

I have this data, and want to set B3:B6 as "procedures" (see image top left), how do I do this in rails using caxlsx_rails gem ?? I need to set dynamic dropdown in the excel, for examples if ...
Loadd64's user avatar
  • 57
1 vote
1 answer
201 views

Ruby axlsx pie chart title font size

I'm using the axslx ruby gem to create a spreadsheet with a pie chart. For the most part it is very straightforward and I've had no problems with one exception: I can't figure out how to set the font ...
LCraddock's user avatar
0 votes
0 answers
140 views

Rails Gem “Axlsx” - Adding Image Fail

SO.Windows 10 ruby : 2.6.6 rails : 6.0.3.2 axlsx : 2.0.1 this is my code. img = File.expand_path(Rails.root + "app/javascript/img/logo-finky.png", __FILE__) sheet.add_image(:...
Dario Paez's user avatar
0 votes
0 answers
170 views

Is there a way in gem Axlsx ruby gem to change the default font color (black) once for all?

With Axlsx you can add_style and give a cell or a row another color than the default one (black). Is there an easy way to set the default color of the worksheet (let's say to red) to avoid precising ...
romss182's user avatar
  • 203
0 votes
1 answer
194 views

Rails caxlsx - align document right to left

I'm using caxlsx with rails 6 and I can't find a way to set it to output the document as right to left (the document is in Hebrew). Does anyone know how to set it? Thanks! Jordan.
Jordan Shefner's user avatar
0 votes
0 answers
154 views

How to get specific cell position using value of cell in Aslxs gem in Rails

I want to get the position or index of a specific cell in worksheet using the value of the cell. I have a hash and i want to check at what position in the first row the key of the hash is present and ...
Spacehead's user avatar
1 vote
1 answer
299 views

ruby/caxlsx: how to define different surrounding cell's borders styles?

I cannot find a way to have different borders on a cell with the excellent caxlsx gem on ruby. From the doc, the expected style for borders is defined using (for instance): {style: :thick, color: '...
Krapo's user avatar
  • 51
0 votes
1 answer
233 views

Rails [AXLSX]: Change Currency

I need to change the currency format on an Excel file that is exported. The default currency pattern is US (1,000.00) [One Thousand] and I need it to become PT-BR format (1.000,00) [One Thousand]. I ...
Rafael Nazário's user avatar
1 vote
2 answers
905 views

Add password in xlsx using secure-spreadsheet

im try to put password in my excel file def excel_file test = Axlsx::Package.new do |p| p.workbook.add_worksheet(:name => "Pie Chart") do |sheet| sheet.add_row [&...
imposterisasking's user avatar
0 votes
1 answer
123 views

how to merge cells both column and row wise

sheet.merge_cells 'H3:U3' sheet.merge_cells 'H3:H5' Does not work. First i need to merge columns (H3:U3) then merge it rowwise (H3:H5) to get big rectangle cell. Thanks in advance
A. Askarov's user avatar
1 vote
3 answers
1k views

File encrypted password in xlsx

Currently, I'm using gem caxlsx for generating my excel' is there anyone try to file a password before generating the excel file? the goal here. is the user click the button then some text will pop up ...
imposterisasking's user avatar
0 votes
1 answer
166 views

Axlsx GEM: Uppercase font for a particular cell value

How can I convert a cell value to uppercase using AXLSX gem? I don't find any option from the docs (See Screenshot) The problem is, when I try adding a formula to cell, the formula is taken in ...
Abhi's user avatar
  • 4,223
0 votes
0 answers
650 views

AXLSX: Conditional formatting for percent, changes the cell value

I'm following this example LINK. But, I have floating value for the cell, so when I run this example with every cell value as 4.5 (hardcoded), the excel generates cells with value 450.00 %, while ...
Abhi's user avatar
  • 4,223
0 votes
0 answers
348 views

Axlsx performance reduction after rails 5.2 upgrade

I was using axlsx to create a workbook , stream and write to a downloadable xlsx file with rails 4.2. It used to take less than 60 seconds to create a downloadable xlsx file with 40,000 records, along ...
Nikhil Sojan's user avatar
0 votes
2 answers
325 views

how to check condition while exporting excel in rails with Axlsx gem

projecthas many task. task has attribute status with integer field 0,1 and 2 now i want to print not-completed for 0 , completed for 1 and not-started for 2. currently i am able to print integer in ...
sumiu's user avatar
  • 1
0 votes
1 answer
1k views

How to Download xlsx file using gem "axlsx" and "axlsx_rails" from rails 4 application using AJAX call?

I'm trying to download a xlsx file by using axlsx and axlsx_rails in a Rails 4 application. My reports_controller: def generate_report @reports = Report.all respond_to do |format| format.xlsx ...
Sandip Vavhal's user avatar
0 votes
1 answer
833 views

AXLSX Gem: Style group of cells of a column

I'm referring to THIS LINK for surrounding a box (bunch of columns) using the gem. I could figure out how to add border top and bottom, to a group of cells. Eg: sheet["B3:D3"].each do |cell| ...
Abhi's user avatar
  • 4,223
2 votes
1 answer
1k views

Rails axlsx: How to insert value into new cell in existing row

I have 2 table with one-to-many relationship, activities table and direct_activities table In the axslx file, I have code like this wb = xlsx_package.workbook activities = Activity.all.includes(:...
Loadd64's user avatar
  • 57
2 votes
0 answers
595 views

Permission denied @ rb_sysopen from Ruby gem writing to filesystem

Ruby 2.4.0 Rails 5.2.3 I have a Rails ActiveJob generating an xlsx report using the Axlsx gem. When it tries to write the file to the file system with: axlsx.serialize("#{Rails.root}/tmp/#{@...
ThriceGood's user avatar
  • 1,683
0 votes
2 answers
2k views

How to upload an excel file into S3 bucket using ruby on rails

In our rails 6 project I want to upload excel file into S3 bucket and send file link to email and provide download xls feature from email. Please help me. I have generated the excel file using the ...
Suman Das's user avatar
  • 301
0 votes
1 answer
2k views

How to export active record data to excel file and save xlsx file into Amazon S3 bucket without storing it on local machine using ruby on rails

In our rails 6 project I want to export active record data to excel file and save xls file into S3 bucket without storing xls data on local db and send file link to email and provide download xls ...
Suman Das's user avatar
  • 301
1 vote
1 answer
45 views

how to generate pCoordinates for Xlsx files

I want to generate the coordinates for this $sheet->setCellValue($pCoordinate, $pValue); a $pCoodrinates is a letter and then a number like A1, B1 , C1 , that is for example the first row then ...
heyAndrew's user avatar
0 votes
1 answer
440 views

Is there a possibility to remove rows and columns XLSX

I want to create pretty looking sheet, for this purpose I need only 8 columns and 26 rows, so I would like to remove redundant rows and columns. Is this possible using axlsx gem?
Roman Alekseiev's user avatar
0 votes
1 answer
1k views

Rails Axlsx render conditional row background color

I am using axlsx gem to generate Excel sheets in Ruby on Rails. wb = xlsx_package.workbook wb.styles do |s| title = s.add_style :b => true, :sz => 10, :border => { :...
yohanes's user avatar
  • 2,533
1 vote
0 answers
302 views

How to automatically make the texts that are links be hyperlinks with Axlsx gem?

I have a Ruby code that iterates over some objects creating the necessary rows in an xls file using Axlsx gem. Some of the object attributes are links (social handles and website), and I want these ...
Leticia Esperon's user avatar
0 votes
1 answer
610 views

Rails 6 Axlsx Excel Gem - Images not displaying

I don't know if it's my fault or if it just doesn't work with Rails 6, but my images in the file are not displaying: I tried: img = File.expand_path(Rails.root+'app/assets/images/logo.jpg') and ...
Max Kirsch's user avatar
1 vote
2 answers
751 views

Streaming download with axlsx

How to do streaming download with axlsx gem. I need a way to download huge file in chunks. The time it will take more than 5 minutes and I don't want to use any background jobs for this task. I am ...
Aniket Tiwari's user avatar
5 votes
0 answers
158 views

Excel stacked bar chart not plotted correctly

I am using Axlsx gem for generating the excel charts on ruby on rails. My requirement is to generate a stacked bar chart but it is generating in a staircase format refer the image here. To generate ...
Aditya Tiwari's user avatar
2 votes
0 answers
369 views

Adding global font size styling to Axlsx sheet

I would like to set the sheet-wide default font size set to 8pt, instead of the default 11pt. Is there a way to set a global style using the Axlsx gem (implemented with Axlsx-Rails)? I've looked at ...
simonlehmann's user avatar
0 votes
1 answer
1k views

Export arrays into xlsx using axlsx gem

I'm attempting to copy all the contents of a CSV file over to an excel workbook using the AXLSX gem. On a second sheet, I only want 2 of the columns copied over. Below is an example. I tried the '....
B T's user avatar
  • 1
0 votes
1 answer
86 views

Problem in formula when referencing cells in another worksheet

I am trying to access the values of specific cells of another worksheet But I have a problem in my formula when I add it to a cell this is my formula: =ÍNDICE(Categorias!A2:A6, COINCIDIR(G2, ...
José Alejandro Cortés Segura's user avatar
-1 votes
1 answer
617 views

read and get content from tempfile .xlsx

I am using dropzone to send an .xlsx file to my controller, that sends me the file by parameters and I get an <ActionDispatch::Http::UploadedFile:0x007fe9f87bb030 In my controller I am trying to ...
José Alejandro Cortés Segura's user avatar
0 votes
0 answers
894 views

Export xlsx file as a link in a mail using axlsx-rails

I'm using Rails 4.2, sidekiq, rubyzip, axlsx and axlsx-rails What I need to do: I need to export file in a mail, but as a link and not as attachment. I want an email send with a url to the download ...
Ofir Sasson's user avatar
1 vote
2 answers
646 views

How to use Axlsx:NumFmt?

How do use Alxsx:NumFmt class? I need to use this class to format currency values (positive and negative values) I found some documentation for this class here - https://www.rubydoc.info/github/...
m.beginner's user avatar
1 vote
1 answer
2k views

Ruby on Rails: export xlsx export all html page instead the requested data

I'm using rails 4.2, and using gems axlsx and axlsx_rails I'm going to move to rails 5 soon but for now I use this version. What I want: Export xlsx file from a query using axls_rails gem What I get ...
Ofir Sasson's user avatar
1 vote
0 answers
337 views

How to use threads to generate multiple sheets in a workbook - using axlsx gem in Ruby on Rails?

I use axlsx gem to generate an Excel workbook using the code below; I used multithreading expecting the Excel to be rendered faster: wb = xlsx_package.workbook threads = [] wb.add_worksheet(name: "...
m.beginner's user avatar
1 vote
1 answer
856 views

How to format currency in custom color using axlsx in Ruby on Rails?

I am using axlsx gem to generate Excel sheets. I used the following code to format currency cell in Excel: wb.styles.add_style(:format_code => '[Gray][A6A6A6]$#,##0_;[Red]($#,##0_)') The above ...
m.beginner's user avatar
2 votes
1 answer
345 views

Ruby Gem: Axlslx RuntimeError: Can't add attachments after `mail` was called

I'm stepping thru all my shop records and sending them an email if an order is wrong. It works fine thru 2 or 3 shops but after that I get this error: RuntimeError: Can't add attachments ...
ToddT's user avatar
  • 3,168

1
2 3 4 5 6