Git Product home page Git Product logo

php-ext-xlswriter's Introduction

php-ext-xlswriter
php-ext-xlswriter
php-ext-xlswriter
php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter
php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter

Why use xlswriter

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;

php-excel

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:

Writer
  • 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.
Reader
  • Full read data
  • Cursor read data
  • Read by data type

Install

Unix
pecl install xlswriter
Windows

download dll

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;

Includes extensive and detailed instructions that make it easy to get started with xlswriter.

PECL Repository

pecl

IDE Helper

composer require viest/php-ext-xlswriter-ide-helper:dev-master

Exchange group

php-ext-xlswriter

Financial donation

php-ext-xlswriter

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

BSD License

FOSSA Status

Stargazers over time

Stargazers over time

php-ext-xlswriter's People

Contributors

fossabot avatar haid84 avatar molinchenxi avatar monkeywithacupcake avatar motecshine avatar petk avatar remicollet avatar sergeyklay avatar viest avatar weltling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-ext-xlswriter's Issues

请问如何给一个区域的单元都设置边框?

因为有时候打印的需要,表格需要是有边框的。基本上只要在某个区域内所有的单元都有边框就可以了,其中也包括了合并后的单元格(只要能呈现合并后单元格的边框就行)。
但目前我不知道应该如何设置。想请教您不知道是否有这个功能?如果有的话,能否写一个示例。
另外我看到之前issues中的->number('#,##0')设置,发现在文档中并没有这项的说明,不知道完整的方法说明在哪里能查看到?

Missing files in pecl archive

The "library" directory is not listed in the package.xml so not included in the pecl archive.

Building using --with-libxlsxwriter works
Building with bundled library is of course broken
make[1]: *** No rule to make target '/dev/shm/BUILD/php-pecl-xlswriter-1.2.3/NTS/library/third_party/minizip/ioapi.c', needed by 'library/third_party/minizip/ioapi.lo'. Stop.

同时设定多样式

对于一个栏位无法同时设定多疙样式组合
例如 置中粗体
对于同一栏位 多次设定
后面的设定会覆盖前面的设定

compile error

