Thread Spreadsheet::WriteExcel - Bedingte Formatierung
(5 answers)
Opened by Gast at 2008-03-26 12:06
Aber Du kannst es ja so machen:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #! /usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; my $workbook = new Spreadsheet::WriteExcel('hallo.xls'); die "Problems creating new Excel file: $!" unless defined $workbook; my $sheet = $workbook -> add_worksheet(); my $cell = 0; for( 100, 10, 5 ){ my $format= $workbook -> add_format(); my $color = 'green'; if( $_ < 10 ){ $color = 'red'; } elsif( $_ > 10 ){ $color = 'blue'; } $format->set_bg_color( $color ); $sheet -> write(0, $cell++, $_, $format); } $workbook -> close() or die "Error closing file: $!"; OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |