源码如下:
DetailBand1.Frame.DrawLeft:= true;
DetailBand1.Frame.DrawRight:= true;
QRDBText2.AutoSize := True;
QRDBText2.AutoStretch := True;
procedure TfmRep.QRDBText2Print(sender: TObject;
var Value: String);
begin
Value := wrap_line(Value,10);
//10表示一行打印字符数.
end;
function wrap_line(Value: String;
max_len_line: integer ): String;
var
ws: WideString;
s: string;
begin
ws:= Value;
s:= '';
while length(ws) > MAX_LEN_LINEdo
begin
s:= s + Copy(ws, 1, MAX_LEN_LINE) + #13;
delete(ws, 1, MAX_LEN_LINE);
end;
Result:= s + ws;
end;