S
sxd2002
Unregistered / Unconfirmed
GUEST, unregistred user!
with Query1do
begin
query1.Close;
query1.SQL.Clear;
Query1.SQL.Add(' Select hm,sum(je),count(*) from temp.db group by hm ');
query1.Open;
QuickReport1.DataSet:=query1;
QuickReport1.QRDBText1.DataSet:=query1;
QuickReport1.QRDBText1.DataField:='hm';
QuickReport1.QRDBText2.DataSet:=query1;
QuickReport1.QRDBText2.DataField:='sum(je)';
QuickReport1.QRDBText3.DataSet:=query1;
QuickReport1.QRDBText3.DataField:='count(*)';
QuickReport1.QRDBText4.DataSet:=query1;
QuickReport1.Preview;
end;
QUERY是没有问题,就是QuickReport1.QRDBText2.DataField:=sum(je);在报表里没有数据
begin
query1.Close;
query1.SQL.Clear;
Query1.SQL.Add(' Select hm,sum(je),count(*) from temp.db group by hm ');
query1.Open;
QuickReport1.DataSet:=query1;
QuickReport1.QRDBText1.DataSet:=query1;
QuickReport1.QRDBText1.DataField:='hm';
QuickReport1.QRDBText2.DataSet:=query1;
QuickReport1.QRDBText2.DataField:='sum(je)';
QuickReport1.QRDBText3.DataSet:=query1;
QuickReport1.QRDBText3.DataField:='count(*)';
QuickReport1.QRDBText4.DataSet:=query1;
QuickReport1.Preview;
end;
QUERY是没有问题,就是QuickReport1.QRDBText2.DataField:=sum(je);在报表里没有数据