/usr/src/pecl/xlswriter-1.2.2/kernel/write.c: In function '_prepare_drawings':
/usr/src/pecl/xlswriter-1.2.2/kernel/write.c:370:13: error: too few arguments to function 'lxw_worksheet_prepare_chart'
lxw_worksheet_prepare_chart(worksheet, chart_ref_id, drawing_id,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/xlsxwriter/workbook.h:48:0,
from /usr/local/include/xlsxwriter.h:16,
from /usr/src/pecl/xlswriter-1.2.2/kernel/include.h:23,
from /usr/src/pecl/xlswriter-1.2.2/kernel/write.c:13:
/usr/local/include/xlsxwriter/worksheet.h:3151:6: note: declared here
void lxw_worksheet_prepare_chart(lxw_worksheet *worksheet,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:204: recipe for target 'kernel/write.lo' failed
make: *** [kernel/write.lo] Error 1
make: *** Waiting for unfinished jobs....

ubuntu 18.04
php 7.2.10

a parameter list without types is only allowed in a function definition

php-src/ext/excel/kernel/excel.h:29:25: error: a parameter list without types is only allowed in a function definition
VTIFUL_STARTUP_FUNCTION(excel);
^
In file included from main/internal_functions_cli.c:41:
In file included from /opt/build/php7/php-src/ext/excel/kernel/../php_xls_writer.h:16:
In file included from /opt/build/php7/php-src/ext/excel/kernel/include.h:29:

硬件不够,导致循环导出失败

循环导出,机器硬件不够的话,会卡死;
错误信息:Segmentation fault
GDB调试信息如下
#0 zend_mm_alloc_small (size=<optimized out>, bin_num=3, heap=0x7fb541000040) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_alloc.c:1273 #1 zend_mm_alloc_heap (size=32, heap=0x7fb541000040) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_alloc.c:1344 #2 _emalloc (size=size@entry=32) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_alloc.c:2433 #3 0x000000000082c391 in zend_string_alloc (persistent=<optimized out>, len=4) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_string.h:134 #4 zend_string_init (persistent=<optimized out>, len=4, str=0x7fb53a64bd00 "mode") at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_string.h:170 #5 _zend_hash_str_update (ht=ht@entry=0x7fb53391bcb0, str=str@entry=0x7fb53a64bd00 "mode", len=len@entry=4, pData=pData@entry=0x7ffcadf345b0) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_hash.c:651 #6 0x00007fb53a638cdb in php_phongo_readpreference_get_properties_hash (is_debug=<optimized out>, object=<optimized out>) at /tmp/pear/temp/mongodb/src/MongoDB/ReadPreference.c:249 #7 0x00000000008450f7 in gc_mark_grey (ref=0x7fb5351796a0) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:499 #8 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #9 0x00000000008451ef in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:563 #10 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #11 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #12 0x00000000008451ef in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:563 #13 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #14 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #15 0x00000000008451ef in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:563 #16 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #17 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #18 0x0000000000845166 in gc_mark_grey (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:511 #19 0x0000000000845fa3 in gc_mark_roots () at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:583 #20 zend_gc_collect_cycles () at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:1057 #21 0x0000000000845c4f in gc_possible_root (ref=0x7fb53403c410) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.c:286 #22 0x000000000082fd9a in gc_check_possible_root (ref=<optimized out>) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_gc.h:158 #23 i_zval_ptr_dtor (zval_ptr=0x7fb533829a68, zval_ptr=0x7fb533829a68) at /root/script/shell/install_software/src/php-7.2.4/Zend/zend_variables.h:51

mac php7.1 安装报错

环境:unix 系统
语言版本:php7.1

安装方式:sudo pecl install xlswriter (手动安装也失败,采用这种方式,安装过其他的扩展没有问题)

/private/tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:160:11: error: unknown type name 'z_crc_t'
const z_crc_t* pcrc_32_tab;
^
In file included from /private/tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:186:
/private/tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:35:53: error: unknown type name 'z_crc_t'
static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
^
/private/tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:48:51: error: unknown type name 'z_crc_t'
static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c)
^
/private/tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:65:69: error: unknown type name 'z_crc_t'
static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab)
^
/private/tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:94:28: error: unknown type name 'z_crc_t'
const z_crc_t* pcrc_32_tab,
^
5 errors generated.
make: *** [library/third_party/minizip/zip.lo] Error 1
ERROR: `make' failed

插入本地图片 方法,图片比例失真

直接使用文档中的方法,添加了一个二维码图片,图片被拉伸了。

附件中左侧为失真的图片,右侧为原图片。尝试使用 widthScale 参数调整,缩小90%比较接近,但也是不完全一致,是什么原因导致的呢?麻烦确认一下

WX20190915-210753@2x

Compilation error - too few arguments to function lxw_worksheet_prepare_chart

Hello, when compiling with the latest libxlswriter the following compilation error happens:

/packages/php-xlswriter/src/xlswriter-1.2.2/kernel/write.c: In function '_prepare_drawings':
/packages/php-xlswriter/src/xlswriter-1.2.2/kernel/write.c:370:13: error: too few arguments to function 'lxw_worksheet_prepare_chart'
             lxw_worksheet_prepare_chart(worksheet, chart_ref_id, drawing_id,
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/xlsxwriter/workbook.h:48:0,
                 from /usr/include/xlsxwriter.h:16,
                 from /packages/php-xlswriter/src/xlswriter-1.2.2/kernel/include.h:23,
                 from /packages/php-xlswriter/src/xlswriter-1.2.2/kernel/write.c:13:
/usr/include/xlsxwriter/worksheet.h:3247:6: note: declared here
  • PHP versions: 7.0.32, 7.1.24, 7.2.12, 7.3.0RC6
  • OS: Alpine Linux
  • php-ext-excel-export version: 1.2.2
  • libxlsxwriter: 0.8.4

Thank you.

读取excel失败

$config = ['path' => '/tmp']; $excel = new \Vtiful\Kernel\Excel($config); $data = $excel->openFile('tutorial01.xlsx')->openSheet()->getSheetData(); var_dump($data);
提示..
[root@xiaoming php-ext-excel-export]# php /data/wwwroot/xiaoming/yii a-test/he
php: symbol lookup error: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/xlswriter.so: undefined symbol: file_open

$config是什么路径?

我pecl安装了extension以后,并不能导出,想请教一下这个$config是个什么路径

mkdir: /library/libexpat: No such file or directory

OS : MacOS 10.14
PHP: 7.0.30

根据步骤,依次执行,最后报错。

git clone https://github.com/viest/php-ext-excel-export

cd php-ext-excel-export

git submodule update --init

phpize && ./configure --with-php-config=/usr/local/opt/[email protected]/bin/php-config --enable-reader

mkdir: /library/libexpat: Permission denied
mkdir: /library/libexpat: No such file or directory
mkdir: /library/libexpat/expat: No such file or directory
mkdir: /library/libxlsxio: Permission denied
mkdir: /library/libxlsxio: No such file or directory
configure: creating ./config.status
config.status: creating config.h

实际上是有这个文件夹与文件:

drwxr-xr-x   5 username  wheel     160  8 27 19:56 library
drwxr-xr-x   5 username  wheel   160  8 27 19:56 .
drwxr-xr-x  49 username  wheel  1568  8 27 20:14 ..
drwxr-xr-x  11 username  wheel   352  8 27 19:57 libexpat
drwxr-xr-x  16 username  wheel   512  8 27 19:57 libxlsxio
drwxr-xr-x  25 username  wheel   800  8 27 19:57 libxlsxwriter

centos安装扩展失败

编译最后一步

sudo make && make install

In file included from /usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:186:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:35: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:48: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:65: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:94: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c: In function ‘zipOpenNewFileInZip4_64’:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1245: error: ‘curfile64_info’ has no member named ‘crypt_header_size’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1251: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1254: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1255: error: ‘curfile64_info’ has no member named ‘crypt_header_size’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c: In function ‘zip64FlushWriteBuffer’:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1375: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1375: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c: In function ‘zipCloseFileInZipRaw64’:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1610: error: ‘curfile64_info’ has no member named ‘crypt_header_size’
make: *** [library/third_party/minizip/zip.lo] Error 1

环境
PHP 7.2.13 (cli) (built: Dec 8 2018 12:27:01) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.7, Copyright (c) 1999-2018, by Zend Technologies

rinting-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.7 (Final)
Release: 6.7
Codename: Final

设置行单元格格式范围参数失效

PHP版本:7.0
插件版本:7月9日通过git安装的最新版本(不知道如何查看具体版本)
系统版本:MacOS 10.14.4
问题:setRow无法指定范围
示例代码:

$config = ['path' => '/tmp'];
$fileObject = new \Vtiful\Kernel\Excel($config);
$fileObject = $fileObject->fileName('tutorial.xlsx');
$fileHandle = $fileObject->getHandle();
$format     = new \Vtiful\Kernel\Format($fileHandle);
$colorStyle = $format->background(0, 0xFF0000)->toResource();
$filePath   = $fileObject->header(['name', 'age', 'score', 'level'])
            ->data([
                ['viest1', 21, 100, "A"],
                ['viest2', 20, 80, "B"],
                ['viest3', 22, 70, "C"],
            ])
            ->setRow('A1:B1', 35, $colorStyle)
            ->output();

期望结果:单元格A1,B1设置背景色,其他单元格无背景色。
实际结果:A1:Z1均设置了单元格背景色。
请问是使用方法错误导致结果不符合预期吗?

How to apply format for range only?

I have a problem when using format on columns.
Is there any way to apply format only to a specific range, not the whole column?

           $formatResource = $format->bold()->align(Format::FORMAT_ALIGN_CENTER, 
           Format::FORMAT_ALIGN_VERTICAL_CENTER)->toResource();
           $fileObject->setColumn('A1:F5', 30, $formatResource);

worksheet选中支持

增加多个worksheet,默认是第一个选中
能否支持设置,能让任意一个worksheet选中?

缺少图片宽高的设置

什么时候能完善下跟phpExcel类似的样式细节
另外能否不保存在本地,直接文件流输出?最好就跟 flush() 配合下,php://output 一边插入一边输出。才是高性能高并发的目标吧?不然几个人生成几百m的东西,在当时来说,本地磁盘可就受考验了。

读取 excel 文件

现在遇到的问题,需要上传 excel 文件,读取相关内容,
请问读取文件功能目前是不是已经存在,但没有文档;
还是说还没有开发;
那之后会不会开发,是不是在日程内

format number

$formatResource = $format->bold()
->italic()
->color(Format::COLOR_ORANGE)
->number('#,##0')
->toResource();

number方法里面 #,##0是什么意思

I am trying this extension and get error excel.php

I am using php 71 in Windows and using php_xlswriter.dll from php_xlswriter-1.0.1-7.1-ts-vc14-x86.zip

I got this error when running excel.php:
object(Vtiful\Kernel\Excel)#1 (2) { ["config":"Vtiful\Kernel\Excel":private]=> array(1) { ["path"]=> string(8) "./tests/" } ["fileName":"Vtiful\Kernel\Excel":private]=> string(23) "./tests/tutorial01.xlsx" } object(Vtiful\Kernel\Excel)#1 (2) { ["config":"Vtiful\Kernel\Excel":private]=> array(1) { ["path"]=> string(8) "./tests/" } ["fileName":"Vtiful\Kernel\Excel":private]=> string(23) "./tests/tutorial01.xlsx" } object(Vtiful\Kernel\Excel)#1 (2) { ["config":"Vtiful\Kernel\Excel":private]=> array(1) { ["path"]=> string(8) "./tests/" } ["fileName":"Vtiful\Kernel\Excel":private]=> string(23) "./tests/tutorial01.xlsx" } string(23) "./tests/tutorial01.xlsx"

What did I do wrong?

call addSheet() error

Windows10 php7.2 Fatal error: Call to undefined method Vtiful\Kernel\Excel::addSheet()

请问设置行格式只能一行一行设置吗?

请问设置行格式只能一行一行设置吗?用一个范围好像没有作用,比如 setRow('A1:A12',100)
另外,无法设置文字对齐方式吗?总感觉功能很少,文档写的很模糊

更多的单元格样式

你好,
我想问下,如何给单元格添加诸如:字体大小、是否换行、颜色、对齐方式等样式,
文档中没有描述,我也没找到相关的东西。
如果你这里有更清晰的文档,我很乐意详细整理一份,

单元格宽高的单位是什么

你好,
通过设置单元格格式,发现宽高设置同样的数字,但是视觉上他们彼此长度有很大差距。
所以想了解下,宽高的单位是否是像素,还是其他什么?
我的代码是:
$point = 2;
for ($index = 0; $index < 10; $index++) {
$file->insertText($index+1, 0, 'viest');
$file->insertText($index+1, 1, 10000, '#,##0');
$file->insertImage($index+1, 2, public_path('imgs').'/luffy.jpg');
$file->setColumn('C:C', 30, $boldStyle);
$file->setRow('C'.$point, 120, $boldStyle);
$point ++;
}
这是结果:
Snipaste_2019-03-12_15-23-17

centos install xlswriter error

centos
php 7.2

First

run:
/home/etcp/pear/bin/pear install xlswriter

show

No releases available for package "pear.php.net/xlswriter" - package pecl/xlswriter can be installed with "pecl install xlswriter"
install failed

second

run:sudo yum install php-pecl-xlswriter

show


Total 968 kB/s | 147 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libxlsxwriter-0.8.7-1.el6.remi.x86_64 1/2
Installing : php-pecl-xlswriter-1.2.5-1.el6.remi.7.2.x86_64 2/2
Verifying : php-pecl-xlswriter-1.2.5-1.el6.remi.7.2.x86_64 1/2
Verifying : libxlsxwriter-0.8.7-1.el6.remi.x86_64 2/2

Installed:
php-pecl-xlswriter.x86_64 0:1.2.5-1.el6.remi.7.2

Dependency Installed:
libxlsxwriter.x86_64 0:0.8.7-1.el6.remi

Third

run php -m |grep xlswriter

show
xlswriter

Now I want to know

1 first step why

No releases available for package "pear.php.net/xlswriter" - package pecl/xlswriter can be installed with "pecl install xlswriter"
install failed

2
How do I display the current version of xlswriter

数组类型建议

@viest
你好,目前导出数据的数组,只支持“没有键名的索引数组”,这样的话,需要多做一步处理,如果能支持带键名的数组就好了

centos6 php7.0 安装错误

系统 centos 6
php 7.0.15

  1. pecl安装 pecl install xlswriter
    image
  2. 编译安装 ./configure --with-php-config=/usr/bin/php-config make && make install
    image

设置样式报错

插件版本 version 1.2.4

代码如下

$fileHandle = $this->handle->getHandle();
        $alignStyle = \Vtiful\Kernel\Format::align(
            $fileHandle,
            \Vtiful\Kernel\Format::FORMAT_ALIGN_CENTER,
            \Vtiful\Kernel\Format::FORMAT_ALIGN_VERTICAL_CENTER
        );
        foreach ($styles as $key => $width) {
            $this->handle->setColumn($key, (int) $width, $alignStyle);
            $this->handle->setColumn($key, (int) $width, $alignStyle);
        }

        $format    = new \Vtiful\Kernel\Format($fileHandle);
        $boldStyle = $format->bold()->toResource();
        $colorStyle = $format->color(\Vtiful\Kernel\Format::COLOR_ORANGE)->toResource();

分别报错

  $format    = new \Vtiful\Kernel\Format($fileHandle);
 "Vtiful\\Kernel\\Format::bold() expects exactly 1 parameter, 0 given"

$colorStyle = $format->color(\Vtiful\Kernel\Format::COLOR_ORANGE)->toResource();
Call to undefined method Vtiful\\Kernel\\Format::color()

make: Nothing to be done for 'install'

你好,
我在执行 make && make install 出现了 make: *** No targets specified and no makefile found. Stop
然后我发现有 Makefile.global 文件,于是将它的名字改成了 makefile ……,再次运行 make . 后出现了
Build complete. Don't forget to run 'make test'. make: Nothing to be done for 'install',我搜索了相关的东西,但是没能解决这个这问题。
于是暂且认为这只是一个提醒,继续接下来的步骤,然后提示 Class 'Vtiful\Kernel\Excel' not found
我是想在 laravel 5.7 中使用它的,想必应该是扩展没有安装成功。
希望你可以抽时间回复下我的问题!

Cells format features

How can I format a specific cell?

Ex: Number format, percent format, color, font style only for a specific cell, ...

Thank you for the great excel lib.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.