anonymonk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks. I am working on a script that prints a modifiable list of numeric, percentage, and currency values into an .xls file. This file will be viewed by users so formatting matters in this case. When I write a number formatted with commas and a dollar sign or a percentage it displays the information correctly but it also has green triangles, which display a message that states "the number in this cell is formatted as text", in the top left corner of each cell with a formatted number in it. is there a way to tell the excel file to ignore it when this happens or a way to format the values as text that will fix this? i've already tried the below method, it did not work.
$worksheet->write_string(x, y, $value)here is some code that works perfectly as an example of what i'm talking about. thanks in advance.
use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new("Example.xls"); my $worksheet = $workbook->add_worksheet(); $worksheet->write_string(0, 4, '$77,777'); $workbook->close();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Spreadsheet::WriteExcel cell formatting.
by fishmonger (Chaplain) on Sep 22, 2015 at 19:19 UTC | |
by anonymonk (Acolyte) on Sep 22, 2015 at 19:41 UTC | |
by fishmonger (Chaplain) on Sep 22, 2015 at 19:50 UTC | |
by SimonPratt (Friar) on Sep 23, 2015 at 16:04 UTC | |
by anonymonk (Acolyte) on Sep 23, 2015 at 18:34 UTC | |
by soonix (Chancellor) on Sep 24, 2015 at 08:11 UTC | |
Re: Spreadsheet::WriteExcel cell formatting.
by locked_user sundialsvc4 (Abbot) on Sep 23, 2015 at 14:43 UTC |