gpt4 book ai didi

php - 在php中生成Excel文件时显示进度条

转载 作者:太空狗 更新时间:2023-10-29 16:35:46 26 4
gpt4 key购买 nike

我有一个 HTML 表单,当您通过单击按钮提交表单时,应用程序会使用 PHPExcel 生成一个 Excel 文件。一切正常,但是当 excel 文件很大时,等待时间很长。我想添加进度条或显示完成百分比值。我的问题是我不知道如何将其插入表单并不断更新。

这就是我想要完成的: enter image description here

编辑:

我的代码是:

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/

显示长时间运行的 PHP 脚本的进度:http://www.htmlgoodies.com/beyond/php/show-progress-report-for-long-running-php-scripts.html

关于php - 在php中生成Excel文件时显示进度条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30866314/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com