IF NOT USED([arrival_object])
USE arrival_object IN 0
ENDIF
IF NOT USED([inventar])
USE inventar IN 0
IF NOT USED([invnum_inv])
USE invnum_inv IN 0
IF NOT USED([gate])
USE gate IN 0
IF thisform.container2.txt_height_gate.Value=" "
thisform.container2.txt_height_gate.Value=""
str="(2<>1)"
out_fields="gate.code_obj"
IF thisform.ch_code.Value = 1
out_fields ="gate.code_obj"
IF thisform.ch_date_arrival.Value= 1
out_fields = out_fields +", arrival_object.date"
IF thisform.ch_balance.Value = 1
out_fields = out_fields +", arrival_object.balance"
IF thisform.ch_kol.Value = 1
out_fields = out_fields +", arrival_object.kol"
IF thisform.ch_firm.Value = 1
out_fields = out_fields +", inventar.firm"
IF thisform.ch_model.Value = 1
out_fields = out_fields +", inventar.model"
IF thisform.ch_inv_number.Value = 1
out_fields = out_fields +", invnum_inv.inv_number"
IF thisform.container2.ch_height_gate.Value = 1
out_fields = out_fields +", gate.height_gate"
IF thisform.container2.ch_kind_gate.Value = 1
out_fields = out_fields +", gate.kind"
IF thisform.container2.Ch_shirina_gate.Value = 1
out_fields = out_fields +", gate.shirina"
IF ALLTRIM(thisform.txt_code_obj.Value) == ""
ELSE
str = str +" AND "+
"((ALLTRIM(gate.code_obj))=ALLTRIM(thisform.txt_code_obj.Value))"
IF ALLTRIM(thisform.txt_date_arrival.Value) == ""
"((ALLTRIM(DTOC(arrival_object.date)))=ALLTRIM(thisform.txt_date_arrival.Value))"
IF ALLTRIM(thisform.txt_balance.Value) == ""
"((ALLTRIM(STR(arrival_object.balance)))=ALLTRIM(thisform.txt_balance.Value))"
IF ALLTRIM(thisform.txt_kol.Value) == ""
((ALLTRIM(STR(arrival_object.kol)))=ALLTRIM(thisform.txt_kol.Value))
IF ALLTRIM(thisform.txt_firm.Value )== ""
((ALLTRIM(inventar.firm))=ALLTRIM(thisform.txt_firm.Value))
IF ALLTRIM(thisform.txt_model.Value) == ""
"((ALLTRIM(inventar.model))=ALLTRIM(thisform.txt_model.Value))"
IF ALLTRIM(thisform.container2.txt_kind_gate.Value) == ""
"((ALLTRIM(gate.kind))=ALLTRIM(thisform.container2.txt_kind_gate.Value))"
IF ALLTRIM(thisform.container2.txt_height_gate.Value) == ""
str = str +" AND "+ "((ALLTRIM(STR(gate.height_gate)))
=thisform.container2.txt_height_gate.Value)"
IF ALLTRIM(thisform.container2.txt_shirina_gate.Value)== ""
str = str +" AND "+ "((ALLTRIM(STR(gate.shirina)))=
=ALLTRIM(thisform.container2.txt_shirina_gate.Value))"
IF out_fields="NULL"
out_fields ="*"
SELECT &out_fields;
FROM(((gate INNER JOIN inventar ON
ALLTRIM(inventar.code_obj)==ALLTRIM(gate.code_obj));
INNER JOIN arrival_object ON
ALLTRIM(arrival_object.code_obj)==ALLTRIM(gate.code_obj));
INNER JOIN invnum_inv ON
ALLTRIM(invnum_inv.code_obj)==ALLTRIM(gate.code_obj));
WHERE &str INTO TABLE My_tab
objExcel=CreateObject("Excel.Application")
objExcel.Visible=.T.
objExcel.Workbooks.add
nstol = 0
nstol = nstol+1
objExcel.Cells(3,nstol).select
objExcel.Cells(3,nstol).Font.Bold=.T.
objExcel.Cells(3,nstol).Value="Код партии"
objExcel.Columns[nstol].ColumnWidth = 12
objExcel.Cells(3,nstol).Value="Дата поступления"
objExcel.Columns[nstol].ColumnWidth = 18
objExcel.Cells(3,nstol).Value="Балансовая стоимость"
objExcel.Columns[nstol].ColumnWidth = 25
objExcel.Cells(3,nstol).Value="Количество"
objExcel.Cells(3,nstol).Value="Фирма-производитель"
objExcel.Cells(3,nstol).Value="Модель"
objExcel.Columns[nstol].ColumnWidth = 10
objExcel.Cells(3,nstol).Value="Инвентарный номер"
objExcel.Cells(3,nstol).Value="Высота ворот"
objExcel.Columns[nstol].ColumnWidth = 15
objExcel.Cells(3,nstol).Value="Вид ворот"
objExcel.Columns[nstol].ColumnWidth = 20
objExcel.Cells(3,nstol).Value="Ширина ворот"
IF nstol>0
tt1 = ""+CHRTRAN(objExcel.Cells(1,1).Address,"$","")
tt2 = ""+CHRTRAN(objExcel.Cells(1,nstol).Address,"$","")
WITH objExcel&&cel
WITH .Range(tt1+":"+tt2)
WITH .Font
Name = "Arial Cyr"
FontStyle = "полужирный"
Size = 14
ENDWITH
HorizontalAlignment = 3
VerticalAlignment = 1
WrapText = .F.
Orientation = 0
AddIndent = .F.
IndentLevel = 0
ShrinkToFit = .F.
MergeCells = .F.
Merge
Range("A1").Value = "Данные о партиях футбольных ворот"
stroka=3
stolbic=1
SELECT my_tab
SCAN
stroka=stroka+1
temp_j = stolbic
objExcel.Cells(stroka,temp_j ).select
objExcel.Cells(stroka,temp_j ).Value = my_tab.code_obj
temp_j = temp_j +1
objExcel.Cells(stroka,temp_j ).Value = my_tab.date
objExcel.Cells(stroka,temp_j ).Value = my_tab.balance
objExcel.Cells(stroka,temp_j ).Value =my_tab.kol
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9