问题描述
我认为这与Excel文件.xlsx的生成方式有关,但很遗憾,由于通过第三方API,因此我们无法对其进行控制.每次我尝试使用...操作文件时
I believe this to be an error with how the Excel File .xlsx is being generated which we unfortunately have no control over since it's through a 3rd party API. Every Time I try and ope the file using...
try {
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($inputFileName);
} catch(Exception $e) {
die('Error loading file "'.pathinfo($inputFileName,PATHINFO_BASENAME).'": '.$e->getMessage());
}
我得到一个错误提示"filename.xlst":PHPExcel错误:缩放比例必须大于或等于1.我猜想,当他们生成Excel文件时,它们正在设置缩放的非法值.规模.我可以通过将其转换为csv然后再返回到xlsx来使该文件正常工作,我假设该文件将文档上的缩放比例设置为默认值.
I get an error spit out that says 'filename.xlst': PHPExcel Error: Scale must be greater than or equal to 1. I am guessing that when they are generating the Excel file they are setting an illegal value for the zoom scale. I can get this same file to work by converting it to a csv and then back to a xlsx which I assume sets the zoom scale on the document back to the default.
问题是这给最终用户带来了痛苦,当我在文件中加载文件时,我似乎找不到文档中的方法来覆盖zoomscale设置.
The issue is this is a pain for end users and I can't seem to find a way in the documentation to override the zoomscale setting when I am loading in the file.
非常感谢您的帮助.
推荐答案
就像我们曾经以为我们有一些非法字符一样.与我一起工作的同事所做的就是找到一个XLSX到CSV转换器,并重新编写了一部分并将其添加为作曲家程序包.如果还有其他人遇到此问题,则可以在此处找到回购协议.我会尽快添加一些文档.
So like we had thought we had some illegal characters. What my coworker who was working on this with me did was find a XLSX to CSV converter and rewrote a little bit and add it in as a composer package. If anyone else runs into this issue the repo is here. I'll try and add some docs soon.
https://github.com/StudentAffairsUWM/xlsxtocsv
这篇关于PHPExcel错误:小数位数必须大于或等于1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!