diff options
| author | Randy Morgan <[email protected]> | 2012-12-14 13:15:16 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-12-14 13:16:04 +0900 |
| commit | b1600deadaafdb396c5cc7ca9d448e8adab8ac11 (patch) | |
| tree | ba560b3826c22c51d37c515d6b0232bf2a4de94e /examples/example.rb | |
| parent | 890b404c8f748a332c8c0cbcfec6aa44b7384fa4 (diff) | |
| download | caxlsx-b1600deadaafdb396c5cc7ca9d448e8adab8ac11.tar.gz caxlsx-b1600deadaafdb396c5cc7ca9d448e8adab8ac11.zip | |
Added formula_values options and specs for sheet format pr.
This lets cache formula values and specify the default row height so
that iOS and Max OSX previews render properly
Diffstat (limited to 'examples/example.rb')
| -rwxr-xr-x | examples/example.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/example.rb b/examples/example.rb index 47b0a67f..94b81444 100755 --- a/examples/example.rb +++ b/examples/example.rb @@ -44,7 +44,7 @@ examples << :conditional_formatting examples << :streaming examples << :shared_strings examples << :no_autowidth - +examples << :cached_formula p = Axlsx::Package.new wb = p.workbook #``` @@ -724,11 +724,20 @@ if examples.include? :no_autowidth wb.add_worksheet(:name => "Manual Widths") do | sheet | sheet.add_row ['oh look! no autowidth'] end - p.validate.each { |e| puts e.message } p.serialize("no-use_autowidth.xlsx") end #``` +if examples.include? :cached_formula + p = Axlsx::Package.new + p.use_shared_strings = true + wb = p.workbook + wb.add_worksheet(:name => "cached formula") do | sheet | + puts sheet.sheet_format_pr + sheet.add_row [1, 2, '=A1+B1'], :formula_values => [nil, nil, 3] + end + p.serialize 'cached_formula.xlsx' +end |
