跨平台生成windows Excel二进制报表方法(包括中文支持)

#!/usr/bin/perl
use Unicode::Map;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new("test.xls");
my $worksheet1 = $workbook->add_worksheet();
my $map = Unicode::Map->new("gb2312");
$abc = $map->to_unicode("第二个");
$worksheet1->write(0,0,"Hi Excel!");
$worksheet1->write_unicode(0,1,$abc);
$worksheet1->write(0,2,"the 3");
$worksheet1->write_string(0,3,"the 4");
$worksheet1->write(1,0,"2-1");
$worksheet1->write(1,1,"2-2");

$workbook->close();
阅读更多
个人分类: Shell&Script
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