ImageVerifierCode 换一换
格式:DOC , 页数:47 ,大小:734KB ,
资源ID:8320146      下载积分:10 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/8320146.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(PHPExceldeveloperdocumentation.doc)为本站上传会员【仙人****88】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

PHPExceldeveloperdocumentation.doc

1、 PHPExcel Developer Documentation 1. Contents PHPExcel Developer Documentation 1 1. Contents 2 2. Prerequisites 4 2.1. Software requirements 4 2.2. Installation instructions 4 2.3. Getting started 4 2.4. Useful links and to

2、ols 4 2.4.1. OpenXML / SpreadsheetML 4 2.4.2. Frequently asked questions 5 2.4.3. Tutorials 5 3. Architecture 6 3.1. Schematical 6 3.2. Lazy Loader 6 3.3. Spreadsheet in memory 6 3.4. Readers and writers 6 3.5. Fluent interfaces 7 4. Creating a spreadsheet 9 4.1. The PHPExcel class 9 4.2

3、 Configuration Settings 9 4.2.1. Cell Caching 9 4.2.2. Language/Locale 11 4.3. Clearing a Workbook from memory 11 4.4. Worksheets 11 4.5. Accessing cells 11 4.5.1. Setting a cell value by coordinate 11 4.5.2. Retrieving a cell by coordinate 11 4.5.3. Setting a cell value by column and row 1

4、1 4.5.4. Retrieving a cell by column and row 12 4.5.5. Looping cells 12 4.5.6. Using value binders to facilitate data entry 13 4.6. PHPExcel recipes 14 4.6.1. Setting a spreadsheet’s metadata 14 4.6.2. Setting a spreadsheet’s active sheet 14 4.6.3. Write a date into a cell 14 4.6.4. Write a

5、formula into a cell 15 4.6.5. Locale Settings for Formulae 15 4.6.6. Write a newline character "\n" in a cell (ALT+"Enter") 16 4.6.7. Explicitly set a cell’s datatype 17 4.6.8. Change a cell into a clickable URL 17 4.6.9. Setting a worksheet’s page orientation and size 17 4.6.10. Page Setup: S

6、caling options 17 4.6.11. Page margins 18 4.6.12. Center a page horizontally/vertically 19 4.6.13. Setting the print header and footer of a worksheet 19 4.6.14. Setting printing breaks on a row or column 20 4.6.15. Show/hide gridlines when printing 20 4.6.16. Setting rows/columns to repeat at

7、top/left 21 4.6.17. Specify printing area 21 4.6.18. Formatting cells 21 4.6.19. Number formats 22 4.6.20. Alignment and wrap text 23 4.6.21. Setting the default style of a workbook 23 4.6.22. Styling cell borders 23 4.6.23. Conditional formatting a cell 24 4.6.24. Add a comment to a cell 25

8、 4.6.25. Apply autofilter to a range of cells 25 4.6.26. Setting security on a spreadsheet 25 4.6.27. Setting data validation on a cell 26 4.6.28. Setting a column’s width 27 4.6.29. Show/hide a column 27 4.6.30. Group/outline a column 27 4.6.31. Setting a row’s height 28 4.6.32. Show/hide a

9、 row 28 4.6.33. Group/outline a row 28 4.6.34. Merge/unmerge cells 28 4.6.35. Inserting rows/columns 28 4.6.36. Add a drawing to a worksheet 29 4.6.37. Add rich text to a cell 29 4.6.38. Define a named range 29 4.6.39. Redirect output to a client’s web browser 30 4.6.40. Setting the default

10、column width 31 4.6.41. Setting the default row height 31 4.6.42. Add a GD drawing to a worksheet 31 4.6.43. Setting worksheet zoom level 31 4.6.44. Sheet tab color 31 4.6.45. Creating worksheets in a workbook 31 4.6.46. Hidden worksheets (Sheet states) 31 4.6.47. Right-to-left worksheet 32

11、5. Performing formula calculations 33 5.1. Using the PHPExcel calculation engine 33 5.2. Known limitations 34 5.2.1. Operator precedence 34 5.2.2. Formulas involving numbers and text 34 6. Reading and writing to file 35 6.1. PHPExcel_IOFactory 35 6.1.1. Creating PHPExcel_Reader_IReader using

12、PHPExcel_IOFactory 35 6.1.2. Creating PHPExcel_Writer_IWriter using PHPExcel_IOFactory 35 6.2. Excel 2007 (SpreadsheetML) file format 35 6.2.1. PHPExcel_Reader_Excel2007 36 6.2.2. PHPExcel_Writer_Excel2007 36 6.3. Serialized file format 37 6.3.1. PHPExcel_Reader_Serialized 37 6.3.2. PHPExcel_

