| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 5269 人关注过本帖
标题:VFP如何实现报表倒过来显示
只看楼主 加入收藏
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1547
专家分:184
注 册:2006-6-3
收藏(1)
得分:0 
以下是引用吹水佬在2016-3-8 21:37:14的发言:

用报表监听器和GDI+示例
 
 
**
** 报表扩展功能示例(旋转)
**
CREATE CURSOR tt (ss C(10), ff I)
FOR i = 1 TO 10
    INSERT INTO tt VALUES (PADL(i, 10, "0"), i)
ENDFOR
 
oRL = CREATEOBJECT("myReportListener")
oRL.ListenerType = 1
REPORT FORM 报表扩展功能示例(旋转).frx OBJECT oRL
 
DEFINE CLASS myReportListener AS ReportListener
    DynamicLineHeight = .F.
     
    IsRotate = .F.  
 
    PROCEDURE Init
        DECLARE LONG GdipRotateWorldTransform    IN GDIPlus.Dll LONG, SINGLE, LONG
        DECLARE LONG GdipTranslateWorldTransform IN GDIPlus.Dll LONG, SINGLE, SINGLE, LONG
        DECLARE LONG GdipSaveGraphics            IN GDIPlus.DLL LONG, LONG@
        DECLARE LONG GdipRestoreGraphics         IN GDIPlus.DLL LONG, LONG
    ENDPROC  
 
    PROCEDURE BeforeBand(nBandObjCode, nFRXRecNo)  
        DODEFAULT(nBandObjCode, nFRXRecNo)  
        this.IsRotate = INLIST(nBandObjCode, 1, 4, 7)    && 标头、细节、注脚
    ENDPROC
 
    PROCEDURE AfterBand(nBandObjCode, nFRXRecNo)
        this.IsRotate = .F.
        DODEFAULT(nBandObjCode, nFRXRecNo)
    ENDPROC
 
    PROCEDURE Render(nFRXRecNo, nLeft, nTop, nWidth, nHeight,;
                     nObjectContinuationType, cContentsToBeRendered, GDIPlusImage)  
        LOCAL gState, x, y
        gState = 0
        IF this.IsRotate
            x = nLeft + nWidth    && 转点
            y = nTop
            GdipSaveGraphics(this.GDIPlusGraphics, @gState)
            GdipTranslateWorldTransform(this.GDIPlusGraphics, x, y, 0)
            GdipRotateWorldTransform (this.GDIPlusGraphics, -180, 0) && 逆转180度
            GdipTranslateWorldTransform(this.GDIPlusGraphics, -x, -y, 0)
        ENDIF
        DODEFAULT(nFRXRecNo, nLeft, nTop, nWidth, nHeight, ;
                  nObjectContinuationType, cContentsToBeRendered, GDIPlusImage)
        IF this.IsRotate
            GdipRestoreGraphics(this.GDIPlusGraphics, gState)
        ENDIF
        NODEFAULT  
   ENDPROC
ENDDEFINE
代码好长,看不懂。
2017-05-25 15:02
快速回复:VFP如何实现报表倒过来显示
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016672 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved