Автор: Пользователь скрыл имя, 15 Апреля 2012 в 11:09, курсовая работа
В современных экономических условиях деятельность каждого хозяйствующего субъекта является предметом внимания обширного круга участников рыночных отношений, организаций и лиц, заинтересованных в результатах его функционирования. Для обеспечения его эффективного функционирования необходимо экономически грамотно управлять его деятельностью, а также уметь ее анализировать. Принятию всякого решения финансового характера предшествуют аналитические расчеты, поэтому важное значение придается качеству и своевременности таких расчетов.
dm.tb38.Next;
end;
excel.Visible := true;
end;
procedure Tfm38.Button1Click(Sender: TObject);
begin
PageControl1.TabIndex := 1;
end;
procedure Tfm38.
begin
dm.tb38.close;
dm.tb38.SQL.Clear;
dm.tb38.SQL.Add('select * from tb38 where dYear = ' + DBLookupComboboxEh1.Text);
dm.tb38.Open;
end;
procedure Tfm38.BitBtn3Click(Sender: TObject);
var i: integer;
l1: OleVariant;
begin
excel:=CreateOleObject('Excel.
excel.WorkBooks.Open(
l1:=excel.Worksheets['38'];
dm.tb38.First;
for i := 3 to DM.tb38.RecordCount + 2 do
if dm.tb38n.AsBoolean = true then
begin
l1.Cells[i,1].value := dm.tb38naim.AsString;
l1.Cells[i,2].value := dm.tb38plPL.AsFloat;
l1.Cells[i,3].value := dm.tb38valSbor.AsFloat;
l1.Cells[i,4].value := dm.tb38zatr.AsFloat;
dm.tb38.Next;
end;
excel.Visible := true;
end;
end.
unit Unit7;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids, DBGrids, ComObj, DBGridEh, Mask,
DBCtrlsEh, DBLookupEh, ExtCtrls, TeeProcs, TeEngine, Chart, DbChart,
ComCtrls, Series, BubbleCh, Spin, TeeShape;
type
Tfm37 = class(TForm)
BitBtn2: TBitBtn;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
Label1: TLabel;
DBGridEh1: TDBGridEh;
DBLookupComboboxEh1: TDBLookupComboboxEh;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
TabSheet3: TTabSheet;
Button3: TButton;
TabSheet4: TTabSheet;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Label3: TLabel;
Label4: TLabel;
DBGridEh2: TDBGridEh;
Label5: TLabel;
ComboBox1: TComboBox;
DBGridEh3: TDBGridEh;
Label6: TLabel;
Label7: TLabel;
DBGridEh4: TDBGridEh;
DBGridEh5: TDBGridEh;
Label8: TLabel;
TabSheet5: TTabSheet;
Button8: TButton;
DBChart1: TDBChart;
Label9: TLabel;
Button9: TButton;
Panel1: TPanel;
Button10: TButton;
SpinEdit1: TSpinEdit;
Button11: TButton;
Button12: TButton;
Panel2: TPanel;
DBLookupComboboxEh2: TDBLookupComboboxEh;
Button13: TButton;
Button14: TButton;
Series1: TLineSeries;
Series2: TLineSeries;
Series3: TLineSeries;
Series4: TLineSeries;
Series5: TLineSeries;
Series6: TLineSeries;
Series7: TLineSeries;
Button15: TButton;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure DBLookupComboboxEh1Change(
procedure Button9Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure DBLookupComboboxEh2Change(
procedure Button15Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fm37: Tfm37;
implementation
uses uAbout, uDM, Unit2, Unit8, DB;
{$R *.dfm}
procedure Tfm37.BitBtn1Click(Sender: TObject);
var i: integer;
l1, l2: OleVariant;
begin
excel:=CreateOleObject('Excel.
excel.WorkBooks.Open(
l1:=excel.Worksheets['ëèñò1'];
l2:=excel.Worksheets['37'];
l1.visible:= true;
dm.tb37.First;
l2.Cells[1,1].value
:= 'II. Ðåàëèçîâàíî ïðîäóêöèè
for i := 7 to DM.tb37.RecordCount + 6 do
begin
l1.Cells[i,3].value := dm.tb37kol.AsString;
l1.Cells[i,4].value := dm.tb37sebest.AsString;
l1.Cells[i,5].value := dm.tb37vir.AsString;
dm.tb37.Next;
end;
l1.visible := false;
excel.Visible := true;
end;
procedure Tfm37.BitBtn2Click(Sender: TObject);
begin
close;
end;
procedure Tfm37.Button1Click(Sender: TObject);
var i: integer;
begin
dm.tby37.First;
for i:= 1 to dm.tbYear37.RecordCount do dm.tbYear37.Delete;
for i:= 1 to dm.tby37.RecordCount do
begin
dm.tbYear37.Insert;
dm.tbYear37dYear.AsInteger := dm.tby37dyear.AsInteger;
dm.tbYear37tf.AsBoolean := true;
dm.tbYear37.Post;
dm.tby37.Next;
end;
PageControl1.TabIndex := 1;
end;
procedure Tfm37.Button2Click(Sender: TObject);
begin
PageControl1.TabIndex := 2;
end;
procedure Tfm37.Button3Click(Sender: TObject);
var i,j,cb:integer;
begin
/////
dm.tbYCH37.Close;
dm.tbYCH37.Open;
dm.tbNaimCH37.close;
dm.tbNaimCH37.Open;
dm.tbYCH37.First;
for i:=1 to
12 do DBGridEh5.Columns[i].Visible:=
for i:= 1 to dm.tbYCH37.RecordCount do
begin
DBGridEh5.Columns[i].Visible:=
DBGridEh5.Columns[i].Title.
dm.tbYCH37.Next;
end;
dm.tbYCH37.First;
/////
PageControl1.TabIndex := 3;
for i:= 1 to dm.tbTemp37.RecordCount do dm.tbTemp37.Delete;
dm.tbNaimCH37.First;
for i:=1 to dm.tbNaimCH37.RecordCount do
begin
dm.tbTemp37.Insert;
dm.tbTemp37naim.AsString :=dm.tbNaimCH37Naim.AsString;
dm.tbTemp37.post;
dm.tbNaimCH37.Next;
end;
cb:= ComboBox1.ItemIndex+3;
dm.tbYCH37.First;
//////
for i:=1 to dm.tbYCH37.RecordCount do
begin
dm.tb37.close;
dm.tb37.SQL.Clear;
dm.tb37.SQL.Add('select * from tb37 where dYear = ' + dm.tbYCH37dYear.AsString);
dm.tb37.Open;
/////
dm.tb37.First;
dm.tbTemp37.First;
for j:=1 to dm.tb37.RecordCount do
begin
dm.tbTemp37.edit;
dm.tbTemp37.Fields[i+1].
dm.tbTemp37Kod.AsInteger := dm.tb37kod.AsInteger;
dm.tbTemp37.Post;
dm.tb37.Next;
dm.tbTemp37.next;
end;
dm.tbYCH37.next;
end;
//////
end;
procedure Tfm37.Button4Click(Sender: TObject);
var i: integer;
begin
dm.tbYCH37.First;
for i:=1 to
7 do DBChart1.Series[i-1].
for i:= 1 to dm.tbYCH37.RecordCount do
begin
DBChart1.Series[i-1].
DBChart1.Series[i-1].Title:=
dm.tbYCH37.Next;
end;
PageControl1.TabIndex :=4;
end;
procedure Tfm37.Button5Click(Sender: TObject);
begin
PageControl1.TabIndex := 2;
end;
procedure Tfm37.Button7Click(Sender: TObject);
begin
PageControl1.TabIndex := 1;
end;
procedure Tfm37.Button6Click(Sender: TObject);
begin
PageControl1.TabIndex := 0;
end;
procedure Tfm37.
begin
dm.tb37.close;
dm.tb37.SQL.Clear;
dm.tb37.SQL.Add('select * from tb37 where dYear = ' + DBLookupComboboxEh1.Text);
dm.tb37.Open;
//Caption := DBLookupComboboxEh1.Value;
end;
procedure Tfm37.Button9Click(Sender: TObject);
begin
panel1.Visible:= true;
end;
procedure Tfm37.Button12Click(Sender: TObject);
begin
panel1.Visible:= False;
end;
procedure Tfm37.Button11Click(Sender: TObject);
var i: integer;
begin
dm.tbNaim37.First;
for i:= 1 to dm.tbNaim37.RecordCount do
begin
dm.tb37.Insert;
dm.tb37naim.AsString := dm.tbNaim37Naim.AsString;
dm.tb37kod.AsInteger := dm.tbNaim37kod.AsInteger;
dm.tb37dYear.AsInteger
:= SpinEdit1.Value;
dm.tb37.Post;
dm.tbNaim37.Next;
end;
dm.tby37.Close;
dm.tby37.Open;
panel1.Visible:= False;
end;
procedure Tfm37.Button10Click(Sender: TObject);
begin
panel2.Visible:= True;
end;
procedure Tfm37.Button14Click(Sender: TObject);
begin
panel2.Visible:= False;
end;
procedure Tfm37.Button13Click(Sender: TObject);
var i: integer;
begin
if DBLookupComboboxEh2.Value>0 then
for i := 1 to dm.tb37.RecordCount
do dm.tb37.Delete;
dm.tby37.Close;
dm.tby37.Open;
panel2.Visible:= False;
end;
procedure Tfm37.
begin
dm.tb37.close;