write_xlsx 1.08.2 → 1.09.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes +9 -0
- data/README.md +1 -1
- data/examples/background.rb +19 -0
- data/lib/write_xlsx/chart/axis.rb +3 -3
- data/lib/write_xlsx/chart/scatter.rb +0 -15
- data/lib/write_xlsx/chart/series.rb +1 -1
- data/lib/write_xlsx/chart.rb +28 -28
- data/lib/write_xlsx/chartsheet.rb +3 -3
- data/lib/write_xlsx/drawing.rb +39 -39
- data/lib/write_xlsx/format.rb +11 -179
- data/lib/write_xlsx/package/app.rb +2 -2
- data/lib/write_xlsx/package/button.rb +8 -8
- data/lib/write_xlsx/package/comments.rb +8 -8
- data/lib/write_xlsx/package/content_types.rb +18 -9
- data/lib/write_xlsx/package/core.rb +5 -5
- data/lib/write_xlsx/package/custom.rb +2 -2
- data/lib/write_xlsx/package/metadata.rb +159 -0
- data/lib/write_xlsx/package/packager.rb +21 -0
- data/lib/write_xlsx/package/shared_strings.rb +6 -6
- data/lib/write_xlsx/package/styles.rb +11 -11
- data/lib/write_xlsx/package/table.rb +23 -23
- data/lib/write_xlsx/package/theme.rb +1 -1
- data/lib/write_xlsx/package/vml.rb +43 -43
- data/lib/write_xlsx/shape.rb +17 -15
- data/lib/write_xlsx/sparkline.rb +340 -340
- data/lib/write_xlsx/utility.rb +4 -23
- data/lib/write_xlsx/version.rb +1 -1
- data/lib/write_xlsx/workbook.rb +171 -644
- data/lib/write_xlsx/worksheet/cell_data.rb +25 -3
- data/lib/write_xlsx/worksheet/data_validation.rb +20 -20
- data/lib/write_xlsx/worksheet/hyperlink.rb +4 -4
- data/lib/write_xlsx/worksheet/page_setup.rb +12 -12
- data/lib/write_xlsx/worksheet.rb +295 -4184
- data/test/perl_output/background.xlsx +0 -0
- data/test/regression/images/logo.gif +0 -0
- data/test/regression/images/logo.jpg +0 -0
- data/test/regression/images/red.gif +0 -0
- data/test/regression/test_background01.rb +23 -0
- data/test/regression/test_background02.rb +23 -0
- data/test/regression/test_background03.rb +24 -0
- data/test/regression/test_background04.rb +25 -0
- data/test/regression/test_background05.rb +25 -0
- data/test/regression/test_background06.rb +31 -0
- data/test/regression/test_background07.rb +37 -0
- data/test/regression/test_chart_axis47.rb +52 -0
- data/test/regression/test_chart_axis48.rb +53 -0
- data/test/regression/test_dynamic_array01.rb +25 -0
- data/test/regression/test_image56.rb +23 -0
- data/test/regression/test_image57.rb +23 -0
- data/test/regression/test_set_column10.rb +55 -0
- data/test/regression/test_set_column11.rb +48 -0
- data/test/regression/test_set_row01.rb +35 -0
- data/test/regression/test_set_row02.rb +35 -0
- data/test/regression/test_set_row03.rb +35 -0
- data/test/regression/test_set_row04.rb +35 -0
- data/test/regression/xlsx_files/background01.xlsx +0 -0
- data/test/regression/xlsx_files/background02.xlsx +0 -0
- data/test/regression/xlsx_files/background03.xlsx +0 -0
- data/test/regression/xlsx_files/background04.xlsx +0 -0
- data/test/regression/xlsx_files/background05.xlsx +0 -0
- data/test/regression/xlsx_files/background06.xlsx +0 -0
- data/test/regression/xlsx_files/background07.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis47.xlsx +0 -0
- data/test/regression/xlsx_files/chart_axis48.xlsx +0 -0
- data/test/regression/xlsx_files/dynamic_array01.xlsx +0 -0
- data/test/regression/xlsx_files/image56.xlsx +0 -0
- data/test/regression/xlsx_files/image57.xlsx +0 -0
- data/test/regression/xlsx_files/set_row01.xlsx +0 -0
- data/test/regression/xlsx_files/set_row03.xlsx +0 -0
- data/test/test_example_match.rb +12 -0
- data/test/worksheet/test_pixels_to_row_col.rb +46 -0
- metadata +78 -2
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionBackground01 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_background01
|
14
|
+
@xlsx = 'background01.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.insert_image('E9', 'test/regression/images/logo.jpg')
|
19
|
+
|
20
|
+
workbook.close
|
21
|
+
compare_for_regression
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionBackground02 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_background02
|
14
|
+
@xlsx = 'background02.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.set_background('test/regression/images/logo.jpg')
|
19
|
+
|
20
|
+
workbook.close
|
21
|
+
compare_for_regression
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionBackground03 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_background03
|
14
|
+
@xlsx = 'background03.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.insert_image('E9', 'test/regression/images/logo.jpg')
|
19
|
+
worksheet.set_background('test/regression/images/logo.jpg')
|
20
|
+
|
21
|
+
workbook.close
|
22
|
+
compare_for_regression
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionBackground04 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_background04
|
14
|
+
@xlsx = 'background04.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet1 = workbook.add_worksheet
|
17
|
+
worksheet2 = workbook.add_worksheet
|
18
|
+
|
19
|
+
worksheet1.set_background('test/regression/images/logo.jpg')
|
20
|
+
worksheet2.set_background('test/regression/images/logo.jpg')
|
21
|
+
|
22
|
+
workbook.close
|
23
|
+
compare_for_regression
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionBackground05 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_background05
|
14
|
+
@xlsx = 'background05.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet1 = workbook.add_worksheet
|
17
|
+
worksheet2 = workbook.add_worksheet
|
18
|
+
|
19
|
+
worksheet1.set_background('test/regression/images/logo.jpg')
|
20
|
+
worksheet2.set_background('test/regression/images/red.jpg')
|
21
|
+
|
22
|
+
workbook.close
|
23
|
+
compare_for_regression
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionBackground06 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_background06
|
14
|
+
@xlsx = 'background06.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.insert_image('E9', 'test/regression/images/logo.jpg')
|
19
|
+
worksheet.set_background('test/regression/images/logo.jpg')
|
20
|
+
|
21
|
+
worksheet.set_header(
|
22
|
+
'&C&G', nil, :image_center => 'test/regression/images/blue.jpg'
|
23
|
+
)
|
24
|
+
|
25
|
+
workbook.close
|
26
|
+
compare_for_regression(
|
27
|
+
[],
|
28
|
+
'xl/worksheets/sheet1.xml' => ['<pageSetup']
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionBackground07 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_background07
|
14
|
+
@xlsx = 'background07.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.insert_image('E9', 'test/regression/images/logo.jpg')
|
19
|
+
worksheet.set_background('test/regression/images/logo.jpg')
|
20
|
+
|
21
|
+
worksheet.set_header(
|
22
|
+
'&C&G', nil, :image_center => 'test/regression/images/blue.jpg'
|
23
|
+
)
|
24
|
+
|
25
|
+
worksheet.write('A1', 'Foo')
|
26
|
+
worksheet.write_comment('B2', 'Some text')
|
27
|
+
|
28
|
+
# Set the author to match the target XLSX file.
|
29
|
+
worksheet.comments_author = 'John'
|
30
|
+
|
31
|
+
workbook.close
|
32
|
+
compare_for_regression(
|
33
|
+
[],
|
34
|
+
'xl/worksheets/sheet1.xml' => ['<pageSetup']
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionChartAxis47 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_chart_axis47
|
14
|
+
@xlsx = 'chart_axis47.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
chart = workbook.add_chart(:type => 'line', :embedded => 1)
|
18
|
+
|
19
|
+
# For testing, copy the randomly generated axis ids in the target xlsx file.
|
20
|
+
chart.instance_variable_set(:@axis_ids, [84517632, 106222720])
|
21
|
+
|
22
|
+
data = [
|
23
|
+
[ 1, 2, 3, 4, 5 ],
|
24
|
+
[ 2, 4, 6, 8, 10 ],
|
25
|
+
[ 3, 6, 9, 12, 15 ]
|
26
|
+
]
|
27
|
+
|
28
|
+
worksheet.write('A1', data)
|
29
|
+
|
30
|
+
chart.add_series(:values => '=Sheet1!$A$1:$A$5')
|
31
|
+
chart.add_series(:values => '=Sheet1!$B$1:$B$5')
|
32
|
+
chart.add_series(:values => '=Sheet1!$C$1:$C$5')
|
33
|
+
|
34
|
+
chart.set_x_axis(
|
35
|
+
:name => 'XXX',
|
36
|
+
:name_font => { :rotation => 0, :baseline => -1}
|
37
|
+
)
|
38
|
+
|
39
|
+
chart.set_y_axis(
|
40
|
+
:name => 'YYY',
|
41
|
+
:name_font => { :rotation => 0, :baseline => -1}
|
42
|
+
)
|
43
|
+
|
44
|
+
worksheet.insert_chart('E9', chart)
|
45
|
+
|
46
|
+
workbook.close
|
47
|
+
compare_for_regression(
|
48
|
+
nil,
|
49
|
+
{ 'xl/charts/chart1.xml' => ['<c:pageMargins'] }
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionChartAxis48 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_chart_axis48
|
14
|
+
@xlsx = 'chart_axis48.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
chart = workbook.add_chart(:type => 'line', :embedded => 1)
|
18
|
+
|
19
|
+
# For testing, copy the randomly generated axis ids in the target xlsx file.
|
20
|
+
chart.instance_variable_set(:@axis_ids, [84517632, 106222720])
|
21
|
+
|
22
|
+
data = [
|
23
|
+
[ 1, 2, 3, 4, 5 ],
|
24
|
+
[ 2, 4, 6, 8, 10 ],
|
25
|
+
[ 3, 6, 9, 12, 15 ]
|
26
|
+
]
|
27
|
+
|
28
|
+
worksheet.write('A1', data)
|
29
|
+
worksheet.write('D1', 'Foo')
|
30
|
+
|
31
|
+
chart.add_series(:values => '=Sheet1!$A$1:$A$5')
|
32
|
+
chart.add_series(:values => '=Sheet1!$B$1:$B$5')
|
33
|
+
chart.add_series(:values => '=Sheet1!$C$1:$C$5')
|
34
|
+
|
35
|
+
chart.set_x_axis(
|
36
|
+
:name => 'XXX',
|
37
|
+
:name_font => { :rotation => 0, :baseline => -1}
|
38
|
+
)
|
39
|
+
|
40
|
+
chart.set_y_axis(
|
41
|
+
:name => '=Sheet1!$D$1',
|
42
|
+
:name_font => { :rotation => 0, :baseline => -1}
|
43
|
+
)
|
44
|
+
|
45
|
+
worksheet.insert_chart('E9', chart)
|
46
|
+
|
47
|
+
workbook.close
|
48
|
+
compare_for_regression(
|
49
|
+
nil,
|
50
|
+
{ 'xl/charts/chart1.xml' => ['<c:pageMargins'] }
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionDynamicArray01 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_dynamic_array01
|
14
|
+
@xlsx = 'dynamic_array01.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.write_dynamic_array_formula('A1:A1', '=AVERAGE(TIMEVALUE(B1:B2))', nil, 0)
|
19
|
+
worksheet.write('B1', '12:00')
|
20
|
+
worksheet.write('B2', '12:00')
|
21
|
+
|
22
|
+
workbook.close
|
23
|
+
compare_for_regression
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionImage56 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_image56
|
14
|
+
@xlsx = 'image56.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.insert_image('E9', 'test/regression/images/red.gif')
|
19
|
+
|
20
|
+
workbook.close
|
21
|
+
compare_for_regression
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionImage57 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_image57
|
14
|
+
@xlsx = 'image57.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.insert_image('E9', 'test/regression/images/logo.gif')
|
19
|
+
|
20
|
+
workbook.close
|
21
|
+
compare_for_regression
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionSetColumn10 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_set_column10
|
14
|
+
@xlsx = 'set_column01.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.set_column_pixels( "A:A", 1)
|
19
|
+
worksheet.set_column_pixels( "B:B", 2)
|
20
|
+
worksheet.set_column_pixels( "C:C", 3)
|
21
|
+
worksheet.set_column_pixels( "D:D", 4)
|
22
|
+
worksheet.set_column_pixels( "E:E", 5)
|
23
|
+
worksheet.set_column_pixels( "F:F", 6)
|
24
|
+
worksheet.set_column_pixels( "G:G", 7)
|
25
|
+
worksheet.set_column_pixels( "H:H", 8)
|
26
|
+
worksheet.set_column_pixels( "I:I", 9)
|
27
|
+
worksheet.set_column_pixels( "J:J", 10)
|
28
|
+
worksheet.set_column_pixels( "K:K", 11)
|
29
|
+
worksheet.set_column_pixels( "L:L", 12)
|
30
|
+
worksheet.set_column_pixels( "M:M", 13)
|
31
|
+
worksheet.set_column_pixels( "N:N", 14)
|
32
|
+
worksheet.set_column_pixels( "O:O", 15)
|
33
|
+
worksheet.set_column_pixels( "P:P", 16)
|
34
|
+
worksheet.set_column_pixels( "Q:Q", 17)
|
35
|
+
worksheet.set_column_pixels( "R:R", 18)
|
36
|
+
worksheet.set_column_pixels( "S:S", 19)
|
37
|
+
worksheet.set_column_pixels( "T:T", 20)
|
38
|
+
worksheet.set_column_pixels( "U:U", 21)
|
39
|
+
worksheet.set_column_pixels( "V:V", 22)
|
40
|
+
worksheet.set_column_pixels( "W:W", 23)
|
41
|
+
worksheet.set_column_pixels( "X:X", 24)
|
42
|
+
worksheet.set_column_pixels( "Y:Y", 25)
|
43
|
+
worksheet.set_column_pixels( "Z:Z", 26)
|
44
|
+
worksheet.set_column_pixels( "AB:AB", 65)
|
45
|
+
worksheet.set_column_pixels( "AC:AC", 66)
|
46
|
+
worksheet.set_column_pixels( "AD:AD", 67)
|
47
|
+
worksheet.set_column_pixels( "AE:AE", 68)
|
48
|
+
worksheet.set_column_pixels( "AF:AF", 69)
|
49
|
+
worksheet.set_column_pixels( "AG:AG", 70)
|
50
|
+
|
51
|
+
workbook.close
|
52
|
+
|
53
|
+
compare_for_regression
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionSetColumn11 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_set_column11
|
14
|
+
@xlsx = 'set_column06.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
chart = workbook.add_chart(:type => 'line', :embedded => 1)
|
18
|
+
|
19
|
+
bold = workbook.add_format(:bold => 1)
|
20
|
+
italic = workbook.add_format(:italic => 1)
|
21
|
+
|
22
|
+
# For testing, copy the randomly generated axis ids in the target xlsx file.
|
23
|
+
chart.instance_variable_set(:@axis_ids, [69197824, 69199360])
|
24
|
+
|
25
|
+
data = [
|
26
|
+
[1, 2, 3, 4, 5],
|
27
|
+
[2, 4, 6, 8, 10],
|
28
|
+
[3, 6, 9, 12, 15]
|
29
|
+
]
|
30
|
+
|
31
|
+
worksheet.write('A1', 'Foo', bold)
|
32
|
+
worksheet.write('B1', 'Bar', italic)
|
33
|
+
worksheet.write('A2', data )
|
34
|
+
|
35
|
+
worksheet.set_row_pixels(12, nil, nil, 1)
|
36
|
+
worksheet.set_column_pixels('F:F', nil, nil, 1)
|
37
|
+
|
38
|
+
chart.add_series(:values => '=Sheet1!$A$2:$A$6')
|
39
|
+
chart.add_series(:values => '=Sheet1!$B$2:$B$6')
|
40
|
+
chart.add_series(:values => '=Sheet1!$C$2:$C$6')
|
41
|
+
|
42
|
+
worksheet.insert_chart('E9', chart)
|
43
|
+
|
44
|
+
workbook.close
|
45
|
+
|
46
|
+
compare_for_regression
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionSetRow01 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_set_row01
|
14
|
+
@xlsx = 'set_row01.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.set_row(0, 0.75)
|
19
|
+
worksheet.set_row(1, 1.50)
|
20
|
+
worksheet.set_row(2, 2.25)
|
21
|
+
worksheet.set_row(3, 3)
|
22
|
+
|
23
|
+
worksheet.set_row(11, 9)
|
24
|
+
worksheet.set_row(12, 9.75)
|
25
|
+
worksheet.set_row(13, 10.50)
|
26
|
+
worksheet.set_row(14, 11.25)
|
27
|
+
|
28
|
+
worksheet.set_row(18, 14.25)
|
29
|
+
worksheet.set_row(20, 15.75)
|
30
|
+
worksheet.set_row(21, 16.50)
|
31
|
+
|
32
|
+
workbook.close
|
33
|
+
compare_for_regression
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionSetRow02 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_set_row02
|
14
|
+
@xlsx = 'set_row01.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.set_row_pixels(0, 1)
|
19
|
+
worksheet.set_row_pixels(1, 2)
|
20
|
+
worksheet.set_row_pixels(2, 3)
|
21
|
+
worksheet.set_row_pixels(3, 4)
|
22
|
+
|
23
|
+
worksheet.set_row_pixels(11, 12)
|
24
|
+
worksheet.set_row_pixels(12, 13)
|
25
|
+
worksheet.set_row_pixels(13, 14)
|
26
|
+
worksheet.set_row_pixels(14, 15)
|
27
|
+
|
28
|
+
worksheet.set_row_pixels(18, 19)
|
29
|
+
worksheet.set_row_pixels(20, 21)
|
30
|
+
worksheet.set_row_pixels(21, 22)
|
31
|
+
|
32
|
+
workbook.close
|
33
|
+
compare_for_regression
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionSetRow03 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_set_row03
|
14
|
+
@xlsx = 'set_row03.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.set_row(0, 0.75)
|
19
|
+
worksheet.set_row(1, 1.50)
|
20
|
+
worksheet.set_row(2, 2.25)
|
21
|
+
worksheet.set_row(3, 3)
|
22
|
+
|
23
|
+
worksheet.set_row(11, 9)
|
24
|
+
worksheet.set_row(12, 9.75)
|
25
|
+
worksheet.set_row(13, 10.50)
|
26
|
+
worksheet.set_row(14, 11.25)
|
27
|
+
|
28
|
+
worksheet.set_row(18, 14.25)
|
29
|
+
worksheet.set_row(20, 15.75, nil, 1)
|
30
|
+
worksheet.set_row(21, 16.50)
|
31
|
+
|
32
|
+
workbook.close
|
33
|
+
compare_for_regression
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
class TestRegressionSetRow04 < Minitest::Test
|
5
|
+
def setup
|
6
|
+
setup_dir_var
|
7
|
+
end
|
8
|
+
|
9
|
+
def teardown
|
10
|
+
@tempfile.close(true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_set_row04
|
14
|
+
@xlsx = 'set_row03.xlsx'
|
15
|
+
workbook = WriteXLSX.new(@io)
|
16
|
+
worksheet = workbook.add_worksheet
|
17
|
+
|
18
|
+
worksheet.set_row_pixels(0, 1)
|
19
|
+
worksheet.set_row_pixels(1, 2)
|
20
|
+
worksheet.set_row_pixels(2, 3)
|
21
|
+
worksheet.set_row_pixels(3, 4)
|
22
|
+
|
23
|
+
worksheet.set_row_pixels(11, 12)
|
24
|
+
worksheet.set_row_pixels(12, 13)
|
25
|
+
worksheet.set_row_pixels(13, 14)
|
26
|
+
worksheet.set_row_pixels(14, 15)
|
27
|
+
|
28
|
+
worksheet.set_row_pixels(18, 19)
|
29
|
+
worksheet.set_row_pixels(20, 21, nil, 1)
|
30
|
+
worksheet.set_row_pixels(21, 22)
|
31
|
+
|
32
|
+
workbook.close
|
33
|
+
compare_for_regression
|
34
|
+
end
|
35
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|