PHP-Xlswriter
  • Why use xlswriter
  • English
    • Install
      • Env requirements
      • PECL (recommend)
      • Mac
      • Alpine
      • Ubuntu
      • Windows
    • Quick start
      • Create file
      • Read file
    • Read file
      • Worksheet list
      • Read file (full amount)
      • Read file (cursor)
      • Ignore blank cells
      • Ignore blank lines
      • Global row read type
      • Cell callback mode read
      • Read file by data type
      • Data type constant
    • Chart
      • Chart type constant
      • Data input
      • Doughnut chart
      • Area chart
      • Histogram chart
      • Bar chart
    • Cell
      • Insert text
      • Insert link
      • Insert formula
      • Insert date
      • Insert local image
      • Automatic filtering
      • Freeze Panes
      • Merge Cells
      • Row cell style
      • Column cell style
    • Memory model
      • Export - Fixed memory mode
    • Worksheet
      • Create worksheet
      • Switch worksheet
      • Gridlines
      • Zoom
      • Hide the current worksheet
      • Set the current worksheet as the first worksheet
    • Style
      • Combination style
      • Gloabl default style
    • Download
    • Style list
      • Italic
      • Align
      • Text deletion (text middle line)
      • Underline
      • Text wrap
      • Text color
      • Text size
      • Bold
      • Cell border
      • Border style constant
      • Background color
      • Color constant
      • Font
      • Number format
    • CSV
      • XLSX to CSV - Normal mode
      • XLSX to CSV - Callback function mode
    • Printed
      • Set print orientation-landscape
      • Set print orientation-portrait
    • Assistant functions
      • Column index transform
      • Get version
      • Get author
  • Project recommendation
  • 中文简体
    • 安装
      • 环境要求
      • PECL(推荐)
      • Mac
      • Ubuntu
      • Alpine
      • Windows
      • Docker多阶构建
    • 快速上手
      • 导出文件
      • 读取文件
      • 手动销毁资源
    • 读取文件
      • 工作表列表
      • 全量读取
      • 游标读取
      • 跳过指定行
      • 忽略空白单元格
      • 忽略空白行
      • 忽略跳过动作常量
      • 设置全局读取类型
      • 单元格回调模式读取
      • 数据类型读取
      • 数据类型常量
    • 图表
      • 图表类型常量
      • 填充数据
      • 圆环图
      • 面积图
      • 直方图
      • 条形图
    • 数据验证
      • 下拉列表
      • 范围约束
      • 大于约束
    • 单元格
      • 插入文字
      • 插入链接
      • 插入公式
      • 插入日期
      • 插入本地图片
      • 自动过滤
      • 冻结单元格
      • 合并单元格
      • 行单元格样式
      • 列单元格样式
    • 内存模式
      • 导出 - 固定内存模式
    • 工作表
      • 创建工作表
      • 切换工作表
      • 检查工作表是否存在
      • 网格线
      • 缩放
      • 隐藏当前工作表
      • 设置当前工作表为第一个工作表
    • 样式
      • 组合样式
      • 全局默认样式
    • 锁定保护
      • 密码保护
      • 解除保护
    • 打印
      • 纸张大小
      • 纸张方向
      • 纸张边距
      • 缩放比例
      • 设置打印方向 - 横向
      • 设置打印方向 - 纵向
    • 下载
    • 样式列表
      • 斜体
      • 对齐
      • 文本删除(文本中间划线)
      • 下划线
      • 文本换行
      • 文本颜色
      • 文本字号
      • 多样式文本
      • 粗体
      • 单元格边框
      • 边框样式常量
      • 背景颜色
      • 颜色常量
      • 字体
      • 数字格式化
    • CSV
      • XLSX转为CSV - 常规模式
      • XLSX转为CSV - 回调模式
    • 辅助函数
      • 列标字符转化
      • 设置当前写入行号
      • 获取当前写入行号
      • 获取扩展版本
      • 查看作者信息
    • 异常列表
      • 异常码列表
    • 常见问题
      • xls文件通过excel转成xlsx格式后无法读取
  • 项目推荐
Powered by GitBook
On this page
  • Benchmark
  • Export
  • Import

Was this helpful?

Why use xlswriter

NextEnglish

Last updated 5 years ago

Was this helpful?

Please refer to the image below. PHPExcel has been unable to work properly for memory reasons at 40,000 and 100000 points, but it can be resolved by modifying the ini configuration, but the time may take longer to complete the work;

xlswriter is a PHP C Extension that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file. It supports features such as:

  • 100% compatible Excel XLSX files.

  • Full Excel formatting.

  • Merged cells.

  • Defined names.

  • Autofilters.

  • Charts.

  • Data validation and drop down lists.

  • Worksheet PNG/JPEG images.

  • Memory optimization mode for writing large files.

  • Works on Linux, FreeBSD, OpenBSD, OS X, Windows.

  • Compiles for 32 and 64 bit.

  • FreeBSD License.

  • The only dependency is on zlib.

Benchmark

Test environment: Macbook Pro 13 inch, Intel Core i5, 16GB 2133MHz LPDDR3 Memory, 128GB SSD Storage.

Export

Two memory modes export 1 million rows of data (27 columns, data is string):

  • Normal mode: only 29S is needed, and the memory only needs 2083MB;

  • Fixed memory mode: only need 52S, memory only needs <1MB;

Import

1 million rows of data (1 columns, data is inter):

  • Full mode: Just 3S, the memory is only 558MB;

  • Cursor mode: Just 2.8S, memory is only <1MB;