酒店预订平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

faq.md 2.3 KiB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Frequently asked questions
  2. ## There seems to be a problem with character encoding...
  3. It is necessary to use UTF-8 encoding for all texts in PhpSpreadsheet.
  4. If the script uses different encoding then you can convert those texts
  5. with PHP's `iconv()` or `mb_convert_encoding()` functions.
  6. ## Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) in zzz on line aaa
  7. PhpSpreadsheet holds an "in memory" representation of a spreadsheet, so
  8. it is susceptible to PHP's memory limitations. The memory made available
  9. to PHP can be increased by editing the value of the `memory_limit`
  10. directive in your `php.ini` file, or by using
  11. `ini_set('memory_limit', '128M')` within your code.
  12. Some Readers and Writers are faster than others, and they also use
  13. differing amounts of memory.
  14. ## Protection on my worksheet is not working?
  15. When you make use of any of the worksheet protection features (e.g. cell
  16. range protection, prohibiting deleting rows, ...), make sure you enable
  17. worksheet security. This can for example be done like this:
  18. ``` php
  19. $spreadsheet->getActiveSheet()->getProtection()->setSheet(true);
  20. ```
  21. ## Feature X is not working with Reader\_Y / Writer\_Z
  22. Not all features of PhpSpreadsheet are implemented in all of the Reader
  23. / Writer classes. This is mostly due to underlying libraries not
  24. supporting a specific feature or not having implemented a specific
  25. feature.
  26. For example autofilter is not implemented in PEAR
  27. Spreadsheet\_Excel\_writer, which is the base of our Xls writer.
  28. We are slowly building up a list of features, together with the
  29. different readers and writers that support them, in the [features cross
  30. reference](./references/features-cross-reference.md).
  31. ## Formulas don't seem to be calculated in Excel2003 using compatibility pack?
  32. This is normal behaviour of the compatibility pack, `Xlsx` displays this
  33. correctly. Use `\PhpOffice\PhpSpreadsheet\Writer\Xls` if you really need
  34. calculated values, or force recalculation in Excel2003.
  35. ## Setting column width is not 100% accurate
  36. Trying to set column width, I experience one problem. When I open the
  37. file in Excel, the actual width is 0.71 less than it should be.
  38. The short answer is that PhpSpreadsheet uses a measure where padding is
  39. included. See [how to set a column's width](./topics/recipes.md#setting-a-columns-width)
  40. for more details.