1 package Excel::Template::Element::Cell;
7 @ISA = qw(Excel::Template::Element);
9 use Excel::Template::Element;
15 my $self = $class->SUPER::new(@_);
17 $self->{TXTOBJ} = Excel::Template::Factory->create('TEXTOBJECT');
27 my $txt = $context->get($self, 'TEXT');
30 my $txt_obj = Excel::Template::Factory->create('TEXTOBJECT');
31 push @{$txt_obj->{STACK}}, $txt;
32 $txt = $txt_obj->resolve($context);
34 elsif ($self->{TXTOBJ})
36 $txt = $self->{TXTOBJ}->resolve($context)
40 UNI_YES $txt = Unicode::String::utf8('');
52 $context->active_worksheet->write(
53 (map { $context->get($self, $_) } qw(ROW COL)),
54 $self->get_text($context),
55 $context->active_format,
73 Excel::Template::Element::Cell - Excel::Template::Element::Cell
77 To actually write stuff to the worksheet
85 Excel::Template::Element
93 This is the text to write to the cell. This can either be text or a parameter
94 with a dollar-sign in front of the parameter name.
98 Optionally, you can specify which column you want this cell to be in. It can be
99 either a number (zero-based) or an offset. See Excel::Template for more info on
100 offset-based numbering.
104 There will be more parameters added, as features are added.
108 Excel::Template::Element::Formula
112 This will consume one column on the current row.
120 <cell text="Some Text Here"/>
121 <cell>Some other text here</cell>
123 <cell text="$Param2"/>
124 <cell>Some <var name="Param"> text here</cell>
126 In the above example, four cells are written out. The first two have text hard-
127 coded. The second two have variables. The third and fourth items have another
128 thing that should be noted. If you have text where you want a variable in the
129 middle, you have to use the latter form. Variables within parameters are the
130 entire parameter's value.
132 Please see Spreadsheet::WriteExcel for what constitutes a legal formula.
134 =head1 BACK-REFERENCES
136 Currently, you can only use a hard-coded formula. The next release will add the
137 capability to have a formula reference other nodes in the template dynamically.
141 Rob Kinyon (rkinyon@columbus.rr.com)