<?php
//header("Content-type: application/vnd.ms-excel");
//header("Content-Disposition: attachment;Filename=document_name.xls");
header('Content-type:text/html;charset=utf-8');
require_once 'excel_class.php';
//定义一个excel文件
$workbook = dirname(__FILE__)."\stock_2.xls";
Read_Excel_File($workbook,$return);
// $result[sheet名][行][列] 的值为相应Excel Cell的值
$data =array();
$trans = array("/" => "");
//echo "仓库库存报表\t\n";
//echo "pnumber\tcounts\t\n";
$data[0][0]="仓库库存报表";
$data[0][1]="";
$data[1][0]="pnumber";
$data[1][1]="counts";
$s=2;
for ($i=0;$i<count($return['Sheet1']);$i++)
{
for ($j=0;$j<count($return['Sheet1'][$i]);$j++)
{
if($j==2 && $i>3){$str= trim($return['Sheet1'][$i][$j])."-";}
if($j==5 && $i>3){$str.= strtr(trim($return['Sheet1'][$i][$j]),$trans)."-";}
if(strpos($str,"M") || strpos($str,"男")){
$n=38;
}else{
$n=34;
}
for($m=0;$m<10;$m++){
if(($j==20+$m) && $i>3){
if(trim($return[Sheet1][$i][$j]!="")){
//echo $str.($n+$m)."\t".trim($return[Sheet1][$i][$j])."\t\n";
$data[$s][0]=$str.($n+$m);
$data[$s][1]=trim($return['Sheet1'][$i][$j]);
$s++;
}
}
}
}
}
Create_Excel_File(dirname(__FILE__)."\ddd.xls",$data);
?>
详细解决方案
php运用excel_class.php操作Excel文件
热度:276 发布时间:2012-11-05 09:35:12.0
相关解决方案
- !使用JDNI时,报 Cannot create JDBC driver of class '' for connect URL 'null'
- 新手Dialect class not found
- word excel pdf在ie浏览器中打开,该如何解决
- 在浏览器中展示word,excel.ppt,pdf等各种文件
- POI 处置 Excel,读取Excel中的格式 如表格框,背景色
- jxls 怎么导出图片到 excel 中
- Could not load JDBC driver class 咋回事
- poi excel 如何合并单元格?
- Cannot load JDBC driver class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'解决方法
- 初学急求(待高手指导)java.lang.InstantiationException: Class not a MIDlet?已经写了MIDlet类,如何修改
- 用eclipse打包jar后运行,弹出异常could not find main class
- eclipse class not found 愁死了解决方法
- class.formName获取的种能做List的泛型类么
- There is no WRITEABLE property named 'outboxsize' in class 咋回事
- 用Java EXCEL API 是否能从Excel中导出表格,该如何处理
- java excel 問題 求大神 速解解决方案
- 报错“需要.class”!新手、求高手给解!该如何解决
- Sub Class 与 Child Class的差异
- java 处理 excel 相关有关问题
- Netbeans 7.0 生成的jar运作总是找不到main class
- 请问,这样定义一个变量,是啥意思?Class<> waiClass
- 关于xxxxx.class.getClassLoader().getResource(fileName),
- vs 2005 对一个新键Dialog的没法使用Add Class,不知道说明原因
- 小弟我用水晶报表9新建一个报表,采用PULL模式,在创建新的连接中选用access/Excel(DAO),选择数据库之后,总是弹出对话框说登录失败
- [Crystal Reports]在ASP.net web中导出 有关问题[Excel、Word、PDF]
- Excel 图表解决方法
- 使用FlashPrinter将word,excel,pdf转换成swf失败的有关问题
- DataSet 读写 Excel.该怎么处理
- excel 导入数据到sql。就出有关问题了
- 怎的把Microsoft.Office.Interop.Excel.ApplicationClass excel创建的文件保存到数据流中