Spreadsheet_Excel_Writer(Pear)有关问题

WBOY
Release: 2016-06-13 13:32:12
Original
950 people have browsed it

Spreadsheet_Excel_Writer(Pear)问题
谢谢。

我在使用Spreadsheet_Excel_Writer生成Excel时遇到奇怪的问题,
如果生成的excel保存在硬盘上没问题,但是不能够生成弹出框;
而且生成弹出框的源码,放在公司服务器上就没问题,
但是放在本机环境下就不可以,是不是我配置是有哪些疏忽了,
请各位大侠指点迷津,再次感谢。

代码例子如下:
#!/usr/local/bin/php.cli
require_once(dirname(__FILE__) . "/../../init.php");
require_once(APP_INC_PATH . "pear/Spreadsheet/Excel/Writer.php");  

$workbook = new Spreadsheet_Excel_Writer(); // 初始化类  

$workbook->send("TestReport.xls");

$workbook -> setVersion (8);

 
$worksheet =& $workbook->addWorksheet('Sheet1'); 
$worksheet->setInputEncoding('utf-8');

$current = Date_API::getCurrentDateGMT4();

$worksheet->setHeader("Test Report as at " . $current ."",0.5);

$worksheet->setColumn(0,6,20);
$formart=$workbook->addFormat(array('right' => 1, 'bottom' => 1, 'size' =>9,'Align'=>'Center','VAlign'=>'vcenter'
  ));
   
$formart->setTextWrap(); 
$format_title=$workbook->addFormat(array('right' => 1, 'bottom' => 1, 'size' =>9,'Align'=>'Center','VAlign'=>'vcenter'
  ));
   
   
$format_title->setTextWrap(); 
$format_title->setBold();



$worksheet->write(0, 0, "Supplier Name",$format_title);
$worksheet->write(0, 1, "Item Name", $format_title);
$worksheet->write(0, 2, "Parts Number", $format_title);
$worksheet->write(0, 3, "Price", $format_title);
$worksheet->write(0, 4, "Speed", $format_title);
$worksheet->write(0, 5, "Service Ranks", $format_title);
$worksheet->write(0, 6, "Remark", $format_title);



$workbook->close(); // 完成下载  


------解决方案--------------------
你本地和服务器上的环境有何不同呢?
------解决方案--------------------
如果生成的excel保存在硬盘上没问题,但是不能够生成弹出框?

此话何意?
------解决方案--------------------
你的问题现在应该已经解决了吧?
------解决方案--------------------
和Apache 2.0 Handler没有关系的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!