📄 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 指标代码,本年实际 from 公交行业城市规模指标表_z where 城市代码='
+''''+'022'+''''+' and 统计年份='+combobox1.text+' order by 指标代码';
ADOQuery3.Close;
ADOQuery3.SQL.Clear;
ADOQuery3.SQL.Add(sqlstr3);
ADOQuery3.Open;
//添加GZ056指标值
if(ADOQuery3.Locate('指标代码','TO02',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').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指标值
if(ADOQuery3.Locate('指标代码','TO05',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').asfloat;
if(ADOQuery3.locate('指标代码','TO46',[]))then
numstr2:=ADOQuery3.fieldbyname('本年实际').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指标值
if(ADOQuery3.Locate('指标代码','T008',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').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指标值
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指标值
if(ADOQuery3.locate('指标代码','TO47',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').asfloat;
if(numstr1=0)then
begin
ListView5.items[12].subitems[2]:='0';
end else
ListView5.items[12].subitems[2]:=ConverterPercent(floattostr(numstr1));
//添加GZ137指标值
if(ADOQuery3.locate('指标代码','TO43',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').asfloat;
if(numstr1=0)then
begin
ListView7.items[3].subitems[2]:='0';
end else
ListView7.items[3].subitems[2]:=Converter(floattostr(numstr1));
//添加GZ138指标值
if(ADOQuery3.locate('指标代码','TO44',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').asfloat;
if(numstr1=0)then
begin
ListView7.items[4].subitems[2]:='0';
end else
ListView7.items[4].subitems[2]:=converter(floattostr(numstr1));
//添加GZ139指标值
if(ADOQuery3.locate('指标代码','TO45',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').asfloat;
if(numstr1=0)then
begin
ListView7.items[5].subitems[2]:='0';
end else
ListView7.items[5].subitems[2]:=converter(floattostr(numstr1));
//添加GZ134指标值
if(ADOQuery3.locate('指标代码','TO48',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').asfloat;
if(numstr1=0)then
begin
ListView7.items[0].subitems[2]:='0';
end else
ListView7.items[0].subitems[2]:=converter(floattostr(numstr1));
//添加GZ135指标值
if(ADOQuery3.locate('指标代码','TO49',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').asfloat;
if(numstr1=0)then
begin
ListView7.items[1].subitems[2]:='0';
end else
ListView7.items[1].subitems[2]:=converter(floattostr(numstr1));
//添加GZ136指标值
if(ADOQuery3.locate('指标代码','TO50',[]))then
numstr1:=ADOQuery3.fieldbyname('本年实际').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 指标代码,全年实际 from 公交行业综合年报_z where 统计年份='+combobox1.text+' order by 指标代码' );
ADOQuery2.open;
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from 公交行业综合年报表 where 统计年份='+ComboBox1.Text);
ADOQuery1.Open;
ADOQuery1.Append;
ADOQuery1.FieldByName('统计年份').AsInteger:=StrToInt(ComboBox1.Text);
ADOQuery1.Fieldbyname('生成方式').asstring:='生成';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -