function printReport()
{
alert("此列印僅提供列印當頁資料,如需列印全部資料,請點選[產生Excel檔]另存為Excel檔再進行列印");
disableButton();
pageSetup_null();
window.print();
enableButton();
}
function disableButton()
{
try{
Form1.all.TableButtonList.style.display='none';
}catch(e){ }
}
function enableButton()
{
try{
Form1.all.TableButtonList.style.display='';
}catch(e){ }
}
</script>
<script language="VBScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
'//設置網頁打印的頁眉頁腳為空
function pageSetup_null()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
hkey_key="\footer"
'RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&b第 &p 頁,共 &P 頁"
end function
'//設置網頁打印的頁眉頁腳為默認值
function pageSetup_default()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&b第 &p 頁,共 &P 頁"
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d"
end function
</script>