No1: procedure TForm2.QRDBText1Print(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;No2:設置你的qrshape----Brush----Color 為黑色就OK
手動就比較繁了,字符串后加#13
表格边框用QRShape1,pen:with=2或以上,會更清楚,顯示出來會粗些.
procedure TForm2.QRDBText1Print(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;No2:設置你的qrshape----Brush----Color 為黑色就OK