RMReport 7

时间:2015-10-27 05:20:36
【文件属性】:
文件名称:RMReport 7
文件大小:4.47MB
文件格式:OCX
更新时间:2015-10-27 05:20:36
VB控件 RMReport VB控件 RMReport7 转:RMReport的使用方法及详解 1、不打印特定的MemoView,套打常用 a.页面设置-->其它-->不打印背景图 b.设置MemoView属性printable=False 2、 如何打印wwDBGrid? 修改rm.inc,如果想支持RX,GIF,JPEG,DimandAccess,Halcyon,DBISAM, EHLib,也需要修改rm.inc //{$DEFINE InfoPower} //修改这行,去掉"//" //{$Ehlib} 3.试用版安装方法(以下假设将文件释放到c:/rm目录中) (1)Tools->Environments Option->Libary->Libary Path中增加: c:/rm/souce c:/rm/bpl $(DELPHI)/Lib $(DELPHI)/Bin $(DELPHI)/Imports $(DELPHI)/Projects/Bpl (2)Component->Install Packages->Add,选bpl/rm_d70.bpl 4.在Delphi IDE中卸载以前的Report Machine版本,然后打开rm_r50.dpk,选"compile", 在打开rm_d50.dpk,选"Install". 包分成了Runtime package和Designer package,所以要安装顺序安装 5、单元格的变量格式用代码设置 t = TRMGridReportPage(RMGridReport1.Pages[0]).Grid.Cells[1, 1].View t = TRMMemoView(RMReport1.FindObject('memo1')); t.DisplayFormat := 'N0.001' //数字型 t.DisplayFormat := 'Dyyyy/mm/dd' //日期型 6、两遍报表如何用代码设置 GridReport1.DoublePass := True 7、用代码写数据字典: RMReport1.Dictionary.FieldAliases.Clear; RMReport1.Dictionary.FieldAliases['RMDBDataSet1'] := '动物'; RMReport1.Dictionary.FieldAliases['RMDBDataSet1."Name"'] := '姓名'; 这样在RM的设计器<插入数据字段>显示为自定义名称,为最终用户提供友好的显示 8、在报表中如何使用变量(或者如何给某个memoview赋值) a.RMVariables在RM_Class.pas中定义,是全局变量,这样定义后就可以在报表中使用变量"var1",例如: RMVariables['变量名称'] := Edit1.Text; b.用报表中数据字典,TRMReport.Dictionary.Variables,需要注意的是,如果变量是字符型的需要用AsString赋值,其他类型的用RMReport.Dictionary.Variables['var1'] := 1234,例如: RMReport1.LoadFromFile('1.rls'); RMReport1.Dictionary.Variables.AsString['变量名称'] := Edit1.Text; c. 直接对某个单元格赋值,例如: RMGridReport1.LoadFromFile('1.rls'); TRMGridReportPage(RMGridReport1.Pages[0]).Grid.Cells[1,1].Text := '值'; 如果是RMReport: RMReport1.LoadFromFile('1.rmf'); t := RMReport1.FindObject('Memo1'); if t <> nil then // var t: TRMView t.Memo.Text := 'dsdsdsds'; d.脚本中直接引用Form的值 procedure Main; begin Memo1.Memo.Text := Form1.Edit1.Text; end; 9、自动换行 主项数据栏Stretched = true 文本框 Stretched = true WordWrap = true 10、RM内置变量(Script),增加中.... a.属性PrintAtAppendBlank=True CurReport.AppendBlanking=True时代表增加空行 在RM中,打印设置只能保存页面边距及打印份数、是否两遍打印以及是否套打等参数,缺少保存打印机纸张类型、进纸方式以及纸张页面大小等信息的保存及引入。详情可以参见RM_Class.pas代码的第13776行的保存处代码以及13706引入代码。 现在我们修改一下这两处代码,我们处理保存到注册表方式,保存到INI文件方式类似。 将其他信息保存进去 liRegIniFile.WriteInteger(aReportName, 'Page_' + IntToStr(i) + '_PageWidth', aReport.Pages[i].pgWidth);//页宽 liRegIniFile.WriteInteger(aReportName, 'Page_' + IntToStr(i) + '_PageHeight', aReport.Pages[i].pgHeight);//页高 liRegIniFile.WriteInteger(aReportName, 'Page_' + IntToStr(i) + '_pgOr', Integer(aReport.Pages[i].pgOr));//方向(横向或是纵向) liRegIniFile.WriteInteger(aReportName, 'Page_' + IntToStr(i) + '_pgBin', aReport.Pages[i].pgBin);//进纸方式 liRegIniFile.WriteInteger(aReportName, 'Page_' + IntToStr(i) + '_pgSize', aReport.Pages[i].pgSize);//纸张尺寸(自定义=256) 再修改引入处的代码: AWidth := liRegIniFile.ReadInteger(aReportName, 'Page_' + IntToStr(i) + '_PageWidth', 0); AHeight := liRegIniFile.ReadInteger(aReportName, 'Page_' + IntToStr(i) + '_PageHeight', 0); AOr := liRegIniFile.ReadInteger(aReportName, 'Page_' + IntToStr(i) + '_pgOr', 0); ABin := liRegIniFile.ReadInteger(aReportName, 'Page_' + IntToStr(i) + '_pgBin', 0); ASize := liRegIniFile.ReadInteger(aReportName, 'Page_' + IntToStr(i) + '_pgSize', 0); aReport.Pages[i].ChangePaper(ASize,AWidth,AHeight,ABin,TPrinterOrientation(AOr));//关键,更改页面信息 var Page: TRMReportPage; Page := TRMReportPage(RMReport1.Pages[0]); Page.ChangePaper(); ChangePaper(ASize, AWidth, AHeight,abin: Integer; AOr: TPrinterOrientation); asize:页码纸张的类型,可以通过api从打印驱动中取出例如9是a4,如果系统没有的纸张类型,她认为是自定义格式 awidth:纸张宽度(MM) aheight:纸张高度(MM) AOr:打印方向 // rmpolangscape 横向 rmpoPortrait //纵向 ABIN:;//进纸方式

网友评论

  • c/s开发很好用的控件,用起来超方便,可以自己封装
  • 和我几年前在上家公司使用的是相同的版本,只是有个问题,在设置报表的时候总有点地方感觉怪怪的。不知道是控件问题还是使用问题。希望CSDN开个板块专门的报表这块讨论。
  • 用了,不错的。
  • SmartScreen阻止了下载,还要评论才能再次下载。
  • 非常好,再下一次
  • c/s开发很好用的控件,用起来超方便,可以自己封装
  • 以前我工作用的是 vb6.0 + RMReport5.ocx,版本:5.0.6.0,想用这个升级替换,发现不可行。
  • 这版本较好,二分值得,推荐学习
  • 怎么那么小,还没使用
  • 下载了,可惜不适合我自己用 还是谢谢了
  • RMReport控件的方法解释的很详细,不过不适合我用,还是谢谢楼主