axlsx

Inverted Axis in AXLSX Bar Chart

强颜欢笑 提交于 2021-01-27 14:02:07
问题 I'm using this very straightforward code (practically the same as the bar chart examples here, however I am noticing that the Axes are inverted. The data that should be on the Val axis is shown on the Cat axis. This is also true for the example linked above, and I can't seem to find a way to put them in the correct order. Below is an image of the problem. The code used to generate it is: sheet.add_chart(Axlsx::Bar3DChart,:title => "Chart", :show_legend => false, :start_at => "A1", :end_at =>

Secondary Axis in axlsx charts

一笑奈何 提交于 2020-01-17 04:31:13
问题 I am working on the xlsx report generation, and for that I am using axlsx gem. I looking for the option to show secondary Y-axis (for 2nd series in charts) in line and bar charts. Is there any way to do so? Thanks in advance. 回答1: I'm not well versed in axlsx much less charting in general, but from what I've read on the documentation there are thee possible 'axes' to choose from. valAxis, catAxis and serAxis. If I'm to assume you want depth to your chart, use serAxis. http://rubydoc.info

Rails Axlsx New Line in Cell

拟墨画扇 提交于 2020-01-04 03:59:06
问题 Is there a way that I can add a new line to a cell using the Axlsx gem in Rails? So basically replicating in Excel once you enter a value you can do a Alt + Enter to add additional text to the new line in the cell. I tried sheet.add_row ["Testing cell row 1" + \r\n + "Testing cell row 2"] but that throws an error. 回答1: For a forced line feed use "\x0A" (breaks between paragraphs.) If you want both carriage return and line feed, use "\x0D\x0A". 回答2: I recently had the same problem and I found

How to format currency columns in Axlsx?

百般思念 提交于 2020-01-04 02:55:10
问题 I am using ruby Axlsx gem for writing my clients accounts data in xlsx. Now I am appending " Dr" string to all debit amounts which is making amount as a string e.g. "1000 Dr". I want to append " Dr" but the amount should still be an integer and excel should give sum at bottom when column is selected. What I am doing, notice that excel shows sum = 0 in bottom-right even on selecting :- What I am doing, notice that cell remains a string on selecting (880 Dr should become 880.00 on selecting the

Axlsx Rails. Generate .xlsx file and respond filename as json/html

一世执手 提交于 2020-01-02 10:00:24
问题 I am generating xlsx files with axlsx_rails gem. After collecting user input I am posting data to /basic_report_post.xlsx Controller action looks like def basic_report_post @config = params[:config] @data = params[:data] @filename = "#{Rails.root}/public/test.xlsx" respond_to do |format| format.xlsx { render xlsx: 'basic_report_post' } end end View file for this action basic_report_post.xlsx.axlsx wb = xlsx_package.workbook wb.add_worksheet(name: 'Data1') do |s| # Drawing columns end xlsx

Devise authentication error with ActionController::Responder and axlsx_rails gem

◇◆丶佛笑我妖孽 提交于 2019-12-23 13:31:33
问题 Added an export-to-xlsx option with the axlsx and axlsx_rails gems to an existing Rails 4.2.0 app that uses Devise for authentication. Export to xlsx now works properly: app/controllers/cases_controller.rb: class CasesController < ApplicationController def create ⋮ @public_fields = public_fields respond_to do |format| ⋮ format.xlsx { render :xlsx => "create", :filename => "cases.xlsx" } end end end app/views/cases/create.xlsx.axlsx: wb = xlsx_package.workbook wb.add_worksheet(name: 'Cases')

Setting Excel column widths correctly when adding to spreadsheet via Axlsx

血红的双手。 提交于 2019-12-23 10:15:43
问题 I'm trying to format my report and making sure the columns have a correct width and I can't seem to make it happen with auto_width. With this code, this is the kind of report I get . Notice the space that is way to long for an auto_width, since if I double click on each column border in Excel, it correctly resizes, see this picture . Maybe it's the order I'm doing things? This is the code I'm using: workbook = xlsx_package.workbook worksheet_name = 'My Worksheet' xlsx_package.use_autowidth =

Axlsx ignores image.start_at

谁说胖子不能爱 提交于 2019-12-13 06:48:22
问题 Just a small problem that i'm facing with axlsx_rails images. currently i have this: sheet.add_image(:image_src => img, :noSelect => false, :noMove => false) do |image| image.start_at 5, 5 image.end_at 15, 20 end and it seems to somehow ignore the image.start_at line. No matter what values i give it, the image starts from 0,0 (Cell A1) and stretches until the values specified in image.end_at . Does anyone know what could be causing this or how to get around it ? I need to simply put the image