Рефераты. База данный "Хозяйственный учет футбольного клуба"

IF NOT USED([arrival_object])

USE arrival_object IN 0

ENDIF

IF NOT USED([inventar])

USE inventar IN 0

ENDIF

IF NOT USED([invnum_inv])

USE invnum_inv IN 0

ENDIF

IF NOT USED([gate])

USE gate IN 0

ENDIF

IF thisform.container2.txt_height_gate.Value=" "

thisform.container2.txt_height_gate.Value=""

ENDIF

str="(2<>1)"

out_fields="gate.code_obj"

IF thisform.ch_code.Value = 1

out_fields ="gate.code_obj"

ENDIF

IF thisform.ch_date_arrival.Value= 1

out_fields = out_fields +", arrival_object.date"

ENDIF

IF thisform.ch_balance.Value = 1

out_fields = out_fields +", arrival_object.balance"

ENDIF

IF thisform.ch_kol.Value = 1

out_fields = out_fields +", arrival_object.kol"

ENDIF

IF thisform.ch_firm.Value = 1

out_fields = out_fields +", inventar.firm"

ENDIF

IF thisform.ch_model.Value = 1

out_fields = out_fields +", inventar.model"

ENDIF

IF thisform.ch_inv_number.Value = 1

out_fields = out_fields +", invnum_inv.inv_number"

ENDIF

IF thisform.container2.ch_height_gate.Value = 1

out_fields = out_fields +", gate.height_gate"

ENDIF

IF thisform.container2.ch_kind_gate.Value = 1

out_fields = out_fields +", gate.kind"

ENDIF

IF thisform.container2.Ch_shirina_gate.Value = 1

out_fields = out_fields +", gate.shirina"

ENDIF

IF ALLTRIM(thisform.txt_code_obj.Value) == ""

ELSE

str = str +" AND "+

"((ALLTRIM(gate.code_obj))=ALLTRIM(thisform.txt_code_obj.Value))"

ENDIF

IF ALLTRIM(thisform.txt_date_arrival.Value) == ""

ELSE

str = str +" AND "+

"((ALLTRIM(DTOC(arrival_object.date)))=ALLTRIM(thisform.txt_date_arrival.Value))"

ENDIF

IF ALLTRIM(thisform.txt_balance.Value) == ""

ELSE

str = str +" AND "+

"((ALLTRIM(STR(arrival_object.balance)))=ALLTRIM(thisform.txt_balance.Value))"

ENDIF

IF ALLTRIM(thisform.txt_kol.Value) == ""

ELSE

str = str +" AND "+

((ALLTRIM(STR(arrival_object.kol)))=ALLTRIM(thisform.txt_kol.Value))

ENDIF

IF ALLTRIM(thisform.txt_firm.Value )== ""

ELSE

str = str +" AND "+

((ALLTRIM(inventar.firm))=ALLTRIM(thisform.txt_firm.Value))

ENDIF

IF ALLTRIM(thisform.txt_model.Value) == ""

ELSE

str = str +" AND "+

"((ALLTRIM(inventar.model))=ALLTRIM(thisform.txt_model.Value))"

ENDIF

IF ALLTRIM(thisform.container2.txt_kind_gate.Value) == ""

ELSE

str = str +" AND "+

"((ALLTRIM(gate.kind))=ALLTRIM(thisform.container2.txt_kind_gate.Value))"

ENDIF

IF ALLTRIM(thisform.container2.txt_height_gate.Value) == ""

ELSE

str = str +" AND "+ "((ALLTRIM(STR(gate.height_gate)))

=thisform.container2.txt_height_gate.Value)"

ENDIF

IF ALLTRIM(thisform.container2.txt_shirina_gate.Value)== ""

ELSE

str = str +" AND "+ "((ALLTRIM(STR(gate.shirina)))=

=ALLTRIM(thisform.container2.txt_shirina_gate.Value))"

ENDIF

IF out_fields="NULL"

out_fields ="*"

ENDIF

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

IF thisform.ch_code.Value = 1

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

ENDIF

IF thisform.ch_date_arrival.Value= 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Дата поступления"

objExcel.Columns[nstol].ColumnWidth = 18

ENDIF

IF thisform.ch_balance.Value = 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Балансовая стоимость"

objExcel.Columns[nstol].ColumnWidth = 25

ENDIF

IF thisform.ch_kol.Value = 1

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

ENDIF

IF thisform.ch_firm.Value = 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Фирма-производитель"

objExcel.Columns[nstol].ColumnWidth = 25

ENDIF

IF thisform.ch_model.Value = 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Модель"

objExcel.Columns[nstol].ColumnWidth = 10

ENDIF

IF thisform.ch_inv_number.Value = 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Инвентарный номер"

objExcel.Columns[nstol].ColumnWidth = 25

ENDIF

IF thisform.container2.ch_height_gate.Value = 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Высота ворот"

objExcel.Columns[nstol].ColumnWidth = 15

ENDIF

IF thisform.container2.ch_kind_gate.Value = 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Вид ворот"

objExcel.Columns[nstol].ColumnWidth = 20

ENDIF

IF thisform.container2.Ch_shirina_gate.Value = 1

nstol = nstol+1

objExcel.Cells(3,nstol).select

objExcel.Cells(3,nstol).Font.Bold=.T.

objExcel.Cells(3,nstol).Value="Ширина ворот"

objExcel.Columns[nstol].ColumnWidth = 15

ENDIF

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

ENDWITH

Range("A1").Value = "Данные о партиях футбольных ворот"

ENDWITH

ENDIF

stroka=3

stolbic=1

SELECT my_tab

SCAN

stroka=stroka+1

temp_j = stolbic

IF thisform.ch_code.Value = 1

objExcel.Cells(stroka,temp_j ).select

objExcel.Cells(stroka,temp_j ).Value = my_tab.code_obj

temp_j = temp_j +1

ENDIF

IF thisform.ch_date_arrival.Value= 1

objExcel.Cells(stroka,temp_j ).select

objExcel.Cells(stroka,temp_j ).Value = my_tab.date

temp_j = temp_j +1

ENDIF

IF thisform.ch_balance.Value = 1

objExcel.Cells(stroka,temp_j ).select

objExcel.Cells(stroka,temp_j ).Value = my_tab.balance

temp_j = temp_j +1

ENDIF

IF thisform.ch_kol.Value = 1

objExcel.Cells(stroka,temp_j ).select

objExcel.Cells(stroka,temp_j ).Value =my_tab.kol

temp_j = temp_j +1

ENDIF

IF thisform.ch_firm.Value = 1

objExcel.Cells(stroka,temp_j ).select

Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9



2012 © Все права защищены
При использовании материалов активная ссылка на источник обязательна.