Closed sirhvd closed 5 years ago
examples:
use Vtiful\Kernel\Excel;
use Vtiful\Kernel\Format;
$excel = new \Vtiful\Kernel\Excel([
'path' => './'
]);
$excelObject = $excel->fileName('tutorial.xlsx');
$excelHandle = $excelObject->getHandle();
// new format object
$format = new Format($excelHandle);
// set format
$formatResource = $format->bold()
->italic()
->color(Format::COLOR_ORANGE)
->number('#,##0')
->toResource();
// insert data
$filePath = $excelObject->header(['name', 'balance'])
->data([
['viest', 1000],
['wjx', 100000]
])
->setColumn('B:B', 50, $formatResource) // set format
->output();
I hope this example will help you.
Thank you. This will help me a lot. But can I ask you for the newest php_xlswriter.dll file? I'm tried to follow your compile instruction from https://github.com/viest/php-ext-excel-export/blob/master/README_zh.md but it's can't compile. It's told me "xlswriter not enabled, xlsxwriter.lib or headers not found" Thank you.
Your platform is Windows or Linux?
I'm using Windows PHP 7.1.
Please download 1.2.4
at PECL
.
PECL is building, just a moment, please.
Really thank for your time. Can I ask you how to compile this on windows? So I can build myself, I don't want to waste your time for this. Thank you.
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.