13、Writer_Serialized 37 6.4. Excel 5 (BIFF) file format 37 6.4.1. PHPExcel_Reader_Excel5 37 6.4.2. PHPExcel_Writer_Excel5 38 6.5. Excel 2003 XML file format 38 6.5.1. PHPExcel_Reader_Excel2003XML 38 6.6. Symbolic LinK (SYLK) 39 6.6.1. PHPExcel_Reader_SYLK 39 6.7. CSV (Comma Separated Values) 40

14、 6.7.1. PHPExcel_Reader_CSV 40 6.7.2. PHPExcel_Writer_CSV 40 6.8. HTML 41 6.8.1. PHPExcel_Writer_HTML 41 6.9. PDF 43 6.9.1. PHPExcel_Writer_PDF 43 6.10. Generating Excel files from templates (read, modify, write) 44 7. Credits 45 Appendix A: Valid array keys for style applyFromArray() 46

15、 2. Prerequisites 2.1. Software requirements The following software is required to develop using PHPExcel: » PHP version 5.2.0 or newer » PHP extension php_zip enabled *) » PHP extension php_xml enabled » PHP extension php_gd2 enabled (if not compiled in) *) php_zip is only needed by PHPExc

16、el_Reader_Excel2007, PHPExcel_Writer_Excel2007 and PHPExcel_Reader_OOCalc. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not. 2.2. Installation instructions Installation is quite easy: copy the contents of the Classes folder to an

17、y location in your application required. Example: If your web root folder is /var/www/ you may want to create a subfolder called /var/www/Classes/ and copy the files into that folder so you end up with files: /var/www/Classes/PHPExcel.php /var/www/Classes/PHPExcel/Calculation.php /var/www/

18、Classes/PHPExcel/Cell.php ... 2.3. Getting started A good way to get started is to run some of the tests included in the download. Copy the "Tests" folder next to your "Classes" folder from above so you end up with: /var/www/Tests/01simple.php /var/www/Tests/02types.php ... Start running

19、 the tests by pointing your browser to the test scripts: ... Note: It may be necessary to modify the include/require statements at the beginning of each of the test scripts if your "Classes" folder from above is named differently. 2.4. Useful links and tools There are some links and tool

20、s which are very useful when developing using PHPExcel. Please refer to the PHPExcel CodePlex pages for an update version of the list below. 2.4.1. OpenXML / SpreadsheetML » File format documentation http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm » OpenXML Exp

21、lained e-book http://openxmldeveloper.org/articles/1970.aspx » Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats » OpenXML Package Explorer 2.4.2. Frequently asked questions The up-to-date F.A.Q. page for PHPExcel can be found on There seems to be

22、a problem with character encoding... It is necessary to use UTF-8 encoding for all texts in PHPExcel. If the script uses different encoding then it is possible to convert the texts with PHP's iconv() function. PHP complains about ZipArchive not being found Make sure you meet all requirements, esp

23、ecially php_zip extension should be enabled. Excel 2007 cannot open the file generated by PHPExcel_Writer_2007 on Windows “Excel found unreadable content in '*.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.” Some versions of the

24、 php_zip extension on Windows contain an error when creating ZIP files. The version that can be found on should work at all times. Protection on my worksheet is not working? When you make use of any of the worksheet protection features (e.g. cell range protection, prohibiting deleting rows, ...),

25、 make sure you enable worksheet security. This can for example be done like this: $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); Feature X is not working with PHPExcel_Writer_Y Not all features of PHPExcel are implemented in the Reader / Writer classes. This is mostly due to u

26、nderlying libraries not supporting a specific feature or not having implemented a specific feature. For example autofilter is not implemented in PEAR Spreadsheet_Excel_writer, which is the base of our Excel5 writer. Formulas don’t seem to be calculated in Excel2003 using compatibility pack? Thi

27、s is normal behaviour of the compatibility pack, Excel2007 displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003. Setting column width is not 100% accurate Trying to set column width, I experience one problem. When I open the

28、file in Excel, the actual width is 0.71 less than it should be. The short answer is that PHPExcel uses a measure where padding is included. See section: “Setting a column’s width” for more details. 2.4.3. Tutorials » English PHPExcel tutorial http://openxmldeveloper » French PHPExcel tutor

29、ial http://g- » Russian PHPExcel Blog Postings http://www.web- 3. Architecture 3.1. Schematical 3.2. Lazy Loader PHPExcel implements an autoloader or “lazy loader”, which means that it is not necessary to include every file within PHPExcel. It is only necessary to include the initial PHPE

30、xcel class file, then the autoloader will include other class files as and when required, so only those files that are actually required by your script will be loaded into PHP memory. The main benefit of this is that it reduces the memory footprint of PHPExcel itself, so that it uses less PHP memory

