Description

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. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.

If value is boolean return 1 or 0 else return the value

Parameters:

  • value (Object)

    The value to process

performs the increadible feat of changing snake_case to CamelCase

Parameters:

  • s (String) (defaults to: "")

    The snake case string to camelize

Returns The alpha(column)numeric(row) reference for this sell.

Examples:

Relative Cell Reference

ws.rows.first.cells.first.r #=> "A1"

determines the cell range for the items provided

global reference html entity encoding

Note:

This follows the standard spreadsheet convention of naming columns A to Z, followed by AA to AZ etc.

converts the column index into alphabetical values.

returns the x, y position of a cell

Raises:

  • (ArgumentError)

Creates an array of individual cell references based on an excel reference range.

Parameters:

  • range (String)

    A cell range, for example A1:D5

returns the provided string with all invalid control charaters removed.

Parameters:

  • str (String)

    The string to process

sorts the array of cells provided to start from the minimum x,y to the maximum x.y#

Parameters:

  • cells (Array)

Instructs the serializer to not try to escape cell value input. This will give you a huge speed bonus, but if you content has <, > or other xml character data the workbook will be invalid and excel will complain.

@param trust_me A boolean value indicating if the cell value content is to be trusted

Requires that the value is between -54000000 and 54000000

Parameters:

  • v (Any)

    The value validated

Raises:

  • (ArgumentError)

    raised if the value cannot be converted to an integer between the allowed angle values for chart label rotation.

Requires that the value is a form that can be evaluated as a boolean in an xml document. The value must be an instance of Fixnum, String, Integer, Symbol, TrueClass or FalseClass and it must be one of 0, 1, “true”, “false”, :true, :false, true, false, “0”, or “1”

Parameters:

  • v (Any)

    The value validated

Requires that the value is one of :none, :single, :double, :singleAccounting, :doubleAccounting

Requires that the value is valid conditional formatting operator. valid operators must be one of lessThan, lessThanOrEqual, equal, notEqual, greaterThanOrEqual, greaterThan, between, notBetween, containsText, notContains, beginsWith, endsWith

Parameters:

  • v (Any)

    The value validated

Requires that the value is valid conditional formatting type. valid types must be one of expression, cellIs, colorScale, dataBar, iconSet, top10, uniqueValues, duplicateValues, containsText, notContainsText, beginsWith, endsWith, containsBlanks, notContainsBlanks, containsErrors, notContainsErrors, timePeriod, aboveAverage

Parameters:

  • v (Any)

    The value validated

Requires thatt he value is a valid conditional formatting value object type. valid types must be one of num, percent, max, min, formula and percentile

Requires that the value is a valid content_type TABLE_CT, WORKBOOK_CT, APP_CT, RELS_CT, STYLES_CT, XML_CT, WORKSHEET_CT, SHARED_STRINGS_CT, CORE_CT, CHART_CT, DRAWING_CT, COMMENT_CT are allowed

Parameters:

  • v (Any)

    The value validated

Requires that the value is a valid data_validation_error_style :information, :stop, :warning

Parameters:

  • v (Any)

    The value validated

Requires that the value is valid data validation operator. valid operators must be one of lessThan, lessThanOrEqual, equal, notEqual, greaterThanOrEqual, greaterThan, between, notBetween

Parameters:

  • v (Any)

    The value validated

Requires that the value is valid data validation type. valid types must be one of custom, data, decimal, list, none, textLength, time, whole

Parameters:

  • v (Any)

    The value validated

Requires that the value is a valid “display blanks as” type. valid types must be one of gap, span, zero

Parameters:

  • v (Any)

    The value validated

validates cell style family which must be between 1 and 5

Requires that the value is a Float

Parameters:

  • v (Any)

    The value validated

Requires that the value is a gradient_type. valid types are :linear and :path

Parameters:

  • v (Any)

    The value validated

Requires that the value is a valid horizontal_alignment :general, :left, :center, :right, :fill, :justify, :centerContinuous, :distributed are allowed

Parameters:

  • v (Any)

    The value validated

