Git Product home page Git Product logo

Comments (13)

viest avatar viest commented on May 11, 2024

@needrunning 请问你使用的版本是?

from php-ext-xlswriter.

needrunning avatar needrunning commented on May 11, 2024

@needrunning 请问你使用的版本是?

扩展是按照文档安装最新的 如何查看版本?

from php-ext-xlswriter.

viest avatar viest commented on May 11, 2024

@needrunning

通过 git 拉取安装,还是通过 PECL ?

from php-ext-xlswriter.

needrunning avatar needrunning commented on May 11, 2024

from php-ext-xlswriter.

viest avatar viest commented on May 11, 2024

color 在 master 分支已经修改为 fontColor

from php-ext-xlswriter.

viest avatar viest commented on May 11, 2024

文档正在修改,并于今晚发布 1.2.5

from php-ext-xlswriter.

needrunning avatar needrunning commented on May 11, 2024

color 在 master 分支已经修改为 fontColor

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

这样修改后提示

Call to undefined method Vtiful\Kernel\Format::fontColor()

需要重新更新扩展吧?

from php-ext-xlswriter.

viest avatar viest commented on May 11, 2024

@needrunning 正在发布 1.2.5

from php-ext-xlswriter.

viest avatar viest commented on May 11, 2024

@needrunning

https://pecl.php.net/package/xlswriter

1.2.5 已发布,请使用 pecl install xlswriter 进行安装

from php-ext-xlswriter.

needrunning avatar needrunning commented on May 11, 2024

on my MAC PHP7

Build process completed successfully
Installing '/usr/local/Cellar/[email protected]/7.2.18/pecl/20170718/xlswriter.so'
install ok: channel://pecl.php.net/xlswriter-1.2.5
Extension xlswriter enabled in php.ini

code

public function style(array $styles)
{
$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);
}

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

}

ERROR

Non-static method Vtiful\Kernel\Format::align()

from php-ext-xlswriter.

viest avatar viest commented on May 11, 2024

align is not a static method, please new a format object.

$format     = new \Vtiful\Kernel\Format($fileHandle);
$alignStyle = $format
    ->align(Format::FORMAT_ALIGN_CENTER, Format::FORMAT_ALIGN_VERTICAL_CENTER)
    ->toResource();

from php-ext-xlswriter.

needrunning avatar needrunning commented on May 11, 2024

align is not a static method, please new a format object.

$format     = new \Vtiful\Kernel\Format($fileHandle);
$alignStyle = $format
    ->align(Format::FORMAT_ALIGN_CENTER, Format::FORMAT_ALIGN_VERTICAL_CENTER)
    ->toResource();

OK that is OK

but another error
code

$this->handle->header($header)->data($data);
        $fileHandle = $this->handle->getHandle();
        $format = new \Vtiful\Kernel\Format($fileHandle);
        $colorStyle = $format->fontColor(0xFF0000)->toResource();
        $boldStyle = $format->bold()->toResource();

error
Call to undefined method Vtiful\Kernel\Format::fontColor()

I found that it is incorrect about color setting

from php-ext-xlswriter.

viest avatar viest commented on May 11, 2024

@needrunning

php --ri xlswriter

# You can get this output
xlswriter

xlswriter support => enabled
Version => 1.2.5
bundled libxlsxwriter version => 0.7.9

Please attach your output.

from php-ext-xlswriter.

Related Issues (20)

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.