?? bustradezhyearrepunit.~pas
字號:
begin
if List.Items[j].SubItems.Count<3 then
begin
List.Items[j].SubItems.Add(' ');
end
else
List.Items[j].SubItems[2]:='';
end;
end else
begin
for j:=0 to 22 do
begin
if List.Items[j].SubItems.Count<3 then
begin
List.Items[j].SubItems.Add(' ');
end else
begin
List.Items[j].SubItems[2]:='';
end;
end;
end;
end;
procedure TBusTradeZHYearRepFrm.Insertnum1();
var Indexnum1,Indexnum2,Indexnum3,Indexnum4,Indexnum:single;
begin
//添加GZ035
Indexnum1:=strtofloat(ListView1.Items[6].SubItems[2])+strtofloat(ListView1.Items[7].SubItems[2]);
Indexnum2:=strtofloat(ListView1.Items[9].SubItems[2])+strtofloat(ListView1.Items[10].SubItems[2]);
Indexnum3:=strtofloat(ListView1.Items[11].SubItems[2])+strtofloat(ListView1.Items[12].SubItems[2]);
Indexnum4:=strtofloat(ListView1.Items[13].SubItems[2]);
Indexnum:=Indexnum1+Indexnum2+Indexnum3+Indexnum4;
if(Indexnum=0)then
begin
ListView2.Items[12].SubItems[2]:='0';
end else
ListView2.Items[12].SubItems[2]:=Converter(floattostr(Indexnum));
//添加GZ036
Indexnum1:=strtofloat(ListView1.Items[19].SubItems[2])+strtofloat(ListView1.Items[20].SubItems[2]);;
Indexnum2:=strtofloat(ListView2.Items[0].SubItems[2])+strtofloat(ListView2.Items[1].SubItems[2]);
Indexnum3:=strtofloat(ListView2.Items[2].SubItems[2])+strtofloat(ListView2.Items[3].SubItems[2]);
Indexnum4:=strtofloat(ListView2.Items[4].SubItems[2]);
Indexnum:=Indexnum1+Indexnum2+Indexnum3+Indexnum4;
if(Indexnum=0)then
begin
ListView2.Items[13].SubItems[2]:='0';
end else
ListView2.Items[13].SubItems[2]:=Converter(floattostr(Indexnum));
//添加GZ34
Indexnum1:=strtofloat(ListView2.Items[12].SubItems[2]);
if(Indexnum1+Indexnum=0)then
begin
ListView2.Items[11].SubItems[2]:='0';
end else
ListView2.Items[11].SubItems[2]:=Converter(floattostr(Indexnum1+Indexnum));
end;
procedure TBusTradeZHYearRepFrm.Insertnum2();
var Indexnum1,Indexnum2,Indexnum:single;
begin
//添加GZ140
Indexnum1:=strtofloat(ListView7.Items[7].SubItems[2]);
Indexnum2:=strtofloat(ListView7.Items[8].SubItems[2]);
if(Indexnum2=0)or (Indexnum1=0)then
begin
ListView7.Items[6].SubItems[2]:='0';
end
else begin
Indexnum:=(Indexnum1*10000)/Indexnum2;
ListView7.Items[6].SubItems[2]:=ConverterPercent(floattostr(Indexnum));
end;
//添加GZ143
Indexnum1:=strtofloat(ListView7.Items[10].SubItems[2]);
Indexnum2:=strtofloat(ListView7.Items[11].SubItems[2]);
if(Indexnum2=0)or(Indexnum1=0)then
begin
ListView7.Items[9].SubItems[2]:='0';
end else
begin
Indexnum:=(Indexnum1/Indexnum2)*100;
ListView7.Items[9].SubItems[2]:=ConverterPercent(floattostr(Indexnum));
end;
//添加GZ146
Indexnum1:=strtofloat(ListView7.Items[13].SubItems[2]);
Indexnum2:=strtofloat(ListView7.Items[14].SubItems[2]);
if(Indexnum2=0)or (Indexnum1=0)then
begin
ListView7.Items[12].SubItems[2]:='0';
end else
begin
Indexnum:=(Indexnum1/Indexnum2)*100;
ListView7.Items[12].SubItems[2]:=ConverterPercent(floattostr(Indexnum));
end;
//添加GZ149
Indexnum1:=strtofloat(ListView7.Items[16].SubItems[2]);
Indexnum2:=strtofloat(ListView7.Items[17].SubItems[2]);
if(Indexnum2=0)or(Indexnum1=0)then
begin
ListView7.Items[15].SubItems[2]:='0';
end else
begin
Indexnum:=(Indexnum1/Indexnum2)*100;
ListView7.Items[15].SubItems[2]:=ConverterPercent(floattostr(Indexnum));
end;
//添加GZ153
Indexnum1:=strtofloat(ListView6.Items[4].SubItems[2]);
Indexnum2:=strtofloat(ListView7.Items[18].SubItems[2]);
if(Indexnum2=0)or(Indexnum1=0)then
begin
ListView7.Items[19].SubItems[2]:='0';
end else
begin
Indexnum:=Indexnum1/Indexnum2;
ListView7.Items[19].SubItems[2]:=ConverterPercent(floattostr(Indexnum));
end;
end;
procedure TBusTradeZHYearRepFrm.FormShow(Sender: TObject);
begin
BitBtn4.Enabled:=false;
PageControl1.ActivePage:=TabSheet1;
PageControl1.ActivePage:=TabSheet2;
PageControl1.ActivePage:=TabSheet3;
PageControl1.ActivePage:=TabSheet4;
PageControl1.ActivePage:=TabSheet5;
PageControl1.ActivePage:=TabSheet6;
PageControl1.ActivePage:=TabSheet7;
PageControl1.ActivePage:=TabSheet8;
end;
procedure TBusTradeZHYearRepFrm.Insertnum3();
var sqlstr3:string;
numstr1,numstr2:single;
numstr:single;
begin
sqlstr3:='select 指標(biāo)代碼,本年實(shí)際 from 公交行業(yè)城市規(guī)模指標(biāo)表_z where 城市代碼='
+''''+'022'+''''+' and 統(tǒng)計(jì)年份='+combobox1.text+' order by 指標(biāo)代碼';
ADOQuery3.Close;
ADOQuery3.SQL.Clear;
ADOQuery3.SQL.Add(sqlstr3);
ADOQuery3.Open;
//添加GZ056指標(biāo)值
if(ADOQuery3.Locate('指標(biāo)代碼','TO02',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
numstr2:=strtofloat(ListView2.items[14].subitems[2]);
if(numstr1=0) or (numstr2=0)then
begin
ListView3.Items[11].subitems[2]:='0';
end else
begin
numstr:=numstr2/numstr1;
ListView3.items[11].subitems[2]:=ConverterPercent(floattostr(numstr));
end;
//添加GZ083、GZ082指標(biāo)值
if(ADOQuery3.Locate('指標(biāo)代碼','TO05',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(ADOQuery3.locate('指標(biāo)代碼','TO46',[]))then
numstr2:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0) or (numstr2=0)then
begin
ListView4.items[15].subitems[2]:='0';
ListView4.items[16].subitems[2]:='0';
end else
begin
numstr:=numstr2/numstr1;
ListView4.items[15].subitems[2]:=ConverterPercent(floattostr(numstr));
ListView4.items[16].subitems[2]:=converter(floattostr(numstr2));
end;
//添加GZ084指標(biāo)值
if(ADOQuery3.Locate('指標(biāo)代碼','T008',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0) or (numstr2=0)then
begin
ListView4.items[17].subitems[2]:='0';
end else
begin
numstr:=numstr2/numstr1*100;
ListView4.items[17].subitems[2]:=ConverterPercent(floattostr(numstr));
end;
//添加GZ085指標(biāo)值
numstr1:=strtofloat(ListView4.items[8].subitems[2]);
if(numstr2=0) or(numstr1=0)then
begin
ListView4.items[18].subitems[2]:='0';
end else
begin
numstr:=numstr1/numstr2*100;
ListView4.items[18].subitems[2]:=ConverterPercent(floattostr(numstr));
end;
//添加GZ101指標(biāo)值
if(ADOQuery3.locate('指標(biāo)代碼','TO47',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0)then
begin
ListView5.items[12].subitems[2]:='0';
end else
ListView5.items[12].subitems[2]:=ConverterPercent(floattostr(numstr1));
//添加GZ137指標(biāo)值
if(ADOQuery3.locate('指標(biāo)代碼','TO43',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0)then
begin
ListView7.items[3].subitems[2]:='0';
end else
ListView7.items[3].subitems[2]:=Converter(floattostr(numstr1));
//添加GZ138指標(biāo)值
if(ADOQuery3.locate('指標(biāo)代碼','TO44',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0)then
begin
ListView7.items[4].subitems[2]:='0';
end else
ListView7.items[4].subitems[2]:=converter(floattostr(numstr1));
//添加GZ139指標(biāo)值
if(ADOQuery3.locate('指標(biāo)代碼','TO45',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0)then
begin
ListView7.items[5].subitems[2]:='0';
end else
ListView7.items[5].subitems[2]:=converter(floattostr(numstr1));
//添加GZ134指標(biāo)值
if(ADOQuery3.locate('指標(biāo)代碼','TO48',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0)then
begin
ListView7.items[0].subitems[2]:='0';
end else
ListView7.items[0].subitems[2]:=converter(floattostr(numstr1));
//添加GZ135指標(biāo)值
if(ADOQuery3.locate('指標(biāo)代碼','TO49',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0)then
begin
ListView7.items[1].subitems[2]:='0';
end else
ListView7.items[1].subitems[2]:=converter(floattostr(numstr1));
//添加GZ136指標(biāo)值
if(ADOQuery3.locate('指標(biāo)代碼','TO50',[]))then
numstr1:=ADOQuery3.fieldbyname('本年實(shí)際').asfloat;
if(numstr1=0)then
begin
ListView7.items[2].subitems[2]:='0';
end else
ListView7.items[2].subitems[2]:=converter(floattostr(numstr1));
end;
procedure TBusTradeZHYearRepFrm.BitBtn3Click(Sender: TObject);
begin
BusTradeZHYearRepFrm.close;
end;
procedure TBusTradeZHYearRepFrm.FillDatatoZTable();
var i,j:integer;
begin
ADOQuery2.close;
ADOQuery2.sql.clear;
ADOQuery2.sql.add('select 指標(biāo)代碼,全年實(shí)際 from 公交行業(yè)綜合年報(bào)_z where 統(tǒng)計(jì)年份='+combobox1.text+' order by 指標(biāo)代碼' );
ADOQuery2.open;
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 公交行業(yè)綜合年報(bào)表 where 統(tǒng)計(jì)年份='+ComboBox1.Text);
ADOQuery1.Open;
ADOQuery1.Append;
ADOQuery1.FieldByName('統(tǒng)計(jì)年份').AsInteger:=StrToInt(ComboBox1.Text);
ADOQuery1.Fieldbyname('生成方式').asstring:='生成';
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -