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.
my $columnEvidence; foreach my $e (@{$xmlData->{columnEvidence}}) { $columnEvidence += "'$e',"; } #column: evidence $worksheet[$counterWorkSheet]->data_validation('E'.$counterRow, { validate => 'list', value => [ $columnEvidence ] });
Has someone an idea how I can fill the data_validation field dynamically with content from an array?

In reply to Data_validation in Spreadsheet::WriteExcel by sushi2k

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.