shilpam has asked for the wisdom of the Perl Monks concerning the following question:
my $workbook = Spreadsheet::WriteExcel->new($file_name); my $worksheet = $workbook->add_worksheet(); my $format_heading = $workbook->add_format(); my $condition = "some value"; getFormat($condition); $worksheet->write($row_position, $column_position, $some_info,$format_ +heading); sub getFormat { $condition = shift; if (Condition 1){ $format_heading->set_bgcolor('yellow'); } elsif (Condition 2){ $format_heading->set_bgcolor('pink'); $format_heading->set_color('red'); } elsif (Condition 3){ $format_heading->set_bgcolor('blue'); } else { $format_heading->set_bgcolor('white'); # Default color } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Conditional Formatting with Spreadsheet::WriteExcel
by prasadbabu (Prior) on Jan 03, 2006 at 06:55 UTC | |
by shilpam (Sexton) on Jan 04, 2006 at 06:12 UTC | |
by jmcnamara (Monsignor) on Jan 04, 2006 at 10:14 UTC | |
by prasadbabu (Prior) on Jan 04, 2006 at 09:34 UTC | |
|
Re: Conditional Formatting with Spreadsheet::WriteExcel
by thor (Priest) on Jan 03, 2006 at 22:38 UTC | |
|
Re: Conditional Formatting with Spreadsheet::WriteExcel
by davidrw (Prior) on Jan 03, 2006 at 22:10 UTC |