如何在報表中設定字型的顏色

來源:互聯網
上載者:User
在資料庫中資料有很多數值,要把數值是1的欄位值在報表中特殊表示(比如是粗體紅色,或者)用的是memoview控制項,是不是要寫指令碼語言?怎麼寫呢?
(1):在onbeforeprint裡面判斷是不是=1。   
  然後設定顏色就行了。
procedure   TForm1.frReport1BeforePrint(Memo:   TStringList;   View:   TfrView);   
  begin   
      if   (View.Name='Memo1')and(View   is     TfrMemoView)   then   
              if   ADOTable1.Fields[0].AsString   ='1'   then     //這裡好像不行,你自己改吧。   
                    TfrMemoView(View).Font.Color   :=     clRed;   
  end;
(2):設定兩個MEMO,   一個是加粗紅色字型的如   MEMO1,   另一個普通MEMO2   
   
  if   DataSet["欄位名"]='1'   then   
  begin   
      Memo1.Visible   :=   True;   
      Memo2.Visible   :=   False;   
  end     
  else   begin   
      Memo1.Visible   :=   False;   
      Memo2.Visible   :=   True;   
  end;   
  第二種方法不是太好,但一定可行,   
  第二種方法沒有具體調試,應該也行
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.