Модуль QuaryName
procedure TForm2.Button1Click
2
Form2.Visible:=False
Form1.Source.DataSet:=Form1.Query
False
27
exit
showmessage('Sorry,not
found your query...')
True
Form1.Query.Fields[0].AsString=''
Form1.Query.Active:=True
Form1.Query.SQL.Add('SELECT
* FROM Table1 WHERE Name_product="'+Edit1.Text+'"')
Form1.Query.SQL.Clear
Form1.Query.Active:=False
2
3
4
5
7
6
8
9
10
3
w.activedocument.saveas(extractfilepath(application.exename)+'Report.docx')
w.displayalerts:=false
w.activedocument.range.insertbefore('Name_product
| Costs | Clear_profit | Sales_volume | Cost_price | Name_company |
Type_activity')
21
16
Form1.Table. Next
w.activedocument.range.insertbefore(#13#10)
True
False
i=1
w.activedocument.range.insertbefore(Form1.Query.Fields[i-1].AsString+'
| ')
i:=Form1.Query.FieldCount
downto 1
not Form1.Query.Eof
27
False
Form1.Table.first
w.Documents.Add
True
w.visible:=true
w:=createoleobject('word.application')
1
checkbox1.Checked
11
12
13
14
15
16
17
21
18
20
19
22
23
24
8
11
27
26
25
Возврат
w:=unassigned
w.quit
2
Модуль Work
procedure TForm1.Button3Click
2
checkbox1.Checked
True
False
31
e:=createoleobject('excel.application')
10
11
9
8
7
6
Form1.Source.DataSet:=Form1.Query
31
exit
showmessage('Sorry,not
found your query...')
Form1.Query.Fields[0].AsString=''
False
True
5
4
3
2
Form1.Query.Active:=True
Form1.Query.SQL.Add('SELECT
* FROM Table1 WHERE Name_product="'+Edit1.Text+'"')
Form1.Query.SQL.Clear
Form1.Query.Active:=False
12
1
3
e.displayalerts:=false
j:=j+1
cells[1,7]:='Type_activity'
22
Form1.Table. Next
not Form1.Query.Eof
i:=Form1.Query.FieldCount
downto 1
w.activedocument.range.insertbefore(Form1.Query.Fields[i-1].AsString+'
| ')
26
e.workbooks.item[1].sheets.item[1].cells[1,7]:='Type_activity'
e.workbooks.item[1].sheets.item[1].cells[1,7]:='Type_activity'
e.workbooks.item[1].sheets.item[1].cells[1,6]:='Name_company'
e.workbooks.item[1].sheets.item[1].cells[1,5]:='Cost_price'
e.workbooks.item[1].sheets.item[1].cells[1,4]:='Sales_volume'
e.workbooks.item[1].sheets.item[1].cells[1,3]:='Clear_profit'
e.workbooks.item[1].sheets.item[1].cells[1,2]:='Costs'
e.workbooks.item[1].sheets.item[1].cells[1,1]:='Name_product'
j:=2
Form1.Table.first
13
14
15
16
17
18
19
20
21
22
23
25
26
24
27
31
30
29
28
8
11
Возврат
e:=unassigned
e.quit
e.workbooks.item[1].saveas(extractfilepath(application.exename)+'Report.xlsx')
2
procedure TForm1.ApplyClick
3
10
9
8
7
6
5
4
2
Возврат
x.CreateRecord
x:=TDataBase.create(edit1.Text,
edit6.Text, edit7.Text, StrToFloat(Edit2.Text),
StrToFloat(Edit3.Text), StrToFloat(Edit5.Text),
StrToInt(Edit4.Text))
x.Free
Apply.Visible:=False
GroupBox4.Visible:=False
GroupBox3.Visible:=True
GroupBox2.Visible:=True
GroupBox1.Visible:=True
3
10
9
8
7
6
5
4
2
Возврат
x.EditRecord
x:=TDataBase.create(edit1.Text,
edit6.Text, edit7.Text, StrToFloat(Edit2.Text),
StrToFloat(Edit3.Text), StrToFloat(Edit5.Text),
StrToInt(Edit4.Text))
x.Free
Apply_.Visible:=False
GroupBox4.Visible:=False
GroupBox3.Visible:=True
GroupBox2.Visible:=True
GroupBox1.Visible:=True
