Fixed minor installation and documentation issues
[p5sagit/Excel-Template.git] / lib / Excel / Template / Element / Backref.pm
CommitLineData
37513eae 1package Excel::Template::Element::Backref;
2
3use strict;
4use Spreadsheet::WriteExcel::Utility;
5
6BEGIN {
7 use vars qw(@ISA);
8 @ISA = qw(Excel::Template::Element);
9
10 use Excel::Template::Element;
11}
12
13sub resolve
14{
15 my $self = shift;
16 my ($context) = @_;
17
18 my $ref_name = $context->resolve($self, 'REF');
19
20 my ($row, $col) = $context->get_last_reference( $ref_name );
21 return '' unless defined $row && defined $col;
22
23 return xl_rowcol_to_cell( $row, $col );
24}
25
261;
27__END__
28
29=head1 NAME
30
8ca5e726 31Excel::Template::Element::Backref
37513eae 32
33=head1 PURPOSE
34
35Returns the cell location (i.e. B2) of the last cell to name this reference. To
36return the location of the entire range of cells to name this reference see RANGE.
37
38=head1 NODE NAME
39
b6bc5a5d 40BACKREF
37513eae 41
42=head1 INHERITANCE
43
44Excel::Template::Element
45
46=head1 ATTRIBUTES
47
48=over 4
49
50=item * REF
51
52This is the name of the reference to look up.
53
54=back 4
55
56=head1 CHILDREN
57
58None
59
60=head1 EFFECTS
61
62None
63
64=head1 DEPENDENCIES
65
66This will only be used within CELL tags.
67
68=head1 USAGE
69
70In the example...
71
72 <row>
73 <cell ref="this_cell"/><cell ref="that_cell"><cell ref="that_cell">
74 </row>
75 <row>
76 <formula>=<ref ref="this_cell">+<ref ref="that_cell"></formula>
77 </row>
78
79The formula in row 2 would be =A1+C1. C1 is the last to reference "that_cell".
80
81=head1 AUTHOR
82
83Rob Kinyon (rkinyon@columbus.rr.com)
84
85=head1 SEE ALSO
86
87CELL, RANGE
88
89=cut