當前位置:編程學習大全網 - 網站源碼 - pb6.5技術,報表轉存excel文件

pb6.5技術,報表轉存excel文件

integer li_rtn,ii,li_asc

string ls_name,ls_pathname

boolean lb_exist

if datawin.RowCount()<1 then

MessageBox("提示信息","請先檢索出數據再導出至Excel!")

return -1 //error

end if

li_rtn=GetFileSaveName("保存文件",ls_pathname,ls_name,"xls","Excel文件(*.xls),*.xls")

if li_rtn=1 then

lb_exist = FileExists(ls_pathname) //看該文件是否存在

IF lb_exist THEN

li_rtn = MessageBox("保存", ls_pathname+"已經存在,是否覆蓋?",Exclamation!, YesNo!)

end if

if li_rtn=1 then

//當文件存在,用戶選擇覆蓋,或是文件本就不存在時. 註意變量li_rtn

li_rtn=datawin.SaveAsAscii(ls_pathname)

if li_rtn=1 then

MessageBox("提示信息","導出數據成功!")

else

MessageBox("錯誤信息","導出數據失敗!")

return -1//error

end if

else

return -1//error

end if

else

return -1

end if

  • 上一篇:怎麽用java編寫壹個程序,計算出百錢買百雞壹***有幾種方案?
  • 下一篇:帶大家手撕電腦奸商—第二篇CPU散片保修貼的秘密
  • copyright 2024編程學習大全網