31、 If your own scripts already define an autoload function, then this may be overwritten by the PHPExcel autoload function. For example, if you have: function __autoload($class) { ... } Do this instead: function myAutoload($class) { ... } spl_autoload_register('myAutoload');

32、 Your autoloader will then co-exist with the autoloader of PHPExcel. 3.3. Spreadsheet in memory PHPExcel’s architecture is built in a way that it can serve as an in-memory spreadsheet. This means that, if one would want to create a web based view of a spreadsheet which communicates with PHPExcel

33、’s object model, he would only have to write the front-end code. Just like desktop spreadsheet software, PHPExcel represents a spreadsheet containing one or more worksheets, which contain cells with data, formulas, images, … 3.4. Readers and writers On its own, PHPExcel does not provide the fun

34、ctionality to read from or write to a persisted spreadsheet (on disk or in a database). To provide that functionality, readers and writers can be used. By default, the PHPExcel package provides some readers and writers, including one for the Open XML spreadsheet format (a.k.a. Excel 2007 file for

35、mat). You are not limited to the default readers and writers, as you are free to implement the PHPExcel_Writer_IReader and PHPExcel_Writer_IWriter interface in a custom class. 3.5. Fluent interfaces PHPExcel supports fluent interfaces in most locations. This means that you can easily “chain” c

36、alls to specific methods without requiring a new PHP statement. For example, take the following code: $objPHPExcel->getProperties()->setCreator("Maarten Balliauw"); $objPHPExcel->getProperties()->setLastModifiedBy("Maarten Balliauw"); $objPHPExcel->getProperties()->setTitle("Office 2007 XLSX Te

37、st Document"); $objPHPExcel->getProperties()->setSubject("Office 2007 XLSX Test Document"); $objPHPExcel->getProperties()->setDescription("Test document for Office 2007 XLSX, generated using PHP classes."); $objPHPExcel->getProperties()->setKeywords("office 2007 openxml php"); $objPHPExcel->getP

38、roperties()->setCategory("Test result file"); This can be rewritten as: $objPHPExcel->getProperties() ->setCreator("Maarten Balliauw") ->setLastModifiedBy("Maarten Balliauw") ->setTitle("Office 2007 XLSX Test Document") ->setSubject("Office 2

39、007 XLSX Test Document") ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") ->setKeywords("office 2007 openxml php") ->setCategory("Test result file"); i Using fluent interfaces is not required Fluent interfaces have bee

40、n implemented to provide a convenient programming API. Use of them is not required, but can make your code easier to read and maintain. 4. Creating a spreadsheet 4.1. The PHPExcel class The PHPExcel class is the core of PHPExcel. It contains references to the contained worksheets, document secu

41、rity settings and document meta data. To simplify the PHPExcel concept: the PHPExcel class represents your workbook. 4.2. Configuration Settings Once you have included the PHPExcel files in your script, but before instantiating a PHPExcel object or loading a workbook file, there are a number of

42、 configuration options that can be set which will affect the subsequent behaviour of the script. 4.2.1. Cell Caching PHPExcel uses an average of about 1k/cell in your worksheets, so large workbooks can quickly use up available memory. Cell caching provides a mechanism that allows PHPExcel to maint

43、ain the cell objects in a smaller size of memory, on disk, or in APC, memcache or Wincache, rather than in PHP memory. This allows you to reduce the memory usage for large workbooks, although at a cost of speed to access cell data. By default, PHPExcel still holds all cell objects in memory, but yo

44、u can specify alternatives. To enable cell caching, you must call the PHPExcel_Settings::setCacheStorageMethod() method, passing in the caching method that you wish to use. $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_in_memory; PHPExcel_Settings::setCacheStorageMethod($cacheMethod

45、); setCacheStorageMethod() will return a boolean true on success, false on failure (for example if trying to cache to APC when APC is not enabled). A separate cache is maintained for each individual worksheet, and is automatically created when the worksheet is instantiated based on the caching

46、 method and settings that you have configured. You cannot change the configuration settings once you have started to read a workbook, or have created your first worksheet. Currently, the following caching methods are available. PHPExcel_CachedObjectStorageFactory::cache_in_memory; The default

47、 If you don’t initialise any caching method, then this is the method that PHPExcel will use. Cell objects are maintained in PHP memory as at present. PHPExcel_CachedObjectStorageFactory::cache_in_memory_serialized; Using this caching method, cells are held in PHP memory as an array of serialized

48、objects, which reduces the memory footprint with minimal performance overhead. PHPExcel_CachedObjectStorageFactory::cache_in_memory_gzip; Like cache_in_memory_serialized, this method holds cells in PHP memory as an array of serialized objects, but gzipped to reduce the memory usage still further, although access to read or write a cell is slightly slower. PHPExcel_CachedObjectStorageFactory::cache_to_discISAM; When using cache_to_disc

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服