phpexcel导出超过26列解决方案
将列的数字序号转成字母使用,代码如下:
将列的字母转成数字序号使用,代码如下:
count($content);
$maxRow; $j++) {
$pCoordinate = chr(65+$i) . '' . ($j + 1);
$pValue
= $content[$j][$i];
$objPHPExcel->getActiveSheet()->setCellValue($pCoordinate,
$pValue);
String from columnindex
@param int $pColumnIndex
Column index (base 0 !!!)
@return string
0) {
Using a lookup cache adds a slight memory
overhead, but boosts speed
caching using a static within the method is
faster than a class static,
though it's
additional memory overhead
array();
(!isset($_indexCache[$pColumnIndex])) {
// Determine column string
if ($pColumnIndex < 26) {
$_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
} elseif ($pColumnIndex < 702) {
$_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26))
.
chr(65 + $pColumnIndex % 26);
} else {
$_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex – 26) /
676)) .
chr(65 + ((($pColumnIndex – 26) % 676) / 26))
.
chr(65 + $pColumnIndex % 26);
}
$_indexCache[$pColumnIndex];
count($content);
$maxRow; $j++) {
$pCoordinate =
PHPExcel_Cell::stringFromColumnIndex($i) . '' . ($j + 1);
$pValue
= $content[$j][$i];
$objPHPExcel->getActiveSheet()->setCellValue($pCoordinate,
$pValue);
http://www.01happy.com/phpexcel-column-more-than-26/
phpexcel导出超过26列解决方案的更多相关文章
- phpexcel 导入超过26列时的解决方案
$highestColumn = $sheet->getHighestColumn(); // 取得总列数 ++$highestColumn; for ($row = 5; $row <= ...
- phpexcel 导入超过26列、处理时间格式
见地址:http://www.thinkphp.cn/topic/33376.html excel处理时间: https://blog.csdn.net/xqd890608/article/detai ...
- PHPExcel导出数据时字段超过26列出错Invalid cell coordinate [1
http://blog.csdn.net/dl425134845/article/details/46650961 以下是解决方案函数 /** * 方法名: getExcel * 作用 ...
- yii2 数据导出 excel导出以及导出数据时列超过26列时解决办法
作者:白狼 出处:http://www.manks.top/article/yii2_excel_extension 本文版权归作者,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给 ...
- phpexcel 生成大于26列数据
function excelExport2($fileName = '', $headArr = [], $data = [], $widths=[]) { ob_clean(); // $fileN ...
- phpexcel如何读和写大于26列的excel
主要运用到PHPExcel_Cell类的两个方法 1读取excel大于26列时. PHPExcel_Cell::columnIndexFromString($highestColumm)://由列名转 ...
- phpexcel导出数据 出现Formula Error的解决方案
phpexcel导出数据报错 Uncaught exception 'Exception' with message 'Sheet1!A1364 -> Formula Error: Unexpe ...
- phpExcel导出excel加超级链接的实例代码[转]
phpexcel实现的导出excel文件的代码,且可以在excel文件中加入超级链接. 说明:PHPExcel的开发包Tests目录有详细使用实例.以下代码支持中文,注意文件编码,文件保存为utf-8 ...
- 利用PHPExcel导出excel 以及利用js导出excel
导出excel的方法output_excel需要依赖PHPExcel 导出csv的方法csv_export不需要 <?php /** * @author ttt */ class ExcelCo ...
随机推荐
- PatentTips – CoAP Segment size determination
BACKGROUND OF THE INVENTION The subject matter disclosed herein relates to routing data through a ne ...
- [NPM] Use a shorthand syntax for running multiple npm scripts with npm-run-all
Running multiple scripts in series or in parallel can become very verbose. Using a tool such as npm- ...
- HashTable 解决碰撞(冲突)的方法 —— 分离链接法(separate chaining)
1. ListNode 及 HashTable 的类型声明 声明 typedef int ElementType; typedef unsigned int Index; struct ListNod ...
- .net core 下监控Sql的执行语句
原文:.net core 下监控Sql的执行语句 最近在编写.net core程序,因为数据库从Sql Server 切换到 MySql的原因,无法直接查看sql的具体语句,随着业务量的剧增,痛苦也与 ...
- 【Qt程序】基于Qt词典开发系列<十二>呼叫讲述
我们知道,win7系统自带有讲述人,即能够机器读出当前内容,详细能够将电脑锁定.然后点击左下角的button就可以.之前在用Matlab写扫雷游戏的时候,也以前调用过讲述人来进行游戏的语音提示. 详细 ...
- fusionchart实现ZoomLine 资源 破解版 出口能力
最近的曲线需要用油画ZoomLine官方网站看了好几天,今天整理出来供大家参考使用 zoomline.html资源 <!DOCTYPE HTML PUBLIC "-//W3C//DTD ...
- TextView中实现跑马灯的最简单方法
几行代码实现跑马灯效果,效果如下: 因为很简单,所以就直接贴代码喽 <TextView android:id="@+id/item1_title_message" andro ...
- 【BZOJ 1027】[JSOI2007]合金
[题目链接]:http://www.lydsy.com/JudgeOnline/problem.php?id=1027 [题意] [题解] 因为和为1; 所以只要知道两个属性第三个属性就能用1减出来了 ...
- React Native中的DeviceEventEmitter.addListener与DeviceEventEmitter.emit
官方文档没有对这两个方法做很好的解释,需要自己找资料研究.看了几篇文章,总结是和订阅发布模式差不多,用来事件监听发送的. React Native学习之DeviceEventEmitter传值 R ...
- hdu - 4971 - A simple brute force problem.(最大权闭合图)
题意:n(n <= 20)个项目,m(m <= 50)个技术问题,做完一个项目能够有收益profit (<= 1000),做完一个项目必须解决对应的技术问题,解决一个技术问题须要付出 ...