Heim >Backend-Entwicklung >PHP-Tutorial > Spreadsheet_Excel_Writer(Pear)有关问题
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没有关系的