ReportMachine 3.0技巧

來源:互聯網
上載者:User

  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時代表增加空行

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.