今天看Phreeze源码,看到了/Phreeze/ExportUtility.php这是一个生成Excel表的类,我们PHP以前处理我们会用PHPExcel插件,这个类感觉还不错,我就实验了实验,发现在跟踪源文件的时候后,/usr/share/php里面没有OLE.php这个文件,(PHP本身就没有)然后我下载了PHPExecl去找他里面的OLE.php这个文件,并且把这个文件复制到了/usr/share/php里面,运用,可是发现出现了几个错误,

1,生成的文件名称并未按照我的重命名命名,

2,文件里打开内容值是我需要的,可是出现了错误,

代码:

public function GXls(){

        require_once 'verysimple/Phreeze/ExportUtility.php';
        
        $gc=GlobalConfig::GetInstance();
        $this->Phreezer=$gc->GetPhreezer();
        $where='id<15';
        $criteria=new Criteria($where);
        try{
            $ds=$this->Phreezer->Query('PTest',$criteria);
            $ds=$ds->ToObjectArray(true);
            print_r($ds);
            $xlobj=ExportUtility::OutputAsExcel($ds,$this->Phreezer,'Data Export','/home/beyourself/Downloads/ptest.xls');
            /*$code=ExportUtility::GetColumnLetter(12);
            echo $code;
        */
        }catch(Exception $ex){
            echo $ex->getMessage();
        }
        
    }

 错误:

初学Phreeze 5 --excel 表格,自动生成文件

@/===============================================================

2.Phreeze框架的一个好处是它可以自动的为我们生成我们需要的东西,在Phreeze/Builder文件夹里面,但是需要注意的是我用的ubuntu 12.04,我需要自己手动修改nginx配置文件的重写格式:

出现这种界面:

初学Phreeze 5 --excel 表格,自动生成文件

初学Phreeze 5 --excel 表格,自动生成文件

相关文章:

  • 2022-12-23
  • 2022-01-11
  • 2021-11-23
  • 2022-01-05
  • 2021-12-05
  • 2021-12-15
猜你喜欢
  • 2021-12-04
  • 2021-10-30
  • 2021-11-27
  • 2021-07-17
  • 2022-02-20
  • 2021-08-17
  • 2021-12-15
相关资源
相似解决方案