呵呵,如果用QrLabel要写代码的,Quick不象FastReport那么聪明。 procedure TForm1.QRLabel1Print(sender: TObject; var Value: String); var bExit : boolean; iLen : integer; strSource, strTemp : string; begin if Length(Value) <= 32 then exit; strSource := Value; Value := ''; while true do begin iLen := 1; while iLen < 32 do begin if ord(strSource[iLen]) > 128 then inc(iLen, 2) else inc(iLen); end; dec(iLen); strTemp := Copy(strSource, 1, iLen); if Value = '' then Value := strTemp else Value := Value + #13 + strTemp; strSource := Copy(strSource, iLen + 1, Length(strSource) - iLen); if Length(strSource) <= 32 then begin Value := Value + #13 + strSource; exit; end; end; end; 其中32是寬度,可以改
procedure TForm1.QRLabel1Print(sender: TObject; var Value: String);
var
bExit : boolean;
iLen : integer;
strSource, strTemp : string;
begin
if Length(Value) <= 32 then
exit;
strSource := Value;
Value := '';
while true do
begin
iLen := 1;
while iLen < 32 do
begin
if ord(strSource[iLen]) > 128 then
inc(iLen, 2)
else
inc(iLen);
end;
dec(iLen);
strTemp := Copy(strSource, 1, iLen);
if Value = '' then
Value := strTemp
else
Value := Value + #13 + strTemp;
strSource := Copy(strSource, iLen + 1, Length(strSource) - iLen);
if Length(strSource) <= 32 then
begin
Value := Value + #13 + strSource;
exit;
end;
end;
end;
其中32是寬度,可以改