近段时间用Delphi7的RaveReport控件做票据打程序, 遇到不少问题. 幸好在网上得到得一些前辈(有意或无意)的帮助.得到不少心得. 在此表示感谢! 同时也将自己的所得拿出来与大家一起分享.
unit UReportClass;
interface
uses
Windows,classes,Forms,UGlobalSet,RpRave,RvClass,RvCSstd,RVProj,RpDefine,RpConDS,
RvDirectDataView,RvCsData,RvCsRpt,rvData,RpRenderPreView,Rpfiler,sysUtils,
RpRenderPrinter,rvUtil,Controls,Graphics,RvCsDraw,RpBase,Printers;
type
ReportClass=class(TComponent)
private
ClsIndexList:TStringList;
FRpPage:TRavePage;
FReport:TRaveReport;
function GetReportName: CString;
procedure SetOnPVPageChange(const Value: TNotifyEvent);
function GetPVPageChange: TNotifyEvent;
protected
RvProject: TRvProject;
RvNDRWriter: TRvNDRWriter;
RvRenderPreView: TRvRenderPreView;
RvRenderPrinter: TRvRenderPrinter;
DataViewList:TList;
function GetCtrlName(Cls:TClass):CString;
public
PreViewTop,PreViewLeft:Integer;
property OnPVPageChange:TNotifyEvent read GetPVPageChange write SetOnPVPageChange;
//
property ReportName:CString read GetReportName;
procedure ProjectExecute;
constructor Create(AWoner:TComponent);override;
destructor Destroy;override;
//
function AddText(Parent:TRavecomponent;aText:CString;Top,Left,
width,Height:Single;Font:TRaveFont):TRaveText;
function AddDataText(Parent:TRavecomponent;DataViewId:Integer;
FieldName:CString;Top,Left,width,
Height:Single;Font:TRaveFont):TRaveDataText;
function AddRegion(Parent:TRavecomponent;Top,Left,width,Height:Single):TRaveRegion;
function AddDataBind(RvRegion:TRaveRegion;Height:Single;DataViewID:Integer):TRaveDataBand;
function AddDataCycle(dataViewId:Integer):TRaveDataCycle;
function AddBitmap(parent: TRavecomponent;aBitmap:TBitmap;
Top,Left,width,Height:Single): TRaveBitmap;
//
function XPointToInch(X:Integer):Single;//点坐标到英寸
function YPointToInch(Y:Integer):Single;//点坐标到英寸
procedure AddDataSetConnection(DSConn:TRvDataSetConnection); //加入数据连接
procedure SaveRav; //保存报表
//以下全部是关于预览的函数与过程
procedure PreView(ScrollBox:TScrollBox);
procedure PreViewfirstPage;
Procedure PreViewPrevPage;
Procedure PreView下一页:Delphi如何控制登陆失败的次数 " href="http://www.pushad.com/Info/13345.Html">Delphi如何控制登陆失败的次数 ;
procedure PreView上一页:JSP中Filter的简单应用 ;
procedure GotoPage(Index:Integer);
procedure PreViewReDrawPage;
procedure PreViewZoomIn;
procedure PreViewZoomOut;
procedure PreViewFitPage;
function PreviewPages:Integer;
function PreviewCurPage:Integer;
function PreviewBof:Boolean; //首页
function PreviewEof:Boolean; //尾页
function PreViewPrinter:Boolean; //预览后打印
procedure refreshScollBox;
//设置页面大小
procedure SetPageSize(Height,Width:Single);
function Printer:Boolean; //打印
end;
欢迎访问最专业的网吧论坛,无盘论坛,网吧经营,网咖管理,网吧专业论坛
https://bbs.txwb.com
关注天下网吧微信/下载天下网吧APP/天下网吧小程序,一起来超精彩
|
本文来源:网络 作者:佚名