procedure TFormNewBuildingStat.frReportNewBuildingGetValue( const ParName: String; var ParValue: Variant); begin inherited; if AnsiCompareText(ParName, 'Cell1') = 0 then ParValue := StringGrid1.Cells[0, frUserDataset1.RecNo+1] else if AnsiCompareText(ParName, 'Cell2') = 0 then ParValue := StringGrid1.Cells[1, frUserDataset1.RecNo+1] else if AnsiCompareText(ParName, 'Cell3') = 0 then ParValue := StrToFloat(StringGrid1.Cells[2, frUserDataset1.RecNo+1]) else if AnsiCompareText(ParName, 'Cell4') = 0 then ParValue := StrToFloat(StringGrid1.Cells[3, frUserDataset1.RecNo+1]) else if AnsiCompareText(ParName, 'Cell5') = 0 then ParValue := StrToFloat(StringGrid1.Cells[4, frUserDataset1.RecNo+1]) else if AnsiCompareText(ParName, 'Cell6') = 0 then ParValue := StrToFloat(StringGrid1.Cells[5, frUserDataset1.RecNo+1]) else if AnsiCompareText(ParName, 'Cell7') = 0 then ParValue := StrToFloat(StringGrid1.Cells[6, frUserDataset1.RecNo+1]) else if AnsiCompareText(ParName, 'Cell8') = 0 then ParValue := StrToFloat(StringGrid1.Cells[7, frUserDataset1.RecNo+1]) else if AnsiCompareText(ParName, 'Cell9') = 0 then ParValue := StrToFloat(StringGrid1.Cells[8, frUserDataset1.RecNo+1]) else if AnsiCompareText(ParName, 'CellYear') = 0 then begin if self.cbYear.Text='' then ParValue :='所有' else ParValue :=self.cbYear.Text; end; end;
procedure TFormNewBuildingStat.cmdPrintNewBuildingClick(Sender: TObject); begin inherited; self.frUserDataset1.RangeEnd:=reCount; self.frUserDataset1.RangeEndCount:=self.StringGrid1.RowCount-1; self.frReportNewBuilding.ShowReport; end;
with self.NewBuildingStat.DataView do begin first; for i:=1 to RecordCount do begin with self.StringGrid1 do begin Cells[0,i]:=IntToStr(i); Cells[1,i]:=FieldByName('C_Building_Name').AsString; Cells[2,i]:=FieldByName('C_Build_Area').AsString; Cells[3,i]:=FieldByName('C_Heating_Area').AsString; Cells[4,i]:=FieldByName('C_ShouldPay_Money').AsString; Cells[5,i]:=FieldByName('C_FactPay_Money').AsString; Cells[6,i]:=FieldByName('C_Goods_Money').AsString; Cells[7,i]:=FieldByName('C_Free_Money').AsString; Cells[8,i]:=FieldByName('C_Arrear').AsString; RowCount:=RowCount+1; end; next; end; end;
const ParName: String; var ParValue: Variant);
begin
inherited;
if AnsiCompareText(ParName, 'Cell1') = 0 then
ParValue := StringGrid1.Cells[0, frUserDataset1.RecNo+1]
else if AnsiCompareText(ParName, 'Cell2') = 0 then
ParValue := StringGrid1.Cells[1, frUserDataset1.RecNo+1]
else if AnsiCompareText(ParName, 'Cell3') = 0 then
ParValue := StrToFloat(StringGrid1.Cells[2, frUserDataset1.RecNo+1])
else if AnsiCompareText(ParName, 'Cell4') = 0 then
ParValue := StrToFloat(StringGrid1.Cells[3, frUserDataset1.RecNo+1])
else if AnsiCompareText(ParName, 'Cell5') = 0 then
ParValue := StrToFloat(StringGrid1.Cells[4, frUserDataset1.RecNo+1])
else if AnsiCompareText(ParName, 'Cell6') = 0 then
ParValue := StrToFloat(StringGrid1.Cells[5, frUserDataset1.RecNo+1])
else if AnsiCompareText(ParName, 'Cell7') = 0 then
ParValue := StrToFloat(StringGrid1.Cells[6, frUserDataset1.RecNo+1])
else if AnsiCompareText(ParName, 'Cell8') = 0 then
ParValue := StrToFloat(StringGrid1.Cells[7, frUserDataset1.RecNo+1])
else if AnsiCompareText(ParName, 'Cell9') = 0 then
ParValue := StrToFloat(StringGrid1.Cells[8, frUserDataset1.RecNo+1])
else if AnsiCompareText(ParName, 'CellYear') = 0 then
begin
if self.cbYear.Text='' then
ParValue :='所有'
else
ParValue :=self.cbYear.Text;
end;
end;
begin
inherited;
self.frUserDataset1.RangeEnd:=reCount;
self.frUserDataset1.RangeEndCount:=self.StringGrid1.RowCount-1;
self.frReportNewBuilding.ShowReport;
end;
begin
first;
for i:=1 to RecordCount do
begin
with self.StringGrid1 do
begin
Cells[0,i]:=IntToStr(i);
Cells[1,i]:=FieldByName('C_Building_Name').AsString;
Cells[2,i]:=FieldByName('C_Build_Area').AsString;
Cells[3,i]:=FieldByName('C_Heating_Area').AsString;
Cells[4,i]:=FieldByName('C_ShouldPay_Money').AsString;
Cells[5,i]:=FieldByName('C_FactPay_Money').AsString;
Cells[6,i]:=FieldByName('C_Goods_Money').AsString;
Cells[7,i]:=FieldByName('C_Free_Money').AsString;
Cells[8,i]:=FieldByName('C_Arrear').AsString;
RowCount:=RowCount+1;
end;
next;
end;
end;