//对数据进行统计 procedure TSumAccountsumtable; var counti:integer; valvalvalvalvalval:double; begin //计算平衡表中的记录数 count:=datasourceDataSetRecordCount; //统计信息判断是否试算平衡 val:=; val:=; val:=; val:=; val:=; val:=; while not datasourceDataSetEof do begin val:=strtofloat(dbgridFields[]Text)+val; val:=strtofloat(dbgridFields[]Text)+val; val:=strtofloat(dbgridFields[]Text)+val; val:=strtofloat(dbgridFields[]Text)+val; val:=strtofloat(dbgridFields[]Text)+val; val:=strtofloat(dbgridFields[]Text)+val; datasourceDataSetNext; end; //显示统计结果 stringgridCells[]:=是否平衡; stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); stringgridCells[]:=floattostr(val); if (val<>val)or(val<>val)or(val<>val) then begin stringgridCells[]:=不平衡; stringgridFontColor:=clred; end else stringgridCells[]:=平衡; end; // //以下是帐户设置窗体的代码 implementation {$R *dfm} uses sumaccountform; procedure TAccountSettingFormClose(Sender: TObject; var Action: TCloseAction); begin action:=cafree; end; //设置表格 procedure TAccountSettingDataSourceDataChange(Sender: TObject; Field: TField); begin //设置帐簿初始化表列宽 dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; end; procedure TAccountSettingDataSourceDataChange(Sender: TObjectField: TField); begin //设置系统参数表列宽 dbgridColumns[]Width:=; dbgridColumns[]Width:=; dbgridColumns[]Width:=; end; //初始化帐户 procedure TAccountSettingBitBtnClick(Sender: TObject); begin //执行储存过程初始化帐户 adocommandCommandText:=EXEC sf_初始化帐户; if applicationMessageBox(是否清除原帐簿信息并初始化新帐簿?确认 MB_OKCANCEL)=IDOK then adocommandExecute; //刷新数据表 adotableActive:=false; adotableActive:=true; adotableActive:=false; adotableActive:=true; end; [] [] [] [] |