kaiser_naren has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I would like to know if its possible to create a drop down list in every row of a particular column of a Spreadsheet so that users can select a value from those listed in the drop down box. I understand that there is an 'autofilter' option to filter rows based on a particular column value in the WriteExcel module. But this does not suit my requirement. Any help would be wonderful.

Replies are listed 'Best First'.
Re: Drop down list box in Spreadsheet
by roboticus (Chancellor) on Feb 01, 2008 at 22:08 UTC
    kaiser_naren:

    I've not tried building a spreadsheet with drop-downs in it before. But when I try to do anything special in a spreadsheet, I'll often make one by hand and take it apart with Spreadsheet::ParseExcel to see what kinds of things I need to do. (It doesn't always work, as Spreadsheet::ParseExcel isn't perfect, and Spreadsheet::WriteExcel doesn't always have the method I want. But I've been generally successful.

    On the cases where I've not been successful, I've saved the spreadsheet in XML format and perused that for clues. (As in, I wonder if the drop-down is signalled by a special formatting code, or some such...)

    When even that doesn't work, I cop out and write a spreadsheet template that reads its data from a data source (database, CSV file, etc.) and populate the data source with some perl code.

    ...roboticus

      roboticus,

      Thanks for the info. I will try your method to see if there is any special format code involved.

      Cheers,
      Naren
Re: Drop down list box in Spreadsheet
by kyle (Abbot) on Feb 01, 2008 at 20:51 UTC

    Hi kaiser_naren,

    Welcome to the Monastery. Your question could do with some more detail. Have a look at PerlMonks FAQ and How do I post a question effectively?

    Specifically, it might be helpful to have more information about the situation you're in, what you're trying to accomplish, what you've tried already, and what the results have been so far.

      Hi Kyle,

      I am developing a web interface for chip designers which, besides other functions, helps them in keeping track of the status of some of their testcases.

      The data is stored in a MySQL database and shown on a web page using Template Toolkit. The table has columns like, Testcase Name, Owner, Status, etc. I provide a link to the users to download this info as a Spreadsheet/MS Excel file. I write the data into the Spreadsheet using WriteExcel module.

      There is a new requirement that I should provide drop down list boxes in the Status column of the Spreadsheet containing values like '0% completed', '25% completed', etc., which the user can select according to the progress of the testcase(in the downloaded file).

      So I would like to know if it is possible to have such drop down boxes for the 'Status' columns for each of the testcases which will contain values I can specify.

      I have gone through the WriteExcel module and found the option 'autofilter' which is basically used to filter the rows based on the value selected in one of the Heading columns. But this does not help my situation as I can not specify values in the drop down list of my own. It just can accept a range of cell values already in the Spreadsheet.

      Hope I explained my problem clearly. Please let me know if it is not clear yet. Thanks for the help.

      Cheers,
      Naren.