Requires that the value is one of the valid ST_IconSet types Allowed values are: 3Arrows, 3ArrowsGray, 3Flags, 3TrafficLights1, 3TrafficLights2, 3Signs, 3Symbols, 3Symbols2, 4Arrows, 4ArrowsGray, 4RedToBlack, 4Rating, 4TrafficLights, 5Arrows, 5ArrowsGray, 5Rating, 5Quarters

Requires that the value is a Integer

Parameters:

  • v (Any)

    The value validated

Requires that the value can be converted to an integer @para, [Any] v the value to validate

Raises:

  • (ArgumentError)

    raised if the value cannot be converted to an integer

Requires that the value is a string containing a positive decimal number followed by one of the following units: “mm”, “cm”, “in”, “pt”, “pc”, “pi”

Requires that the value is one of :default, :landscape, or :portrait.

Requires that the value is a valid active pane type. valid types must be one of bottom_left, bottom_right, top_left, top_right

Parameters:

  • v (Any)

    The value validated

Requires that the value is valid pattern type. valid pattern types must be one of :none, :solid, :mediumGray, :darkGray, :lightGray, :darkHorizontal, :darkVertical, :darkDown, :darkUp, :darkGrid, :darkTrellis, :lightHorizontal, :lightVertical, :lightDown, :lightUp, :lightGrid, :lightTrellis, :gray125, or :gray0625.

Parameters:

  • v (Any)

    The value validated

Requires that the value is a valid relationship_type XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, DRAWING_R, IMAGE_R, HYPERLINK_R, SHARED_STRINGS_R are allowed

Parameters:

  • v (Any)

    The value validated

Requires that the value is an integer ranging from 10 to 400 or 0.

Requires that the value is an integer ranging from 10 to 400.

Requires that the value is a valid scatterStyle must be one of :none | :line | :lineMarker | :marker | :smooth | :smoothMarker must be one of “none” | “line” | “lineMarker” | “marker” | “smooth” | “smoothMarker”

Parameters:

  • v (Symbol|String)

    the value to validate

Requires that the value is a valid sheet view type. valid types must be one of normal, page_break_preview, page_layout

Parameters:

  • v (Any)

    The value validated

Requires that the value is a valid split state type. valid types must be one of frozen, frozen_split, split

Parameters:

  • v (Any)

    The value validated

Requires that the value is a String

Parameters:

  • v (Any)

    The value validated

Requires that the value is a valid table element type :wholeTable, :headerRow, :totalRow, :firstColumn, :lastColumn, :firstRowStripe, :secondRowStripe, :firstColumnStripe, :secondColumnStripe, :firstHeaderCell, :lastHeaderCell, :firstTotalCell, :lastTotalCell, :firstSubtotalColumn, :secondSubtotalColumn, :thirdSubtotalColumn, :firstSubtotalRow, :secondSubtotalRow, :thirdSubtotalRow, :blankRow, :firstColumnSubheading, :secondColumnSubheading, :thirdColumnSubheading, :firstRowSubheading, :secondRowSubheading, :thirdRowSubheading, :pageFieldLabels, :pageFieldValues are allowed

Parameters:

  • v (Any)

    The value validated

Requires that the value is one of the ST_TimePeriod types valid time period types are today, yesterday, tomorrow, last7Days, thisMonth, lastMonth, nextMonth, thisWeek, lastWeek, nextWeek

Requires that the value is a Fixnum or Integer and is greater or equal to 0

Parameters:

  • v (Any)

    The value validated

Raises:

  • (ArgumentError)

    raised if the value is not a Fixnum or Integer value greater or equal to 0

Requires that the value is a Fixnum Integer or Float and is greater or equal to 0

Parameters:

  • v (Any)

    The value validated

Raises:

  • (ArgumentError)

    raised if the value is not a Fixnun, Integer, Float value greater or equal to 0

Requires that the value is a valid vertical_alignment :top, :center, :bottom, :justify, :distributed are allowed

Parameters:

  • v (Any)

    The value validated

Requires that the value is one of :visible, :hidden, :very_hidden

Axlsx is referenced in 0 repositories