用LotusScript編寫匯出Excel參考例項

2021-05-21 13:51:07 字數 3734 閱讀 2948

|+datestr+|用車情況"

htmlstr = htmlstr & ""

htmlstr = htmlstr+ ""

htmlstr = htmlstr+ ""+datestr$+"用車情況"+""

htmlstr = htmlstr+ ""

htmlstr = htmlstr & ""

htmlstr = htmlstr & "司機"

htmlstr = htmlstr & "時間"

htmlstr = htmlstr & "部門"

htmlstr = htmlstr & "目的地"

htmlstr = htmlstr & "車號"

htmlstr = htmlstr & "出發時間"   

htmlstr = htmlstr & "預計回站時間"

htmlstr = htmlstr & "事由"    

htmlstr = htmlstr & ""

for i=1 to dcs.count

set doc = dcs.getnthdocument(i)

if not doc is nothing then   

if car=doc.car(0) or car="*" then

tnum=tnum+1

htmlstr = htmlstr+ ""

htmlstr = htmlstr+ ""+doc.fd_driver(0)+""

htmlstr = htmlstr+ ""+doc.seldate(0)+":"+doc.selminute(0)+""

htmlstr = htmlstr+ ""+doc.fd_dept(0)+""

htmlstr = htmlstr+ ""+doc.dest(0)+""

htmlstr = htmlstr+ ""+doc.car(0)+""

htmlstr = htmlstr+ ""+doc.startdate(0)+""

htmlstr = htmlstr+ ""+doc.enddate(0)+""    

set ritem =doc.getfirstitem("body")

if not ritem is nothing then

htmlstr = htmlstr+ ""+ritem.text+""

else

htmlstr = htmlstr+ ""

end if

htmlstr = htmlstr+ ""

end if

end if

next

htmlstr = htmlstr+ ""

end if

next

else   

while not (cstr(format$(stdate.localtime,"yyyy-mm-dd"))>cstr(format$(eddate.localtime,"yyyy-mm-dd")))

set dcs=view.getalldocumentsbykey(cstr(format$(stdate.localtime,"yyyy-mm-dd")),true)

if dcs.count>0 then

mstr$=cstr(format$(stdate.localtime,"mm"))

dstr$=cstr(format$(stdate.localtime,"dd"))

'datestr$=cstr(cint(mstr$))+"月"+cstr(cint(dstr$))+"日"

datestr=cstr(format$(stdate.localtime,"yyyy年mm月dd日"))

'htmlstr = htmlstr+ ""+datestr$+"用車情況"

htmlstr = htmlstr+ ""

htmlstr = htmlstr+ ""

htmlstr = htmlstr+ ""+datestr$+"用車情況"+""

htmlstr = htmlstr+ ""

htmlstr = htmlstr+ ""

htmlstr = htmlstr+ "司機"

htmlstr = htmlstr+ "時間"

htmlstr = htmlstr+ "部門"

htmlstr = htmlstr+ "目的地"

htmlstr = htmlstr+ "車號"

htmlstr = htmlstr+ "出發時間"   

htmlstr = htmlstr+ "預計回站時間"

htmlstr = htmlstr+ "事由"        

htmlstr = htmlstr+ ""

for i=1 to dcs.count

set doc = dcs.getnthdocument(i)

if not doc is nothing then   

if car=doc.car(0) or car="*" then

tnum=tnum+1

htmlstr = htmlstr+ ""

htmlstr = htmlstr+ ""+doc.fd_driver(0)+""

htmlstr = htmlstr+ ""+doc.seldate(0)+":"+doc.selminute(0)+""

htmlstr = htmlstr+ ""+doc.fd_dept(0)+""

htmlstr = htmlstr+ ""+doc.dest(0)+""

htmlstr = htmlstr+ ""+doc.car(0)+""

htmlstr = htmlstr+ ""+doc.startdate(0)+""

htmlstr = htmlstr+ ""+doc.enddate(0)+""   

set ritem =doc.getfirstitem("body")

if not ritem is nothing then

htmlstr = htmlstr+ ""+ritem.text+""

else

htmlstr = htmlstr+ ""

end if

htmlstr = htmlstr+ ""

end if

end if

next

htmlstr = htmlstr+ ""

end if

call stdate.adjustday(1)

wend

end if

'print "

" if tnum=0 then

htmlstr = htmlstr+ "

未找到用車記錄

" end if

print htmlstr

errmsg:

if cstr(erl) = "0" then

msgbox "**程式成功執行完畢!"

else

msgbox "**程式出錯..出錯行數為:" & cstr(erl) & "行!錯誤原因為:" & error

end if

end sub

用impdp導dmp檔案

1.建立directory create or replace directory export directory as usr local oracle oracle product 11.2.0 dbhome1 rdbms log directory是乙個路徑,用來存放dmp檔案以及生成的lo...

oracle用expdp impdp匯出匯入

使用expdp和impdp時應該注意的事項 exp和imp是客戶端工具程式,它們既可以在客戶端使用,也可以在服務端使用。expdp和impdp是服務端的工具程式,他們只能在oracle服務端使用,不能在客戶端使用。imp只適用於exp匯出的檔案,不適用於expdp匯出檔案 impdp只適用於expd...

用QueryTable向excel批量匯入資料

前面寫過兩篇excel操作的文章,有朋友質疑大批量資料下的效能問題,這個時候最好用批量複製的方法,可以用excel的querytable來直接查詢資料庫,但是必須引用com元件。參考 using system using system.collections.generic using system...