我有一个 HTML 表单,当您通过单击按钮提交表单时,应用程序会使用 PHPExcel 生成一个 Excel 文件。一切正常,但是当 Excel 文件很大时,等待时间会很长。我想添加进度条或显示完成值的百分比。我的问题是我不知道如何将其插入表单并不断更新。
This is what I am looking to accomplish:
EDIT:
我的代码是:
HTML 形式:
<form action="reporteexcel.php" name = "ExportForm" method="POST">
<table>
[All different fields]
<tr>
<td style = "position:relative; top:1em;left:4em;">
<input type="submit" value="Export to excel">
<input type="button" onclick="window.close();" value = "Cancel">
</td>
</tr>
</table>
</form>
在reporteexcel.php中:
include 'PHPExcel_1.8.0/Classes/PHPExcel.php';
include 'F1_Export.php';
include 'F2_Export.php';
if ($Family == "F1")
{
exportF2 ($BasicInformation, $SupplierInformation, $PhysicalParameters, $Supplier, $Family);
}
else if ($Family == "F2")
{
exportF2 ($BasicInformation, $SupplierInformation, $PhysicalParameters, $Supplier, $Family);
}
F1_export和F2_export中是生成excel文件的函数。
使用此库上传您的文件,您还可以显示上传进度条:http://blueimp.github.io/jQuery-File-Upload/ http://blueimp.github.io/jQuery-File-Upload/
要显示长时间运行的 PHP 脚本的进度:http://www.htmlgoodies.com/beyond/php/show-progress-report-for-long-running-php-scripts.html http://www.htmlgoodies.com/beyond/php/show-progress-report-for-long-running-php-scripts.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)