刷新页面时我的文件已下载,但我不想这样做。应使用largest_so_far = smallest_so_far = None
while True:
value = raw_input(">")
# first deal with 'done'
if value.lower() == 'done':
break
# then convert to float
try:
value = float(value)
except ValueError:
continue # or break, if you don't want to give them another try
# finally, do comparisons
if largest_so_far is None or value > largest_so_far:
largest_so_far = value
if smallest_so_far is None or value < smallest_so_far:
smallest_so_far = value
事件下载excel文件,而不是在刷新时下载。
我正在使用此代码,请检查
onclick
现在从数据库表中获取数据,每次循环运行都会创建一个新行
请检查并向我提供解决方案
require_once("excelwriter.inc.php");
if(isset($_POST['act1']) && $_POST['act1']=="submit")
{
//$t=time();
$excel=new ExcelWriter('ADCL'.time().'.xls');
if($excel==false)
echo $excel->error;
// this will create heading of each column in excel file
$myArr=array("File No.","Company Name","Entity Status","City","Landline");
$excel->writeLine($myArr);
java脚本函数
$qry=mysql_query("select * from alig_clients");
if($qry!=false)
{
$i=1;
while($res=mysql_fetch_array($qry))
{
$myArr=array($i,$res['clfileno'],$res['clcname'],$res['clemail']);
$excel->writeLine($myArr);
$i++;
}
}
包含在顶部的附带文件代码如下: -
<script language="javascript">
function Download()
{
window.open('ADCL+time()+xls');
}
</script>