sushi2k has asked for the wisdom of the Perl Monks concerning the following question:
Hy Perlmonks,
as usual I've got a little problem with Spreadsheet::WriteExcel ;-) More specific with data_validation.
I have three columns with data_validation fields, like this one:
#column: rating $worksheet[$counterWorkSheet]->data_validation('F'.$counte +rRow, { validate => 'list', value => ['good', 'sufficient', 'unsatisfied', 'cri +tical'], });
On creation time of the xls the perl-script is parsing also an xml-file that specifies some formatting (like color, font and so on). So that a user hasn't to look up in the code if he want's to change such peanuts. But I want also to specify in this xml-file the values of a data_validation field.
My problem is now, that if I create a variable with the content that belongs to the data_validation field and put it as argument in value, it will appear as one value. It doesn't recognise the quotes (') I'm inserting in the $columnEvidence.Has someone an idea how I can fill the data_validation field dynamically with content from an array?my $columnEvidence; foreach my $e (@{$xmlData->{columnEvidence}}) { $columnEvidence += "'$e',"; } #column: evidence $worksheet[$counterWorkSheet]->data_validation('E'.$counterRow, { validate => 'list', value => [ $columnEvidence ] });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data_validation in Spreadsheet::WriteExcel
by jmcnamara (Monsignor) on Aug 10, 2009 at 15:42 UTC | |
|
Re: Data_validation in Spreadsheet::WriteExcel
by biohisham (Priest) on Aug 06, 2009 at 14:18 UTC |