~ubuntu-branches/ubuntu/trusty/horae/trusty

« back to all changes in this revision

Viewing changes to 0CPAN/Spreadsheet-WriteExcel-2.15/examples/formula_result.pl

  • Committer: Bazaar Package Importer
  • Author(s): Carlo Segre
  • Date: 2008-02-23 23:13:02 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080223231302-mnyyxs3icvrus4ke
Tags: 066-3
Apply patch to athena_parts/misc.pl for compatibility with 
perl-tk 804.28.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
 
3
 
#######################################################################
4
 
#
5
 
# Example of how to write Spreadsheet::WriteExcel formulas with a user
6
 
# specified result. This is generally only required when writing a
7
 
# spreadsheet for an application other than Excel where the formula
8
 
# isn't evaluated.
9
 
#
10
 
# reverse('�'), August 2005, John McNamara, jmcnamara@cpan.org
11
 
#
12
 
 
13
 
use strict;
14
 
use Spreadsheet::WriteExcel;
15
 
 
16
 
my $workbook  = Spreadsheet::WriteExcel->new('formula_result.xls');
17
 
my $worksheet = $workbook->add_worksheet();
18
 
my $format    = $workbook->add_format(color => 'blue');
19
 
 
20
 
 
21
 
$worksheet->write('A1', '=1+2');
22
 
$worksheet->write('A2', '=1+2',                     $format, 4);
23
 
$worksheet->write('A3', '="ABC"',                   undef,   'DEF');
24
 
$worksheet->write('A4', '=IF(A1 > 1, TRUE, FALSE)', undef,   'TRUE');
25
 
$worksheet->write('A5', '=1/0',                     undef,   '#DIV/0!');
26
 
 
27
 
 
28
 
__END__