奇怪问题:QuickReport中的rbColumnHeader类型的QRBand中的QRLabel内容不能显示
我只在FormCreate事件中写了以下代码:
procedure TfrmYear_Report.FormCreate(Sender: TObject);
var
intRecCount:integer;
strYear:string;
begin
strYear:='2004';
//国内男客统计
DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''1'' and ArriveTime>='''+strYear+'01000000'' and ArriveTime<='''+strYear+'04000000''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel25.Caption:=inttostr(intRecCount);
DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''1'' and ArriveTime>='''+strYear+'04000000'' and ArriveTime<='''+strYear+'07000000''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel26.Caption:=inttostr(intRecCount);
DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''1'' and ArriveTime>='''+strYear+'07000000'' and ArriveTime<='''+strYear+'10000000''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel27.Caption:=inttostr(intRecCount);
DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''1'' and ArriveTime>='''+strYear+'10000000'' and ArriveTime<='''+strYear+'12312459''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel28.Caption:=inttostr(intRecCount);
//国内女客统计
DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''2'' and ArriveTime>='''+strYear+'01000000'' and ArriveTime<='''+strYear+'04000000''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel30.Caption:=intToStr(intRecCount);
{DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''2'' and ArriveTime>='''+strYear+'0400'' and ArriveTime<='''+strYear+'0700''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel31.Caption:=inttostr(intRecCount);
DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''2'' and ArriveTime>='''+strYear+'0700'' and ArriveTime<='''+strYear+'1000''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel32.Caption:=inttostr(intRecCount);
DS_Year.close;
DS_Year.CommandText:='Select * from History_China where sex=''2'' and ArriveTime>='''+strYear+'1000'' and ArriveTime<='''+strYear+'1231''';
DS_Year.Open;
if not DS_Year.Recordset.EOF then
intRecCount:=DS_Year.RecordCount
else
intRecCount:=0;
QRLabel33.Caption:=inttostr(intRecCount);}
//DS_Year.Close;
end;
-------------------------
最奇怪的地方就是我把女客显示那块注销掉后,rbColumnHeader类型的QRBand中的QRLabel内容就能显示...否则加算是加一个QRLabel30的内容上去,rbColumnHeader类型的QRBand中的QRLabel内容也是不能显示的,上面女客的代码都是COPY码...帮忙看看看..先谢了~~