我想在WEB页面打开EXECL表格,有好的办法吗?
现在有个需求,要求用户通过WEB页面浏览execl表格的内容。不需要编辑和保存,只需要浏览到内容,效果就和打开execl一样?有好的实现办法么?
期待回帖
把excel的内容读出来在写进表格 只是浏览的话
楼上+1 office插件,建议考虑使用百度文库那种的swf控件。
可以搜索Flash Paper (建议xp下运行) 谢谢大家,我怎么没想到flash呢?我今天在研究看看。
至于读取后再显示昨天测试了1天,可以使可以,但存在问题,因为execl表格的格式不是标准表格。
有表头合并,内容中间有合并,读取数据后再生成表格时候很是费劲,放弃了,不过我找到了
PHPExcel 集成到CI里面的东西,分享一下。
在
class Test_excel extends CI_Controller
{
/*
*
* 读取excel
*
*/
function test_reader()
{
$config = array('fileName'=>'uploads/example1.xls');
$this->load->library('ExcelIO',$config);
$values = $this->excelio->setReader();
$values = $this->excelio->getSheetValues();
print_r($values);
}
/*
*
* 导出excel
*
*/
function test_writer()
{
$config = array('fileName'=>'example1.xlsx');
$tableHeader = array('id','name','sex','age','other');
$data = array(
array('id'=>1,'name'=>'aaron','sex'=>'男啊数据库的数据库的','age'=>'21','other'=>'sdhksjdksjkd'),
array('id'=>2,'name'=>'lili','sex'=>'nv','age'=>'25','other'=>'tashishui'),
array('id'=>3,'name'=>'tiantian','sex'=>'nv','age'=>'23','other'=>'tiantian'),
array('id'=>4,'name'=>'this','sex'=>'男','age'=>'21','other'=>'thisi thisi')
);
//加载ExcelIO库
$this->load->library('ExcelIO',$config);
//初始化excel Writer
$this->excelio->initWriter();
//调用outPutExcel进行excel输出,可以控制生成文件还是直接输出到客户端
$this->excelio->outPutExcel($data,true,$tableHeader);
}
function index()
{
echo 'ceshi EXcelIO.';
}
文件怎么这么大。。。
页:
[1]