L
liukun966123
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tfor_warning.BitBtn2Click(Sender: TObject);
type
mydata = array[0..5] of string;
var i: integer;
str1: mydata;
begin
// self.QRStringsBand1.Items.Add('******************报表*****************');
//showmessage(inttostr());
for i := 0 to self.StringGrid1.rowCount - 1do
begin
//str1[0]:=format('%18s',[stringgrid1.Cells[i,0]]);
str1[0] := trim(stringgrid1.Cells[0, i]);
str1[1] := trim(stringgrid1.Cells[1, i]);
str1[2] := trim(stringgrid1.Cells[2, i]);
str1[3] := trim(stringgrid1.Cells[3, i]);
str1[4] := trim(stringgrid1.Cells[4, i]);
str1[5] := trim(stringgrid1.Cells[5, i]);
//self.QRStringsBand1.Items.Add(format('%-.18s',[str1[0]]));
self.QRStringsBand1.Items.add(format('%-18s', [str1[0]]) + format('%-18s', [str1[1]]) + format('%-18s', [str1[2]]) + format('%-18s', [str1[3]]) + format('%-18s', [str1[4]]) + format('%-18s', [str1[5]]));
showmessage(inttostr(length(self.QRStringsBand1.Items.Text)));
showmessage(self.qrstringsband1.items.text);
end;
QuickRep1.PreviewModal;
self.QRStringsBand1.Items.Clear
end;
打印预览的时候,始终不能对齐,
还有我把每个字符串格式化为18位的,但每次我在self.QRStringsBand1.Items.add()后检测self.qrstringsband1.items.text的长度对不对
不解,帮忙 help????????????
type
mydata = array[0..5] of string;
var i: integer;
str1: mydata;
begin
// self.QRStringsBand1.Items.Add('******************报表*****************');
//showmessage(inttostr());
for i := 0 to self.StringGrid1.rowCount - 1do
begin
//str1[0]:=format('%18s',[stringgrid1.Cells[i,0]]);
str1[0] := trim(stringgrid1.Cells[0, i]);
str1[1] := trim(stringgrid1.Cells[1, i]);
str1[2] := trim(stringgrid1.Cells[2, i]);
str1[3] := trim(stringgrid1.Cells[3, i]);
str1[4] := trim(stringgrid1.Cells[4, i]);
str1[5] := trim(stringgrid1.Cells[5, i]);
//self.QRStringsBand1.Items.Add(format('%-.18s',[str1[0]]));
self.QRStringsBand1.Items.add(format('%-18s', [str1[0]]) + format('%-18s', [str1[1]]) + format('%-18s', [str1[2]]) + format('%-18s', [str1[3]]) + format('%-18s', [str1[4]]) + format('%-18s', [str1[5]]));
showmessage(inttostr(length(self.QRStringsBand1.Items.Text)));
showmessage(self.qrstringsband1.items.text);
end;
QuickRep1.PreviewModal;
self.QRStringsBand1.Items.Clear
end;
打印预览的时候,始终不能对齐,
还有我把每个字符串格式化为18位的,但每次我在self.QRStringsBand1.Items.add()后检测self.qrstringsband1.items.text的长度对不对
不解,帮忙 help????????????