 |
VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
|
上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
goto-dream
註冊時間: 2004-05-11 文章: 909
第 1 樓
|
發表於: 星期三 三月 30, 2005 5:48 am 文章主題: vfp9解決了自訂報表的問題!(轉貼) |
|
|
發貼心情 vfp9解決了自定義紙張設置的大問題[轉帖]
原文:
http://www.meizibbs.3322.org/bbs/dispbbs.asp?boardid=2&star=1&replyid=77009&id=36804&skin=0&page=1
代碼: | *********************************************************
*********************************************************
* vfp9終結一直以來關於打印紙張設置
* 過程名稱:MyReport.prg
* 調用方式:MyReport(ReportName, Height, Width)
* 當 Height和Width為空時,默認A4紙
* 程序原創:dupeiji
* 最後修改:pnyjq
* 修改日期:2005-03-23
* 待解決問題:當ListenerType = 1時無法正常預覽
*********************************************************
Parameters lcFRX, nHeight, nWidth
Local loReportListener
If Empty(lcFRX)
Return
Endif
loReportListener = Createobject("Test")
#DEFINE A4_Height 29.7
#DEFINE A4_Width 21
loReportListener.sHeight=Icase(Empty(nHeight), A4_Height, nHeight)
loReportListener.sWidth=Icase(Empty(nWidth), A4_Width, nWidth)
Report Form (lcFRX) Object loReportListener
Define Class Test As ReportListener
ListenerType = 0
sHeight=0
Procedure GetPageHeight()
If This.sHeight >0
Return This.sHeight * 377.95
Else
Return DoDefault()
Endif
Endproc
sWidth=0
Procedure GetPageWidth()
If This.sWidth >0
Return This.sWidth * 377.95
Else
Return DoDefault()
Endif
Endproc
Procedure OutputPage(nPageNo, eDevice, nDeviceType, nleft, nTop, nWidth, nHeight)
t_sHeight=This.sHeight
This.sHeight=0
nHeight=t_sHeight * 377.95 * nHeight/This.GetPageHeight()
This.sHeight=t_sHeight
t_sWidth=This.sWidth
This.sWidth=0
nWidth=t_sWidth * 377.95 * nWidth/This.GetPageWidth()
This.sWidth=t_sWidth
DoDefault(nPageNo, eDevice, nDeviceType,nleft, nTop, nWidth, nHeight)
Nodefault
Endproc
Enddefine |
_________________ 福隆昌淨水有限公司--淨水器的專家,淨水器,飲水機,濾心!!
想了解更多,您可上幸福雞湯組.找尋!!丁澐瑄.老師.
愛作夢 |
|
回頂端 |
|
 |
goto-dream
註冊時間: 2004-05-11 文章: 909
第 2 樓
|
發表於: 星期六 六月 24, 2006 5:04 pm 文章主題: |
|
|
從別處看來的
VFP9的报表能实现无级缩放打印
faq-it.org/linux_basic/
---------------------------------------------------------------
PUBLIC nWsfl,nHsfl
nWsfl=0.5 &&宽度缩放率,想要得到最佳效果,请调整此处。
nHsfl=0.5 &&高度缩放率,想要得到最佳效果,请调整此处。
LOCAL loReportListener, lcFRX
lcFRX = GETFILE("frx")
IF EMPTY(lcFRX)
RETURN
ENDIF
loReportListener = CREATEOBJECT("Test")
REPORT FORM (lcFRX) OBJECT loReportListener PREVIEW
RELEASE nWsfl,nHsfl
DEFINE CLASS Test AS REPORTLISTENER
LISTENERTYPE = 0
PROCEDURE OUTPUTPAGE(nPageNo, eDevice, nDeviceType,nleft, nTop, nWidth, nHeight)
DODEFAULT(nPageNo,eDevice,nDeviceType,nleft,nTop,nWidth*nWsfl,nHeight*nHsfl)
NODEFAULT
ENDPROC
ENDDEFINE _________________ 福隆昌淨水有限公司--淨水器的專家,淨水器,飲水機,濾心!!
想了解更多,您可上幸福雞湯組.找尋!!丁澐瑄.老師.
愛作夢 |
|
回頂端 |
|
 |
goto-dream
註冊時間: 2004-05-11 文章: 909
第 3 樓
|
|
回頂端 |
|
 |
林永強
註冊時間: 2005-06-21 文章: 12 來自: HONG KONG
第 4 樓
|
發表於: 星期三 八月 29, 2007 1:50 am 文章主題: |
|
|
REPORT FORM (lcFRX) OBJECT loReportListener PREVIEW TO PRINTER Prompt |
|
回頂端 |
|
 |
|
|
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
|
|