VFP 愛用者社區 首頁 VFP 愛用者社區
本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
 
 常見問題常見問題   搜尋搜尋   會員列表會員列表   會員群組會員群組   會員註冊會員註冊 
 個人資料個人資料   登入檢查您的私人訊息登入檢查您的私人訊息   登入登入

報表預覽時,將其存成 HTM,格式完全跑掉???

 
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區
上一篇主題 :: 下一篇主題  
發表人 內容
214152



註冊時間: 2005-08-24
文章: 19
來自: 台南

第 1 樓

發表發表於: 星期四 九月 01, 2005 5:19 pm    文章主題: 報表預覽時,將其存成 HTM,格式完全跑掉??? 引言回覆

在作報表預覽時,將其存成 HTM,格式完全跑掉,
請問各位前輩有何解決之道?
TKS.

_________________
scott
回頂端
檢視會員個人資料 發送私人訊息 雅虎訊息通
garfield
Site Admin


註冊時間: 2003-01-30
文章: 2157


第 2 樓

發表發表於: 星期四 九月 01, 2005 9:09 pm    文章主題: 引言回覆

我是沒有試過直接轉html格式,
但我想如果你的報表做成"單純"一點的格式,
它應該會比較準一點.

_________________
利用>>搜尋<<的功能會比問的還要快得到答案.
回頂端
檢視會員個人資料 發送私人訊息 發送電子郵件
yoncen



註冊時間: 2005-08-29
文章: 33


第 3 樓

發表發表於: 星期五 九月 02, 2005 8:34 am    文章主題: 引言回覆

* *********************************************************************
* * 2004/04/08 ▲將報表數據輸出至.html格式文檔 ▲
* *********************************************************************
* * xx集團公司
* * 版權所有 (C) 2004 嚴禁拷貝
* * 東莞市長安鎮xx工業區 5332701
* * 程式作者:yoncen 盛軍軍
* *
* * 說明:
* 1.本程式將報表數據輸出至html格式文檔,方便Email傳送.
* 2.本系統採用Visual Foxpro 8.0開發,適合任何版本的系統.
* *********************************************************************
FUNCTION genHtml
LPARAMETERS cTable,cTitle,cCaption,cPrnFile
LOCAL htmlText,cChr
cFieldList=cCaption
htmlText=''
cChr = CHR(13) + CHR(10)
nCaption=ALINES(aCaption,cCaption,.T.,",")
nFieldList=ALINES(aFieldList,cFieldList,.T.,",")

htmlText = htmlText+'<html>'+cChr
htmlText = htmlText+'<head>'+cChr
htmlText = htmlText+'<!-- Create output file and show based on Save As HTML dialog selection-->'+cChr
htmlText = htmlText+'<!-- Author:Jacksheng-->'+cChr
htmlText = htmlText+'<meta http-equiv="Content-Type" content="text/html; charset=big5">'+cChr
htmlText = htmlText+'<meta name="GENERATOR" content="Microsoft FrontPage 4.0">'+cChr
htmlText = htmlText+'<meta name="ProgId" content="FrontPage.Editor.Document">'+cChr
htmlText = htmlText+'<title>'+cTitle+'</title>'+cChr
htmlText = htmlText+'</head>'+cChr
htmlText = htmlText+''+cChr+cChr
htmlText = htmlText+'<p style="margin-top: 0; margin-bottom: 0" align="center"><font size="3">'+cTitle+'</font></p>'+cChr+cChr
htmlText = htmlText+'<div align="center">'+cChr
htmlText = htmlText+' <center>'+cChr+cChr
htmlText = htmlText+'<table border="0" width="96%" bgcolor="#4445bb" cellspacing="1" cellpadding="2">'+cChr
htmlText = htmlText+' <tr>'+cChr
* 表格標題
FOR I=1 TO nCaption
htmlText = htmlText+' <td width="7%">'+cChr
htmlText = htmlText+' <p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF" size="2">'+aCaption[I]+'</font></p>'+cChr
htmlText = htmlText+' </td>'+cChr
ENDFOR
htmlText = htmlText+' </tr>'+cChr
htmlText = htmlText+' <tr>'+cChr
SELECT "&cTable"
GOTO TOP
* 表格明細數據
SCAN
FOR I=1 TO nFieldList
cField="&cTable"+"."+aFieldList[I]
cField=chkFieldType(&cField)
htmlText = htmlText+' <td width="7%" bgcolor="#FFFFFF">'+cChr
htmlText = htmlText+' <p style="margin-top: 0; margin-bottom: 0"><font size="2">'+cField+'</font></p>'+cChr
htmlText = htmlText+' </td>'+cChr
ENDFOR
htmlText = htmlText+' </tr>'+cChr
ENDSCAN
htmlText = htmlText+' <tr>'+cChr
htmlText = htmlText+' <td width="7%"bgcolor="#F9F9F9"><font size="2">合計</font></td>'++cChr
FOR I=1 TO nFieldList-1
htmlText = htmlText+' <td width="7%" bgcolor="#F9F9F9"> </td>'+cChr
ENDFOR
htmlText = htmlText+' </tr>'+cChr
htmlText = htmlText+'</table>'+cChr+cChr
htmlText = htmlText+' </center>'+cChr
htmlText = htmlText+'</div>'+cChr+cChr
htmlText = htmlText+''+cChr+cChr
htmlText = htmlText+'</html>'
* 保存至html文件
STRTOFILE(htmlText,cPrnFile)
ENDFUNC

_________________
從事企業ERP開發,學會止境,精益求精。
回頂端
檢視會員個人資料 發送私人訊息 MSN Messenger
yoncen



註冊時間: 2005-08-29
文章: 33


第 4 樓

發表發表於: 星期五 九月 02, 2005 8:34 am    文章主題: 引言回覆

* 將所有非字符型數據轉換為字符型數據
FUNCTION chkFieldType
LPARAMETERS cOldValue
LOCAL cNewValue
DO CASE
CASE 'C'$VARTYPE(cOldValue)
cNewValue=cOldValue
CASE 'N'$VARTYPE(cOldValue)
cNewValue=TRIM(STR(cOldValue))
CASE 'D'$VARTYPE(cOldValue)
cNewValue=DTOC(cOldValue)
OTHERWISE
cNewValue=""
ENDCASE
RETURN cNewValue
ENDFUNC

_________________
從事企業ERP開發,學會止境,精益求精。
回頂端
檢視會員個人資料 發送私人訊息 MSN Messenger
214152



註冊時間: 2005-08-24
文章: 19
來自: 台南

第 5 樓

發表發表於: 星期五 九月 02, 2005 8:40 am    文章主題: 引言回覆

謝謝各位同胞的指導,我會試試看的.
再次感謝!

_________________
scott
回頂端
檢視會員個人資料 發送私人訊息 雅虎訊息通
從之前的文章開始顯示:   
發表新主題   回覆主題    VFP 愛用者社區 首頁 -> VFP 討論區 所有的時間均為 台北時間 (GMT + 8 小時)
1頁(共1頁)

 
前往:  
無法 在這個版面發表文章
無法 在這個版面回覆文章
無法 在這個版面編輯文章
無法 在這個版面刪除文章
無法 在這個版面進行投票
無法 在這個版面附加檔案
無法 在這個版面下載檔案


Powered by phpBB © 2001, 2005 phpBB Group
正體中文語系由 phpbb-tw 維護製作