dongxing2302 2016-04-25 07:23
浏览 133

如何超过.xls excel使用PHPExcel下拉单元格值长度

I guys sorry for my English but i need help i am using PHPExcel Library for creation of xls file in PHP. i am making a drop down in this xls using this code

$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_LIST );
$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_INFORMATION );
$objValidation->setAllowBlank(false);
$objValidation->setShowInputMessage(true);
$objValidation->setShowErrorMessage(true);
$objValidation->setShowDropDown(true);
$objValidation->setErrorTitle('Input error');
$objValidation->setError('Value is not in list.');
$objValidation->setPromptTitle('Pick from list');
$objValidation->setPrompt('Please pick a value from the drop-down list.');
$objValidation->setFormula1('"Item A,Item B,Item C,Item D,Item E,Item F"');

Its working fine but it only allow you to enter 250 characters only in this setFormula1 for this drop down cell if i enter more than 250 its not working. How can i enter values more than this 250 limit i have googled it but couldn't find any solution .....

  • 写回答

1条回答 默认 最新

  • douxing8323 2016-04-25 08:39
    关注

    Despite Anthony's comments and criticism of PHPExcel, this is not a PHPExcel limitation, it's an MS Excel limitation, and the way to overcome it is the same as it is in MS Excel itself.

    You don't define the list of dropdown options directly in the formula; you define a range of cells containing the options (perhaps in a hidden worksheet), and then set the formula to an actual formula, e.g. ='DropdownSheet'!A1:A100

    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号