- 註冊時間
- 2006-3-13
- 最後登錄
- 2025-1-10
- 在線時間
- 673 小時
- 閱讀權限
- 200
- 積分
- 417
- 帖子
- 1107
- 精華
- 0
- UID
- 2
  
|
- function ChiWrap(Memo : String;LineLen : Integer) : String;
- var
- MemoList, ResultList : Tstrings;
- i : integer;
- WS : WideString;
- begin
- MemoList := TStringList.Create;
- ResultList := TStringList.Create;
- try
- MemoList.Text := Memo;
- for i := 0 to MemoList.Count -1 do
- begin
- WS := MemoList[i];
- while Length(WS) > LineLen do
- begin
- ResultList.Add(Copy(WS,0,LineLen));
- WS := Copy(WS,LineLen+1,Length(WS));
- end;
- ResultList.Add(WS);
- end;
- Result := ResultList.Text;
- finally
- MemoList.Free;
- ResultList.Free;
- end;
- end;
- procedure TForm1.DetailBand1BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
- begin
- QRLabel1.Caption := ChiWrap(Table1.FieldByName('ChiDesc').AsString,40);
- end;
複製代碼 寫在 QRLabel 的 BeforePrint 事件或該 band 的 BeforePrint 事件都可以
參考來源
http://delphi.ktop.com.tw/board. ... d=100&tid=27799 |
|