source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/styles.rb | Ruby | mit | 305 | main | 16,988 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/chart_formatting'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class Styles
include Writexlsx::Utility::Common... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/rich_value.rb | Ruby | mit | 305 | main | 1,630 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class RichValue
include Writexlsx::Utility::Common
include Writexlsx::Utility::XmlPrimi... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/rich_value_rel.rb | Ruby | mit | 305 | main | 1,665 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
#
# RichValueRel - A class for writing the Excel XLSX richValueRel.xml file.
#
# Used in conjunction with Excel::Writer::XL... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/rich_value_types.rb | Ruby | mit | 305 | main | 2,950 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
#
# RichValueTypes - A class for writing the Excel XLSX rdRichValueTypes.xml file.
#
# Used in conjunction with Excel::Writ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/button.rb | Ruby | mit | 305 | main | 5,101 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/string_width'
require 'write_xlsx/utility/drawing'
module Writexlsx
module Package
class Button
include Writexlsx::Utility::Common
include Writexlsx::Utility::StringWidth
inclu... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/xml_writer_simple.rb | Ruby | mit | 305 | main | 3,399 | # coding: utf-8
# frozen_string_literal: true
#
# XMLWriterSimple
#
require 'stringio'
module Writexlsx
module Package
class XMLWriterSimple
XMLNS = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'
def initialize
@io = StringIO.new
# Will allocate new string once, then us... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/metadata.rb | Ruby | mit | 305 | main | 7,114 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
#
# Metadata - A class for writing the Excel XLSX metadata.xml file.
#
class Metadata
include Writexlsx::Utility::Xml... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/rich_value_structure.rb | Ruby | mit | 305 | main | 1,870 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
#
# RichValueStructure - A class for writing the Excel XLSX rdrichvaluestructure.xml
# file.
#
# Used in conjunction wi... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/shared_strings.rb | Ruby | mit | 305 | main | 3,467 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class SharedStrings
include Writexlsx::Utility::XmlPrimitives
PRESERVE_SPACE_ATTRIBUTES = ['xml:space', 'preserve'].freeze... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/lambda.rb | Ruby | mit | 305 | main | 1,456 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example of using the new Excel LAMBDA() function with the
# WriteXLSX rubygem. Note, this function is only currently available
# if you are subscribed to the Microsoft Office Beta program.
#
# Cop... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_stock.rb | Ruby | mit | 305 | main | 1,675 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Stock chart in Excel::Writer::XLSX.
#
# reverse(c), March 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
wo... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_data_tools.rb | Ruby | mit | 305 | main | 5,236 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of an various Excel chart data tools that are available via
# an WriteXLSX chart.
#
# These include, Trendlines, Data Labels, Error Bars, Drop Lines,
# High-Low Lines and Up-Down Bars.
#
# rev... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_column.rb | Ruby | mit | 305 | main | 1,644 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of an Area chart in Excel::Writer::XLSX.
#
# reverse('ゥ'), March 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/dynamic_arrays.rb | Ruby | mit | 305 | main | 7,260 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example of how to use the write_xlsx rubygem to write functions
# that create dynamic arrays. These functions are new to Excel 365. The
# examples mirror the examples in the Excel documentation on... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/protection.rb | Ruby | mit | 305 | main | 948 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('protection.xlsx')
worksheet = workbook.add_worksheet
# Create some format objects
unlocked = workbook.add_format(locked: 0)
hidden = workbook.add_format(hidden: 1)
# Format the columns
worksheet.set_column('A:A', 45)
works... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/conditional_format.rb | Ruby | mit | 305 | main | 7,387 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('conditional_format.xlsx')
worksheet1 = workbook.add_worksheet
worksheet2 = workbook.add_worksheet
worksheet3 = workbook.add_worksheet
worksheet4 = workbook.add_worksheet
worksheet5 = workbook.add_worksheet
worksheet6 = workbook... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/outline_collapsed.rb | Ruby | mit | 305 | main | 5,518 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# Example of how to use Excel::Writer::XLSX to generate Excel outlines and
# grouping.
#
# These examples focus mainly on collapsed outlines. See also the
# outlines.pl example program for more general examples.
#
# reverse ('(c)'), March 2008, John McNamara, jmcnamara@cpa... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/hide_row_col.rb | Ruby | mit | 305 | main | 958 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of how to hide rows and columns in Excel::Writer::XLSX. In order to
# hide rows without setting each one, (of approximately 1 million rows),
# Excel uses an optimisation to hide all rows that... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_data_table.rb | Ruby | mit | 305 | main | 2,657 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Column chart with a data table on the X-axis using
# WriteXLSX.
#
# reverse ('(c)'), December 2012, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@g... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/merge1.rb | Ruby | mit | 305 | main | 1,137 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Simple example of merging cells using the Excel::Writer::XLSX module.
#
# This example merges three cells using the "Centre Across Selection"
# alignment which was the Excel 5 method of achie... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/merge3.rb | Ruby | mit | 305 | main | 1,115 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how to use Excel::Writer::XLSX to write a hyperlink in a
# merged cell.
#
# reverse(c), September 2002, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakam... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_gauge.rb | Ruby | mit | 305 | main | 2,148 | # #!/usr/bin/env ruby
# #######################################################################
# #
# # A demo of an Gauge Chart in WriteXLSX gem.
# #
# # A Gauge Chart isn't a native chart type in Excel. It is constructed by
# # combining a doughnut chart and a pie chart and by using some non-filled
# # elements. Thi... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_data_labels.rb | Ruby | mit | 305 | main | 8,127 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of an various Excel chart data label features that are available
# via an WriteXLSX chart.
#
# Copyright 2000-2020, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakam... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_scatter.rb | Ruby | mit | 305 | main | 1,649 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Scatter chart in Excel::Writer::XLSX.
#
# reverse(c), March 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/merge2.rb | Ruby | mit | 305 | main | 1,293 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Simple example of merging cells using the Excel::Writer::XLSX module
#
# This example merges three cells using the "Centre Across Selection"
# alignment which was the Excel 5 method of achiev... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/update_range_format_with_params.rb | Ruby | mit | 305 | main | 902 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the write_xlsx gem to
# update format of the range of cells.
#
require 'write_xlsx'
workbook = WriteXLSX.new('update_range_format_with_params.xlsx')
worksheet = workb... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape8.rb | Ruby | mit | 305 | main | 1,793 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# add shapes and one-to-many connectors to an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted to Ruby by... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/tab_colors.rb | Ruby | mit | 305 | main | 663 | #!/usr/bin/env ruby
#######################################################################
#
# Example of how to set Excel worksheet tab colours.
#
# reverse(c), May 2006, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
workbook = Excel::Writer:... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/right_to_left.rb | Ruby | mit | 305 | main | 661 | #!/usr/bin/env ruby
#######################################################################
#
# Example of how to change the default worksheet direction from
# left-to-right to right-to-left as required by some eastern verions
# of Excel.
#
# reverse(c), January 2006, John McNamara, jmcnamara@cpan.org
# convert to rub... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/merge6.rb | Ruby | mit | 305 | main | 1,226 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how to use the Excel::Writer::XLSX merge_cells workbook
# method with Unicode strings.
#
# reverse(c), December 2005, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo N... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_area.rb | Ruby | mit | 305 | main | 1,640 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of an Area chart in Excel::Writer::XLSX.
#
# reverse('ゥ'), March 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/outline.rb | Ruby | mit | 305 | main | 8,763 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how use Excel::Writer::XLSX to generate Excel outlines and
# grouping.
#
#
# Excel allows you to group rows or columns so that they can be hidden or
# displayed with a single mouse... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape_all.rb | Ruby | mit | 305 | main | 5,319 | #######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# add all shapes (as currently implemented) to an Excel xlsx file.
#
# The list at the end consists of all the shape types defined as
# ST_ShapeType in ECMA-376, Office Open XML File Formats P... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/autofilter.rb | Ruby | mit | 305 | main | 6,504 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# An example of how to create autofilters with Excel::Writer::XLSX.
#
# An autofilter is a way of adding drop down lists to the headers of a 2D range
# of worksheet data. This is turn allow use... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/sparklines2.rb | Ruby | mit | 305 | main | 7,660 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of how to add sparklines to an Excel::Writer::XLSX file.
#
# Sparklines are small charts that fit in a single cell and are
# used to show trends in data. This example shows the majority of
# ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/demo.rb | Ruby | mit | 305 | main | 2,387 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('demo.xlsx')
worksheet = workbook.add_worksheet('Demo')
worksheet2 = workbook.add_worksheet('Another sheet')
worksheet3 = workbook.add_worksheet('And another')
bold = workbook.add_format(bold: 1)
###########################... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_pareto.rb | Ruby | mit | 305 | main | 2,157 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Pareto chart in Excel::Writer::XLSX.
#
# reverse ('(c)'), March 2015, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xls... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/array_formula.rb | Ruby | mit | 305 | main | 934 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of how to use the WriteXLSX gem to write simple
# array formulas.
#
# reverse(c), August 2004, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_radar.rb | Ruby | mit | 305 | main | 2,997 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of an Area chart in Excel::Writer::XLSX.
#
# reverse ('(c)'), October 2012, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xl... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/panes.rb | Ruby | mit | 305 | main | 2,679 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of using the Excel::Writer::XLSX module to create worksheet panes.
#
# reverse(c), May 2001, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/merge5.rb | Ruby | mit | 305 | main | 1,681 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how to use the Excel::Writer::XLSX merge_cells workbook
# method with complex formatting and rotation.
#
#
# reverse(c), September 2002, John McNamara, jmcnamara@cpan.org
# convert... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/date_time.rb | Ruby | mit | 305 | main | 1,981 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# WriteXLSX example of writing detes and times using the
# Worksheet#write_date_time.
#
# reverse(c), March 2001, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@g... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/hide_sheet.rb | Ruby | mit | 305 | main | 820 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of how to hide a worksheet with Excel::Writer::XLSX.
#
# reverse('c'), April 2005, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo, Nakamura, nakamura.hideo@gmail.com
#
require '... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_clustered.rb | Ruby | mit | 305 | main | 1,784 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# A demo of a clustered category chart in Excel::Writer::XLSX.
#
# reverse ('(c)'), March 2015, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
workbook = WriteXLSX.new('chart_clustered.xlsx')
worksh... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/data_validate.rb | Ruby | mit | 305 | main | 5,950 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how to add data validation and dropdown lists to a
# WriteExcel file.
#
# reverse('©'), August 2008, John McNamara, jmcnamara@cpan.org
#
# original written in Perl by John McNamara... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_pie.rb | Ruby | mit | 305 | main | 2,267 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Pie chart in Excel::Writer::XLSX.
#
# The demo also shows how to set segment colours. It is possible to
# define chart colors for most types of WrtieXLSX charts
# via the add_series() met... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/merge4.rb | Ruby | mit | 305 | main | 1,970 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how to use the Excel::Writer::XLSX merge_range workbook
# method with complex formatting.
#
# reverse(c), September 2002, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hid... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_styles.rb | Ruby | mit | 305 | main | 1,439 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example showing all 48 default chart styles available in Excel 2007
# using Excel::Writer::XLSX.. Note, these styles are not the same as the
# styles available in Excel 2013.
#
# reverse ('(c)'), ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/sparklines1.rb | Ruby | mit | 305 | main | 1,340 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of how to add sparklines to an Excel::Writer::XLSX file.
#
# Sparklines are small charts that fit in a single cell and are
# used to show trends in data. See sparklines2.pl for examples
# of ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_line.rb | Ruby | mit | 305 | main | 3,320 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Line chart in Excel::Writer::XLSX.
#
# reverse('ゥ'), March 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
w... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape7.rb | Ruby | mit | 305 | main | 1,801 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# add shapes and one-to-many connectors to an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted to Ruby by... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/regions.rb | Ruby | mit | 305 | main | 1,091 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example of how to use the WriteXLSX gem to write a basic
# Excel workbook with multiple worksheets.
#
# reverse(c), March 2001, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMUR... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/rich_strings.rb | Ruby | mit | 305 | main | 1,211 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An Excel::Writer::XLSX example showing how to use "rich strings", i.e.,
# strings with multiple formatting.
#
# reverse(c), February 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_combined.rb | Ruby | mit | 305 | main | 3,250 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example of a Combined chart in WriteXLSX.
#
# reverse ('(c)'), March 2015, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/indent.rb | Ruby | mit | 305 | main | 731 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
##############################################################################
#
# A simple formatting example using Excel::Writer::XLSX.
#
# This program demonstrates the indentation cell format.
#
# reverse(c), May 2004, John McNamara, jmcnamara@cpan.org
# convert to ruby ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/comments2.rb | Ruby | mit | 305 | main | 8,007 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('comments2.xlsx')
text_wrap = workbook.add_format(text_wrap: 1, valign: 'top')
worksheet1 = workbook.add_worksheet
worksheet2 = workbook.add_worksheet
worksheet3 = workbook.add_worksheet
worksheet4 = workbook.add_worksheet
wo... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/properties.rb | Ruby | mit | 305 | main | 944 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
##############################################################################
#
# An example of adding document properties to a Excel::Writer::XLSX file.
#
# reverse('©'), August 2008, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gma... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/stocks.rb | Ruby | mit | 305 | main | 2,396 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of formatting using the WriteXLSX gem
#
# This example shows how to use a conditional numerical format
# with colours to indicate if a share price has gone up or down.
#
# reverse(c), March 2... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape6.rb | Ruby | mit | 305 | main | 1,276 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# add shapes (objects and right/left connectors) to an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted t... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/diag_border.rb | Ruby | mit | 305 | main | 549 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('diag_border.xlsx')
worksheet = workbook.add_worksheet
format1 = workbook.add_format(diag_type: 1)
format2 = workbook.add_format(diag_type: 2)
format3 = workbook.add_format(diag_type: 3)
format4 = workbook.add_format(
diag_... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/stats_ext.rb | Ruby | mit | 305 | main | 2,195 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of how to use functions with the WriteXLSX gem.
#
# This is a simple example of how to use functions that reference cells in
# other worksheets within the same workbook.
#
# reverse(c), March... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/colors.rb | Ruby | mit | 305 | main | 3,811 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
################################################################################
#
# Demonstrates Excel::Writer::XLSX's named colors and the Excel color
# palette.
#
# The set_custom_color() Worksheet method can be used to override one of the
# built-in palette values with a... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/hyperlink1.rb | Ruby | mit | 305 | main | 1,320 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Example of how to use the Excel::Writer::XLSX module to write hyperlinks
#
# See also hyperlink2.pl for worksheet URL examples.
#
# reverse(c), May 2004, John McNamara, jmcnamara@cpan.org
# c... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/watermark.rb | Ruby | mit | 305 | main | 852 | #!/usr/bin/env ruby
#######################################################################
#
# An example of adding a worksheet watermark image using the WriteXLSX
# rubygem. This is based on the method of putting an image in the worksheet
# header as suggested in the Microsoft documentation:
# https://support.micros... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape4.rb | Ruby | mit | 305 | main | 1,279 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# demonstrate stenciling in an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted to Ruby by Hideo NAKAMURA... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_bar.rb | Ruby | mit | 305 | main | 1,635 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of an Bar chart in Excel::Writer::XLSX.
#
# reverse('c'), March 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'write_xlsx'
w... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/autofit.rb | Ruby | mit | 305 | main | 933 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#
# An example of using simulated autofit to automatically adjust the width of
# worksheet columns based on the data in the cells.
#
# Copyright 2000-2023, John McNamara, jmcnamara@cpan.org
#
# SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
#
# convert to Rub... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/tables.rb | Ruby | mit | 305 | main | 9,367 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# Example of how to add tables to an WriteXLSX worksheet.
#
# Tables in Excel are use to group rows and columns of data into a single
# structure that can be references in a formula or formatted collec... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/macros.rb | Ruby | mit | 305 | main | 1,062 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example of adding macros to an WriteXLSX file using VBA project file
# extracted from an existing Excel xlsm file.
#
# The +extract_vba.rb+ utility supplied with WriteXLSX can be used to extract
#... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape5.rb | Ruby | mit | 305 | main | 1,242 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# add shapes (objects and top/bottom connectors) to an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted t... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/background.rb | Ruby | mit | 305 | main | 482 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example of setting a worksheet background image with Excel::Writer::XLSX.
#
# Copyright 2000-2021, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/comments1.rb | Ruby | mit | 305 | main | 245 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('comments1.xlsx')
worksheet = workbook.add_worksheet
worksheet.write('A1', 'Hello')
worksheet.write_comment('A1', 'This is a comment')
workbook.close |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/stats.rb | Ruby | mit | 305 | main | 1,759 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A Simple example of how to use functions with the WriteXLSX gem.
#
# reverse(c), March 2001, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/a_simple.rb | Ruby | mit | 305 | main | 1,085 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the Excel::Writer::XLSX module to
# write text and numbers to an Excel xlsx file.
#
# reverse(c), March 2001, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hid... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/formats.rb | Ruby | mit | 305 | main | 15,193 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
###############################################################################
#
# Examples of formatting using the Excel::Writer::XLSX module.
#
# This program demonstrates almost all possible formatting options. It is worth
# running this program and viewing the output Ex... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape1.rb | Ruby | mit | 305 | main | 770 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# add shapes to an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted to Ruby by Hideo NAKAMURA, nakamura.h... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/defined_name.rb | Ruby | mit | 305 | main | 827 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('defined_name.xlsx')
worksheet1 = workbook.add_worksheet
worksheet2 = workbook.add_worksheet
# Define some global/workbook names.
workbook.define_name('Exchange_rate', '=0.96')
workbook.define_name('Sales', '=Sheet1!$... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/ignore_errors.rb | Ruby | mit | 305 | main | 1,160 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
##############################################################################
#
# An example of turning off worksheet cells errors/warnings using the
# Excel::Writer::XLSX module.
#
# Copyright 2000-2021, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_doughnut.rb | Ruby | mit | 305 | main | 3,628 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Doughnut chart in Excel::Writer::XLSX.
#
# The demo also shows how to set segment colours. It is possible to define
# chart colors for most types of Excel::Writer::XLSX charts via the
# a... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape2.rb | Ruby | mit | 305 | main | 1,096 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# modify shapes properties in an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted to Ruby by Hideo NAKAMU... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/headers.rb | Ruby | mit | 305 | main | 3,658 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
######################################################################
#
# This program shows several examples of how to set up headers and
# footers with Excel::Writer::XLSX.
#
# The control characters used in the header/footer strings are:
#
# Control Categ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/add_vba_project.rb | Ruby | mit | 305 | main | 1,146 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# An example of adding macros to an Excel::Writer::XLSX file using
# a VBA project file extracted from an existing Excel xlsm file.
#
# The C<extract_vba> utility supplied with Excel::Writer::XLSX can ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/shape3.rb | Ruby | mit | 305 | main | 724 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# scale shapes in an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted to Ruby by Hideo NAKAMURA, nakamura... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/chart_secondary_axis.rb | Ruby | mit | 305 | main | 1,398 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#######################################################################
#
# A demo of a Line chart with a secondary axis in WriteXLSX.
#
# reverse(c), March 2011, John McNamara, jmcnamara@cpan.org
# convert to ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#
require 'writ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | examples/keep_leading_zeros.rb | Ruby | mit | 305 | main | 426 | #!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'write_xlsx'
workbook = WriteXLSX.new('keep_leading_zeros.xlsx')
worksheet = workbook.add_worksheet
worksheet.keep_leading_zeros(true)
worksheet.write('A1', '001')
worksheet.write('B1', 'written as string.')
worksheet.write('A2', '012')
worksheet.write('B2', 'writ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | bin/extract_vba.rb | Ruby | mit | 305 | main | 904 | #!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
require 'zip/filesystem'
require 'fileutils'
# src zip filename
# dest destination directory
# options :fs_encoding=[UTF-8,Shift_JIS,EUC-JP]
def extract_vba_project(src, dest, _options = {})
FileUtils.makedirs(dest)
Zip::InputStream.open(src) do |is|
loop do
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/test_example_match.rb | Ruby | mit | 305 | main | 193,406 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'helper'
require 'write_xlsx'
class TestExampleMatch < Minitest::Test
def setup
setup_dir_var
end
def teardown
@tempfile.close
end
def test_a_simple
@xlsx = 'a_simple.xlsx'
# Create a new workbook called simple.xls and add a wor... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/test_option_hash_for_workbook.rb | Ruby | mit | 305 | main | 3,977 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'helper'
require 'write_xlsx'
class TestOptionHashForWorkbook < Minitest::Test
#
# Workbook.new(file)
# => options = {}
# => default_format_properties = {}
#
def test_empty
@workbook = WriteXLSX.new(StringIO.new)
options = @workbook.i... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/run_test.rb | Ruby | mit | 305 | main | 276 | # frozen_string_literal: true
base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
lib_dir = File.join(base_dir, "lib")
test_dir = File.join(base_dir, "test")
$LOAD_PATH.unshift(lib_dir)
require 'test/unit'
exit Test::Unit::AutoRunner.run(true, test_dir) |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/test_delete_tempdir.rb | Ruby | mit | 305 | main | 1,351 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'helper'
require 'write_xlsx'
class TestDeleteTempdir < Minitest::Test
def setup
@dir_path = 'test_delete_empty_directory'
system("rm -rf #{@dir_path}") if FileTest.exist?(@dir_path)
end
def test_delete_tempdir_removes_empty_directory
Di... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/test_xml_writer_simple.rb | Ruby | mit | 305 | main | 1,616 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'helper'
require 'write_xlsx/package/xml_writer_simple'
class TestXMLWriterSimple < Minitest::Test
def setup
@obj = Writexlsx::Package::XMLWriterSimple.new
end
def test_xml_decl
assert_equal(
%(<?xml version="1.0" encoding="UTF-8" stan... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/helper.rb | Ruby | mit | 305 | main | 8,783 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
warn e.message
warn "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'minitest/autorun'
$LOAD_PATH.unshift(File.dirname(__FILE__))... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_ax_pos.rb | Ruby | mit | 305 | main | 323 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
class TestAxPos < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Bar')
end
def test_write_axis_pos
expected = '<c:axPos val="l"/>'
result = @chart.__send__('write_axis_pos', 'l')
assert_equal(expected, result)
end
e... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_symbol.rb | Ruby | mit | 305 | main | 382 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
class TestWriteSymbol < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Bar')
end
def test_write_symbol
expected = '<c:symbol val="none"/>'
@chart.__send__('write_symbol', 'none')
result = @chart.instance_variable_get(:... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_marker_value.rb | Ruby | mit | 305 | main | 397 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
class TestWriteMarkerValue < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Bar')
end
def test_write_marker_value
expected = '<c:marker val="1"/>'
@chart.instance_variable_set(:@default_marker, 'none')
result = @chart.... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_v.rb | Ruby | mit | 305 | main | 362 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
class TestWriteV < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Bar')
end
def test_write_v
expected = '<c:v>Apple</c:v>'
@chart.__send__('write_v', 'Apple')
result = @chart.instance_variable_get(:@writer).string
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_legend.rb | Ruby | mit | 305 | main | 406 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
class TestWriteLegend < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Bar')
end
def test_write_legend
expected = '<c:legend><c:legendPos val="r"/><c:layout/></c:legend>'
@chart.__send__('write_legend')
result = @chart... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_legend_pos.rb | Ruby | mit | 305 | main | 674 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
class TestWriteLegendPos < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Bar')
end
def test_write_legend_pos_default
expected = '<c:legendPos val="r"/>'
result = @chart.__send__('write_legend_pos', 'r')
assert_equal(... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_lang.rb | Ruby | mit | 305 | main | 317 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
class TestWriteLang < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Bar')
end
def test_write_lang
expected = '<c:lang val="en-US"/>'
result = @chart.__send__('write_lang')
assert_equal(expected, result)
end
end |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | test/chart/test_write_d_lbls.rb | Ruby | mit | 305 | main | 8,471 | # -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'
require 'write_xlsx/chart/pie'
class TestWriteDLbls < Minitest::Test
def setup
@chart = Writexlsx::Chart.new('Line')
@chart.instance_variable_set(
:@label_positions,
{
'center' => 'ctr',
'right' => 'r'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.