1 package Excel::Template::Container::Worksheet;
7 @ISA = qw(Excel::Template::Container);
9 use Excel::Template::Container;
12 sub exit_scope { $_[1]->active_worksheet( undef ) }
19 my $worksheet = $context->new_worksheet( $self );
21 my $password = $context->get( $self, 'PROTECT' );
22 if (defined $password)
24 $worksheet->protect( $password );
27 $worksheet->keep_leading_zeros( 1 )
28 if $context->mark( 'keep_leading_zeros' );
30 if ( $context->get( $self, 'LANDSCAPE' ) && !$self->{PORTRAIT} ) {
31 $worksheet->set_landscape;
33 elsif ( $context->get( $self, 'PORTRAIT' ) ) {
34 $worksheet->set_portrait;
37 return $self->SUPER::render($context);
45 Excel::Template::Container::Worksheet - Excel::Template::Container::Worksheet
49 To provide a new worksheet.
57 Excel::Template::Container
65 This is the name of the worksheet to be added.
69 If the attribute exists, it will mark the worksheet as being protected. Whatever
70 value is set will be used as the password.
72 This activates the HIDDEN and LOCKED nodes.
74 =item * KEEP_LEADING_ZEROS
76 This will change the behavior of the worksheet to preserve leading zeros.
80 This will set the worksheet's orientation to landscape.
84 This will set the worksheet's orientation to portrait.
86 While this is the default, it's useful to override the default at times. For
87 example, in the following situation:
89 <workbook landscape="1">
93 <worksheet portrait="1">
101 In that example, the first and third worksheets will be landscape (inheriting
102 it from the workbook node), but the second worksheet will be portrait.
120 <worksheet name="My Taxes">
124 In the above example, the children will be executed in the context of the
125 "My Taxes" worksheet.
129 Rob Kinyon (rob.kinyon@gmail.com)