Разработка модуля экспорта отчетной документации

Накопление, обработка и распространение информации. Программная и техническая архитектура информационной системы предприятия. Анализ системы обеспечения информационной безопасности и защиты информации. Реализация модуля экспорта отчетной документации.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык русский
Дата добавления 25.06.2013
Размер файла 9,5 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

Select Prixn

Set Filter To !Empty(Pech)

Go Top

#Include xl97cons.h

#Define True .T.

#Define False .F.

#Define RPT_FONTNAME "Comic Sans MS"

#Define RPT_FONSIZE 10

#DEFINE xlCenter -4108

Kol_n = This.Parent.Kol_list.Value

Alfavit = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Local lcOldError, lcRange, lnSheets, lnCounter

Public loExcel

lcOldError = On("Error")

On Error loExcel = .NULL.

loExcel = GetObject(, "Excel.Application")

On Error &lcOldError

If IsNull(loExcel)

loExcel = CreateObject("Excel.Application")

Endif

loExcel.Visible = .T.

With loExcel

.WindowState = 2 && минимизировать

.ScreenUpdating = False

.WorkBooks.Add

.DisplayAlerts = False

lnSheets = .Sheets.Count

For lnCounter = 1 To lnSheets - 1

.Sheets(1).Delete

Endfor

With .Sheets(1)

.Select

.Name = "Ценники"

Endwith

.ActiveWindow.DisplayGridlines = True

.Cells.Select

With .Selection.Font

.Name = "Arial Narrow"

.FontStyle = "обычный"

.Size = 10

Endwith

.Selection.ColumnWidth = This.Parent.lenght.Value

.ActiveWindow.Zoom = 85

With .Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlCenter

Endwith

With .ActiveSheet.PageSetup

.LeftMargin = 0

.RightMargin = 0

.PrintGridlines = True

EndWith

I = 1

Do While !Eof()

For J = 1 To Kol_n

.Cells(I, J).Value = ThisForm.Pokup

.Cells(I, J).Select

With .Selection.Font

.Name = "Arial Cyr"

.Size = 6

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.ColorIndex = xlAutomatic

EndWith

.Cells(I+1, J).Value = "Накл. "+Str(Docnum,5)+" от "+Dtoc(Inpdate)

.Cells(I+2, J).Value = Namesp.Group_name

.Cells(I+3, J).Value = Namesp.Name

.Cells(I+4, J).Value = Alltr(Str(Floor(Costnalog),10))+"р."+;

Right("00"+Alltr(Str((Costnalog - Int(Costnalog))*100,2)),2)+"к."

.Cells(I+4, J).Select

With .Selection.Font

.Name = "Arial Cyr"

.Size = 20

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.ColorIndex = xlAutomatic

.Bold = True

EndWith

.Range(.Cells(I, J),.Cells(I+5, J)).Select

.Selection.Borders(xlDiagonalDown).LineStyle = xlNone

.Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With .Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

With .Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

With .Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

With .Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone

Skip

If Eof()

Exit

Endif

Endfor

I = I + 6

EndDo

.WindowState = 1 && максимиз

.ScreenUpdating = True

Endwith

loExcel.Visible = .T.

Close Databases

return

ENDPROC

PROCEDURE text1.Click

Select Prixns

replace Pech With Iif(Pech='*',' ','*')

KEYBOARD '{TAB}'

ENDPROC

PROCEDURE tscombut3.Click

ThisForm.Pageframe1.Page1.Tsgrid1.RecordSource=""

ThisForm.Pageframe1.Page2.grdList.RecordSource=""

Local Num_skl

Num_skl = Str(This.Parent.Sklad.Value)

Select Firma

Locate For Del = 0 AND AAA1 = This.Parent.Sklad.Value

ThisForm.Pokup = Alltrim(Iif(Found(),Firma.Namef," "))

If !Found()

=MessageBox('Нет своей фирмы для данного склада!',48,'Измените настройки программы')

Return .F.

Else

ThisForm.slf_firm = Recno()

Endif

ThisForm.Pr_prixn = This.Parent.OptionGroup1.Value = 1

If ThisForm.Pr_prixn

Select " " As Pech, Docnum, Inpdate, Sourcer As Client, Costnalog, 0 As Dovnum, {} As Dovdate, " " As Fam;

From Naklprs Where Imp_p = This.Parent.Sklad.Value Into Dbf Prixns Order by Inpdate, Docnum

Set Relation To

Set Relation To Client Into Firma

Go Bott

With ThisForm.pageframe1.Page1.Tsgrid1

.RecordSource="Prixns" &&"Naklprs"

.RecordSourceType=1

.Visible=.T.

.Column1.ControlSource="Prixns.Docnum"

.Column2.ControlSource="Prixns.InpDate"

.Column3.ControlSource="Firma.Namef"

.Column4.ControlSource="Prixns.Costnalog"

.Column5.ControlSource="Prixns.Pech"

EndWith

ThisForm.Pageframe1.Page1.Tsgrid1.Refresh

Select " " As Pech, Tcode As Group, Name, qwantity, Costnalog, Cost, Num_skl As Sklad, Docnum, Inpdate,;

Sourcer, Ed From Naklpr Where Imp_p = This.Parent.Sklad.Value Into Dbf Prixn

Select Prixn

Set Relation To Name Into Namesp, Ed Into Ed

With ThisForm.pageframe1.Page2.grdList

.RecordSource="Prixn"

.RecordSourceType=1

.Visible=.T.

.Column1.ControlSource="Prixn.Pech"

.Column1.Width=0

.Column2.ControlSource="Namesp.Group_name"

.Column3.ControlSource="Namesp.Name"

.Column4.ControlSource="Prixn.Qwantity"

.Column5.ControlSource="Prixn.Costnalog"

.Column6.ControlSource="Prixn.Sklad"

.Column7.ControlSource="Prixn.Docnum"

.Column8.ControlSource="Prixn.Inpdate"

EndWith

Else

Select " " As Pech, number As Docnum, Date As Inpdate, Client, Sum, Dovnum, Dovdate, Familyname As Fam;

From Naklout Where Imp_p = This.Parent.Sklad.Value Into Dbf Prixns Order by Date, number

Set Relation To

Set Relation To Client Into Firma

Go Bott

With ThisForm.pageframe1.Page1.Tsgrid1

.RecordSource="Prixns" &&"Naklout"

.RecordSourceType=1

.Visible=.T.

.Column1.ControlSource="Prixns.Docnum"

.Column2.ControlSource="Prixns.Inpdate"

.Column3.ControlSource="Firma.Namef"

.Column4.ControlSource="Prixns.Sum"

.Column5.ControlSource="Prixns.Pech"

EndWith

ThisForm.Pageframe1.Page1.Tsgrid1.Refresh

Select " " As Pech, Group, Name, qwantity, Costnalog, Cost, Num_skl As Sklad, number As Docnum, date As Inpdate,;

0 As Sourcer, Ed From Nakloutt Where Imp_p = This.Parent.Sklad.Value Into Dbf Prixn

Select Prixn

Set Relation To Name Into Namesp, Ed Into Ed

With ThisForm.pageframe1.Page2.grdList

.RecordSource="Prixn"

.RecordSourceType=1

.Visible=.T.

.Column1.ControlSource="Prixn.Pech"

.Column1.Width=0

.Column2.ControlSource="Namesp.Group_name"

.Column3.ControlSource="Namesp.Name"

.Column4.ControlSource="Prixn.Qwantity"

.Column5.ControlSource="Prixn.Costnalog"

.Column6.ControlSource="Prixn.Sklad"

.Column7.ControlSource="Prixn.Docnum"

.Column8.ControlSource="Prixn.Inpdate"

EndWith

Endif

ENDPROC

PROCEDURE optiongroup1.Init

Local C_Prog

C_Prog = Sys(16,0)

If Atc('s.exe',C_prog)=0

This.Visible=.T.

Endif

Dodefault()

ENDPROC

PROCEDURE optiongroup1.Option1.Click

This.ForeColor = Rgb(0,0,250)

This.Parent.Option2.ForeColor = Rgb(0,0,0)

ENDPROC

PROCEDURE optiongroup1.Option2.Click

This.ForeColor = Rgb(0,0,250)

This.Parent.Option1.ForeColor = Rgb(0,0,0)

ENDPROC

PROCEDURE tscommandbutton1.Click

Local lcPath, lcPush, lcNaklpr, lcNaklprs, lcNmbr, lcNaklosp, lcNamesp

Restore From Type_mag Addi

Len_nds = Alen(Stat_nds,1)

Select Prixns

Set Filter To !Empty(Pech)

Go Top

If Eof()

Wait Windows "Ничего не выбрали"

Return

Endif

*!* Old_select=select()

*!* If !used("BANKSP")

*!* sele 0

*!* use banksp order 0

*!* endif

m.cFile = .F.

NNN = 0

pathToMain=SYS(5)+SYS(2003)

SET PROCEDURE tscommandbutton1.TO 'o_report.prg' ADDI

public array pp(50)

Store " " To pp

select firma

Store Space(10) To P_okohx,P_okpo,Pokadress,Pokname,Pokbank,P_inn

If Thisform.Slf_firm = 0

Wait Windows "Нет своей фирмы для данного склада"

Return

Endif

set relation to town into townsp, bank into banksp

Go Thisform.Slf_firm

pokname=Allt(namef) + ", ИНН " + Allt(INN) + ", " + Str(TownCode,6) + ", " + Trim(townsp.town) + ', ' + Trim(Adress)

P_okohx='КПП ' + Trim(OKOHX) + ", БИК " + Trim(banksp.mfo) + ", Р/с " + Bill + " в " + Trim(banksp.bankname) +;

", К/с " + Korsch

P_okpo=OKPO

If Thisform.Pr_prixn

Store pokname To pp(5), pp(8)

Store P_okohx To pp(50), pp(49)

Else

Store pokname To pp(1), pp(31)

Store P_okohx To pp(32), pp(2)

pp(7) = P_okpo

Endif

*!* Pokadress=Trim(townsp->town)+', '+Adress

*!* Pokbank=bill+' Банк '+Rtrim(Substr(banksp->bankname,1,30))+' БИК '+Ltrim(banksp->mfo)

*!* P_inn=INN

*!* go Con_firma

*!* S_okohx=OKOHX

*!* S_okpo=OKPO

*!* S_inn=INN

*!* go firma.bank in banksp

*!* slfbill=bill

*!* s_name=bank

*!* sele banksp

*!* goto s_name

*!* slfbank=banksp->bankname

*!* slfmfo=banksp->mfo

Create Cursor Exel_otc (A1 C(4), A2 C(100), A3 C(1), A4 C(6), A5 C(5), A6 C(7), A7 C(7), A8 C(2),;

A9 C(5), A10 N(10), A11 N(12,2), A12 N(12,2), A13 N(4,1), A14 N(12,2), A15 N(12,2))

Select Prixns

Go Top

Scan

Numnak = Str(Docnum,5)

Datnak = Inpdate

pp[21] = Iif(Dovnum > 0, Str(Dovnum,5), " ")

pp[22] = Dtoc(nvl(dovdate,{}))

*!* pp[23] = nvl(Fam,'')

select firma

Slfname=Allt(namef) + ", ИНН " + Allt(INN) + ", " + Str(TownCode,6) + ", " + Trim(townsp.town)+', '+Trim(Adress)

S_okohx='КПП ' + Trim(OKOHX) + ", БИК " + Trim(banksp.mfo) + ", Р/с " + Bill + " в " + Trim(banksp.bankname) +;

", К/с " + Korsch

S_okpo=OKPO

If Thisform.Pr_prixn

Store Slfname To pp(1), pp(31)

Store S_okohx To pp(32), pp(2)

pp(7) = S_okpo

Else

Store Slfname To pp(5), pp(8)

Store S_okohx To pp(50), pp(49)

Endif

Select Exel_otc

Zap

II = Len_nds

_Nds = Stat_nds(II, 2)

Do While II > 0 AND Datnak < Stat_nds(II, 1)

_Nds = Stat_nds(II, 2)

II = II - 1

Enddo

*!* Select Group, Name, Sum(qwantity) As qwantity, Costnalog, Cost, Sklad, Docnum, Inpdate,;

*!* Sourcer, Ed From Prixn Into Cursor _Prixn Where Inpdate=Prixns.Inpdate AND Docnum=Prixns.Docnum AND;

*!* Sourcer=Prixns.Client Group by Group, Name, Costnalog, Cost, Sklad, Docnum, Inpdate, Sourcer, Ed

If ThisForm.PageFrame1.Page1.OptionGroup1.Value = 1

Select Group, Name, Sum(qwantity) As qwantity, Costnalog, Cost, Sklad, Docnum, Inpdate,;

Sourcer, Ed From Prixn Into Cursor _Prixn Where Inpdate=Prixns.Inpdate AND Docnum=Prixns.Docnum AND;

Sourcer=Prixns.Client Group by Group, Name, Costnalog, Cost, Sklad, Docnum, Inpdate, Sourcer, Ed

Else

Select Group, Name, Sum(qwantity) As qwantity, Costnalog, Cost, Sklad, Docnum, Inpdate,;

Sourcer, Ed From Prixn Into Cursor _Prixn Where Inpdate=Prixns.Inpdate AND Docnum=Prixns.Docnum;

Group by Group, Name, Costnalog, Cost, Sklad, Docnum, Inpdate, Sourcer, Ed

Endif

Select _Prixn

Set Relation To Name Into Namesp, Ed Into Ed

Go Top

Store 0 To rezsum, II, _Qwan

Scan

Scatter Memvar

II = II + 1

sumsn=Round(m.Qwantity*m.Costnalog, 4)

sumbn=Round(Sumsn/(1+_Nds/100),4)

Cen=IIF(m.Qwantity >0, Round(Sumbn/m.Qwantity,2),0)

_Qwan = _Qwan + m.Qwantity

rezsum = rezsum + sumsn

Insert Into Exel_otc (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) ;

Values (Str(II,4), Alltr(Namesp.Group_Name) + " " + Alltr(Namesp.Name), " ", Ed.Messed,;

Iif(m.ed=1,"796"," "), " ", " ", " ", " ", m.Qwantity, Cen, sumbn, _Nds, sumsn - sumbn, sumsn)

Endscan

rezsum = Round(rezsum, 2)

It_bn = Round(rezsum/(1+_Nds/100),2)

It_nd = rezsum - It_bn

If .F.

SELECT otch1

pp[31]=nvl(_ott_t,"")

pp[1]=nvl(ott_t,"")

pp[32]=nvl(_bil_t,"")

pp[2]=nvl(bil_t,"")

pp[3]=nvl(okpo1,"")

pp[4]=Space(67)

pp[5]=nvl(ott2_td,"")

Store nvl(bil2_t,"") To pp[50], pp[49]

pp[6]=nvl(ott_td,"")

pp[7]=nvl(okpo2,"")

pp[8]=nvl(ott2_t1,"")

pp[9]=nvl(osnovan,"")

Endif

Store _Qwan To pp[11], pp[15]

Store It_bn To pp[12], pp[16]

Store It_nd To pp[13], pp[17]

Store rezsum To pp[14], pp[18]

Kol_n = Anipp(II)

pp[20]=nvl(Anip0(rezsum),'')

pp[19]="и содержит "+alltr(Kol_n)+" порядковых номеров записей"

pp[10]="ТОВАРНАЯ НАКЛАДНАЯ № "+alltr(nvl(numnak,""))+" от "+dtoc(datnak)

pp[24]="М.П. "+nvl(dtoc(datnak),'')+" года"

STORE " " TO _doldir, _dolglb, _dolotp, _podpdir, _podpglb, _podpotp, _spdir, _spglb, _spotp

SELECT ALLTRIM(NVL(a1,SPACE(4))) as a1, ALLTRIM(NVL(a2,SPACE(100))) as a2, "" as qq, "-" as a3, ;

ALLTRIM(NVL(a4,SPACE(80))) as a4, ALLTRIM(NVL(a5,SPACE(30))) as a5, "-" as a6, "-" as a7,;

"-" as a8, "-" as a9, a10, a11, a12, a13, a14, a15 FROM exel_otc INTO CURSOR excel_otc1

sele excel_otc1

go top

NNN = NNN + 1

Name_o = Allt(Str(NNN,3))+'.xls'

fl_=addbs(pathToMain)+'temp\Товарная накладная' + Name_o

sh_=addbs(pathToMain)+'excel_shap\ExTovarNakl.xls'

m.oEReport=CREATEOBJECT('o_report',fl_,sh_,,,.T.)

IF TYPE('oEReport')='O'

oEReport.destination=m.cFile

oEReport.NoShowReport=.t.

oEReport.make_report()

m.cFile=Iif(Empty(m.cFile),oEReport.fullname,m.cFile)

*!* WITH oEReport

*!* .auto_fit(1)

*!* .make_report()

*!* ENDWITH

ENDIF

Select Prixns

C_recn = Recno()

Endscan

oEReport.open_file(m.cFile)

Replace All Pech With " "

Set Filter To

Use In _Prixn

Select Prixn

Set Filter To

Select Prixns

Go C_recn

RELEASE goOOoDesktop, goOOoConfigProvider

RELEASE oDesktop, cURL, aFileProperties, oDoc, oSheet, lcOOoVesion, oCalcCtrl

*!* SELECT Otch1

*!* GO TOP

Return

m.cFile = .F.

Name_f = Sys(5)+Sys(2003)+'\Temp\'

NNN = 0

Do While !Eof()

NNN = NNN + 1

Name_o = 'Realiz'+Allt(Str(NNN,3))+'.ods'

oEReport=createo('o_report', Name_F+Name_o, 'Excel_Shap\Pech_real.ods',,,.t.)

if type('oEReport')='O'

Endif

Select Itog1

Store "" To Zag_per, Zag_opl, Zag_kom

Store "" To Mas_v1, Mas_v2, Mas_v3, Mas_v4, Mas_v5, Mas_v6, Mas_v7, Mas_v8, Mas_v9,;

Mas_t1, Mas_t2, Mas_t3, Mas_t4, Mas_t5, Mas_t6, Mas_t7, Mas_t8, Mas_t9,;

Mas_o1, Mas_o2, Mas_o3, Mas_o4, Mas_o5, Mas_o6, Mas_o7, Mas_o8, Mas_o9,;

Mas_k1, Mas_k2, Mas_k3, Mas_k4, Mas_k5, Mas_k6, Mas_k7, Mas_k8, Mas_k9

Enddo

If Used("Otch2")

Use in Otch2

Endif

ThisForm.lSetErrorOff = .F.

return

#define ooCellInsertModeNONE 0 && com.sun.star.sheet.CellInsertMode NONE

#define ooCellInsertModeDOWN 1 && com.sun.star.sheet.CellInsertMode DOWN

#define ooCellInsertModeRIGHT 2 && com.sun.star.sheet.CellInsertMode RIGHT

#define ooCellInsertModeROWS 3 && com.sun.star.sheet.CellInsertMode ROWS

#define ooCellInsertModeCOLUMNS 4 && com.sun.star.sheet.CellInsertMode COLUMNS

#define ooCellDeleteModeNONE 0 && com.sun.star.sheet.CellDeleteMode.NONE

#define ooCellDeleteModeUP 1 && com.sun.star.sheet.CellDeleteMode.UP

#define ooCellDeleteModeLEFT 2 && com.sun.star.sheet.CellDeleteMode.LEFT

#define ooCellDeleteModeROWS 3 && com.sun.star.sheet.CellDeleteMode.ROWS

#define ooCellDeleteModeCOLUMNS 4 && com.sun.star.sheet.CellDeleteMode.COLUMNS

#define ooCellHoriJustifyLEFT 1 && com.sun.star.table.CellHoriJustify LEFT

#define ooCellHoriJustifyCENTER 2 && com.sun.star.table.CellHoriJustify CENTER

#define ooCellHoriJustifyRIGHT 3 && com.sun.star.table.CellHoriJustify RIGHT

#define ooDocumentZoomTypeOPTIMAL 0 && com.sun.star.view.DocumentZoomType OPTIMAL

#define ooDocumentZoomTypePAGE_WIDTH 1 && com.sun.star.view.DocumentZoomType PAGE_WIDTH

#define ooDocumentZoomTypeENTIRE_PAGE 2 && com.sun.star.view.DocumentZoomType ENTIRE_PAGE

#define ooDocumentZoomTypeBY_VALUE 3 && com.sun.star.view.DocumentZoomType BY_VALUE

#define ooDocumentZoomTypePAGE_WIDTH_EXACT 4 && com.sun.star.view.DocumentZoomType PAGE_WIDTH_EXACT

#define ooPosSizeX 1 && com.sun.star.awt.PosSize.X flags the x-coordinate.

#define ooPosSizeY 2 && com.sun.star.awt.PosSize.Y flags the y-coordinate.

#define ooPosSizeWIDTH 4 && com.sun.star.awt.PosSize.WIDTH flags the width.

#define ooPosSizeHEIGHT 8 && com.sun.star.awt.PosSize.HEIGHT flags the height.

#define ooPosSizePOS 3 && com.sun.star.awt.PosSize.POS flags the x- and y-coordinate.

#define ooPosSizeSIZE 12 && com.sun.star.awt.PosSize.SIZE flags the width and height.

#define ooPosSizePOSSIZE 15 && com.sun.star.awt.PosSize.POSSIZE flags the x- and y-coordinate, width and height.

#define ooWindowClassTOP 0 && com.sun.star.awt.WindowClass.TOP specifies a top level window on the desktop. It is also a container.

#define ooWindowClassMODALTOP 1 && com.sun.star.awt.WindowClass.MODALTOP is a modal top level window on the desktop. It is also a container.

#define ooWindowClassCONTAINER 2 && com.sun.star.awt.WindowClass.CONTAINER is a container that may contain other components. It is not a top window.

#define ooWindowClassSIMPLE 3 && com.sun.star.awt.WindowClass.SIMPLE is the simplest window. It can be a container.

#define ooWindowAttributeSHOW 1 && com.sun.star.awt.WindowAttribute.SHOW specifies that the window is initially visible.

#define ooWindowAttributeFULLSIZE 2 && com.sun.star.awt.WindowAttribute.FULLSIZE specifies that the window fills the complete desktop area.

#define ooWindowAttributeOPTIMUMSIZE 4 && com.sun.star.awt.WindowAttribute.OPTIMUMSIZE specifies that the window is optimum size.

#define ooWindowAttributeMINSIZE 8 && com.sun.star.awt.WindowAttribute.MINSIZE specifies that the window is minimum size.

#define ooWindowAttributeBORDER 16 && com.sun.star.awt.WindowAttribute.BORDER specifies that the window has visible borders.

#define ooWindowAttributeSIZEABLE 32 && com.sun.star.awt.WindowAttribute.SIZEABLE specifies that the size of the window can be changed by the user.

#define ooWindowAttributeMOVEABLE 64 && com.sun.star.awt.WindowAttribute.MOVEABLE specifies that the window can be moved by the user.

#define ooWindowAttributeCLOSEABLE 128 && com.sun.star.awt.WindowAttribute.CLOSEABLE specifies that the window can be closed by the user.

#define ooWindowAttributeSYSTEMDEPENDENT 256 && com.sun.star.awt.WindowAttribute.SYSTEMDEPENDENT [ DEPRECATED ] specifies that the window should support the XSystemDependentWindowPeer interface.

#define ooSystemPointerARROW 0 && com.sun.star.awt.SystemPointer.ARROW specifies the normal arrow-like mouse pointer

#define ooSystemPointerINVISIBLE 1 && com.sun.star.awt.SystemPointer.INVISIBLE specifies an invisible mouse pointer

#define ooSystemPointerWAIT 2 && com.sun.star.awt.SystemPointer.WAIT specifies a waiting symbol as a mouse pointer (for example hourglas)

#define ooSystemPointerTEXT 3

#define ooSystemPointerHELP 4

#define ooSystemPointerCROSS 5

#define ooSystemPointerMOVE 6

#define ooSystemPointerNSIZE 7

#define ooSystemPointerSSIZE 8

#define ooSystemPointerWSIZE 9

#define ooSystemPointerESIZE 10

#define ooSystemPointerNWSIZE 11

#define ooSystemPointerNESIZE 12

#define ooSystemPointerSWSIZE 13

#define ooSystemPointerSESIZE 14

#define ooSystemPointerWINDOW_NSIZE 15

#define ooSystemPointerWINDOW_SSIZE 16

#define ooSystemPointerWINDOW_WSIZE 17

#define ooSystemPointerWINDOW_ESIZE 18

#define ooSystemPointerWINDOW_NWSIZE 19

#define ooSystemPointerWINDOW_NESIZE 20

#define ooSystemPointerWINDOW_SWSIZE 21

#define ooSystemPointerWINDOW_SESIZE 22

#define ooSystemPointerHSPLIT 23

#define ooSystemPointerVSPLIT 24

#define ooSystemPointerHSIZEBAR 25

#define ooSystemPointerVSIZEBAR 26

#define ooSystemPointerHAND 27

#define ooSystemPointerREFHAND 28

#define ooSystemPointerPEN 29

#define ooSystemPointerMAGNIFY 30

#define ooSystemPointerFILL 31

#define ooSystemPointerROTATE 32

#define ooSystemPointerHSHEAR 33

#define ooSystemPointerVSHEAR 34

#define ooSystemPointerMIRROR 35

#define ooSystemPointerCROOK 36

#define ooSystemPointerCROP 37

#define ooSystemPointerMOVEPOINT 38

#define ooSystemPointerMOVEBEZIERWEIGHT 39

#define ooSystemPointerMOVEDATA 40

#define ooSystemPointerCOPYDATA 41

#define ooSystemPointerLINKDATA 42

#define ooSystemPointerMOVEDATALINK 43

#define ooSystemPointerCOPYDATALINK 44

#define ooSystemPointerMOVEFILE 45

#define ooSystemPointerCOPYFILE 46

#define ooSystemPointerLINKFILE 47

#define ooSystemPointerMOVEFILELINK 48

#define ooSystemPointerCOPYFILELINK 49

#define ooSystemPointerMOVEFILES 50

#define ooSystemPointerCOPYFILES 51

#define ooSystemPointerNOTALLOWED 52

#define ooSystemPointerDRAW_LINE 53

#define ooSystemPointerDRAW_RECT 54

#define ooSystemPointerDRAW_POLYGON 55

#define ooSystemPointerDRAW_BEZIER 56

#define ooSystemPointerDRAW_ARC 57

#define ooSystemPointerDRAW_PIE 58

#define ooSystemPointerDRAW_CIRCLECUT 59

#define ooSystemPointerDRAW_ELLIPSE 60

#define ooSystemPointerDRAW_FREEHAND 61

#define ooSystemPointerDRAW_CONNECT 62

#define ooSystemPointerDRAW_TEXT 63

#define ooSystemPointerDRAW_CAPTION 64

#define ooSystemPointerCHART 65

#define ooSystemPointerDETECTIVE 66

#define ooSystemPointerPIVOT_COL 67

#define ooSystemPointerPIVOT_ROW 68

#define ooSystemPointerPIVOT_FIELD 69

#define ooSystemPointerCHAIN 70

#define ooSystemPointerCHAIN_NOTALLOWED 71

#define ooNumberFormatALL 0 && selects all number formats.

#define ooNumberFormatDEFINED 1 && selects only user-defined number formats.

#define ooNumberFormatDATE 2 && selects date formats. (com.sun.star.util.NumberFormat.DATE)

#define ooNumberFormatTIME 4 && selects time formats.

#define ooNumberFormatCURRENCY 8 && selects currency formats.

#define ooNumberFormatNUMBER 16 && selects decimal number formats.

#define ooNumberFormatSCIENTIFIC 32 && selects scientific number formats.

#define ooNumberFormatFRACTION 64 && selects number formats for fractions.

#define ooNumberFormatPERCENT 128 && selects percentage number formats.

#define ooNumberFormatTEXT 256 && selects text number formats.

#define ooNumberFormatDATETIME 6 && selects number formats which contain date and time.

#define ooNumberFormatLOGICAL 1024 && selects boolean number formats.

#define ooNumberFormatUNDEFINED 2048 && is used as a return value if no format exists.

Kol_n = This.Parent.Kol_list.Value

LOCAL oDesktop, cURL, aFileProperties[2], oDoc, oSheet, lcOOoVesion, oCalcCtrl

If AT("LibOOo", SET("PROCEDURE")) = 0

SET PROCEDURE tscommandbutton1.TO LibOOo ADDITIVE

EndIf

If OOoIsInstalled()

WAIT WINDOW NOWAIT "Запуск OpenOffice.org Calc. Ждите..."

Else

=MessageBox('Пакет OpenOffice.org не установлен на данном компьютере!',48,'Измените настройки программы')

Return .F.

EndIf

oDesktop = OOoGetDesktop()

cURL = "private:factory/scalc"

aFileProperties[1] = OOoPropertyValue( "Hidden", .T. )

aFileProperties[2] = OOoPropertyValue( "ReadOnly", .F. )

oDoc = oDesktop.LoadComponentFromUrl( cURL, "_blank", 0, @ aFileProperties )

COMARRAY( oDoc, 10 )

oSheet = oDoc.getSheets().getByIndex( 0 )

*!* lcOOoVesion = OOoVersion()

oCalcCtrl = oDoc.getCurrentController() && В некоторых источниках эту переменную называют oView

oFrame = oCalcCtrl.getFrame()

oWindow = oFrame.getContainerWindow()

oWindow.SetVisible(.F.)

*!* With .Selection.Font

*!* .Name = "Arial Narrow"

*!* .FontStyle = "обычный"

*!* .Size = 10

*!* Endwith

*!* .Selection.ColumnWidth = This.Parent.lenght.Value

oCalcCtrl.ShowGrid = .T. && Аналог Excel .ActiveSheet.PageSetup.PrintGridlines = .T.

oCalcCtrl.ZoomType = ooDocumentZoomTypeBY_VALUE

oCalcCtrl.ZoomValue = 85

*!* oCalcCtrl.ShowZeroValues = .F.

*!* oCalcCtrl.ShowNotes = .F.

oCalcCtrl.HasColumnRowHeaders = .T.

oCalcCtrl.HasSheetTabs = .T.

oCalcCtrl.HideSpellMarks = .T.

oCalcCtrl.ShowPageBreaks = .T.

LOCAL oBorderLine, oCells

oBorderLine = OOoCreateStruct( "com.sun.star.table.BorderLine" )

With oBorderLine

.Color = 0

.InnerLineWidth = 0 && толщина линии в сотых долях миллиметра

.OuterLineWidth = 25 && толщина линии в сотых долях миллиметра

.LineDistance = 0

EndWith

I = 0

Do While !Eof()

For J = 0 To Kol_n - 1

oSheet.getCellByPosition( J, I ).setString(ThisForm.Pokup)

oSheet.getCellByPosition( J, I+1).setString("Накл. "+Str(Docnum,5)+" от "+Dtoc(Inpdate))

oSheet.getCellByPosition( J, I+2).setString(Namesp.Group_name)

oSheet.getCellByPosition( J, I+3).setString(Namesp.Name)

oSheet.getCellByPosition( J, I+4).setString(Alltr(Str(Floor(Costnalog),10))+"р."+;

Right("00"+Alltr(Str((Costnalog - Int(Costnalog))*100,2)),2)+"к.")

Skip

If Eof()

Exit

Endif

Endfor

oCells = oSheet.getCellRangeByPosition(0, I, Kol_n - 1, I)

oCells.charFontName="Arial Cyr"

oCells.charHeight = 6 && можно писать в кавычках, например, "10"

oCells.charWeight = 100 && для обычного шрифта 100, для жирного 150

oCells.HoriJustify = ooCellHoriJustifyCENTER

oCells = oSheet.getCellRangeByPosition(0, I+1, Kol_n - 1, I+3)

oCells.charFontName="Arial Narrow"

oCells.charHeight = 10 && можно писать в кавычках, например, "10"

oCells.charWeight = 100 && для обычного шрифта 100, для жирного 150

oCells.HoriJustify = ooCellHoriJustifyCENTER

oCells = oSheet.getCellRangeByPosition(0, I+4, Kol_n - 1, I+4)

oCells.charFontName="Arial Cyr"

oCells.charHeight = 20 && можно писать в кавычках, например, "10"

oCells.charWeight = 150 && для обычного шрифта 100, для жирного 150

oCells.HoriJustify = ooCellHoriJustifyCENTER

oCells = oSheet.getCellRangeByPosition(0, I, Kol_n - 1, I+4)

oCells.LeftBorder = oBorderLine

oCells.RightBorder = oBorderLine

oCells = oSheet.getCellRangeByPosition(0, I, Kol_n - 1, I)

oCells.TopBorder = oBorderLine

oCells = oSheet.getCellRangeByPosition(0, I + 4, Kol_n - 1, I+4)

oCells.BottomBorder = oBorderLine

I = I + 5

EndDo

oFormats = oDoc.getNumberFormats()

oLocale = OOoCreateStruct( "com.sun.star.lang.Locale" )

With oLocale

.Language = "ru" && "en"

.Country = "RU" && "US"

EndWith

oColumns = oSheet.getColumns()

I = Iif(I=5, 6, I)

For nCol = 0 To Kol_n - 1

oColumn = oColumns.getByIndex( nCol )

oRange = oSheet.getCellRangeByPosition(nCol,1,nCol,I-5)

oColumn.Width = This.Parent.lenght.Value * 210

oRange.NumberFormat = oFormats.getStandardFormat( ooNumberFormatTEXT, oLocale )

EndFor

LOCAL oPageStyles, oPageSetup &&, oPageNumber, oPageCount, oDate, oTime, oHeader, oFooter, oCursor

oPageStyles = oDoc.StyleFamilies.getByName("PageStyles")

oPageSetup = oPageStyles.getByName(oSheet.PageStyle)

With oPageSetup

*!* .ScaleToPagesX = 1 && Аналог .FitToPagesWide в Excel

*!* .ScaleToPagesY = 1000 && Аналог .FitToPagesTall в Excel (10000 ставить нельзя на Windows 98)

*!* .IsLandscape = .T. && Page Orientation

*!* .Height = 21000 && Для изменения ориентации листа таким способом,

*!* .Width = 29700 && необходимо дополнительно выставлять его расмеры!

.HeaderOn = .F. && Выключаем верхний колонтитул

.FooterOn = .F. && Выключаем нижний колонтитул

.LeftMargin = 500 && Аналог команды: oPage.setPropertyValue("LeftMargin", 500)

.TopMargin = 1500 && 1500 означает 1,5 см

.RightMargin = 500

.BottomMargin = This.Parent.Bottom.Value &&1500

EndWith

LOCAL ARRAY aOneArg[1]

LOCAL cFile, cURL

pathToMain=SYS(5)+SYS(2003)

cFile = pathToMain + "\Ценники"

cURL = "file:///" + CHRTRAN( cFile, "\", "/" ) + ".xls" && OOoConvertToURL( cFile + ".xls" )

aOneArg[1] = OOoPropertyValue( "FilterName", "MS Excel 97" )

oDoc.storeAsUrl( cURL, @ aOneArg )

oWindow.SetVisible(.T.)

lsWinTitle = oFrame.getPropertyValue("Title")

RELEASE goOOoDesktop, goOOoConfigProvider

RELEASE oDesktop, cURL, aFileProperties, oDoc, oSheet, lcOOoVesion, oCalcCtrl

WAIT CLEAR

Otstup = This.Parent.Bottom.Value

Save To Otstup.mem ALL LIKE Otstup

Return

lcOldError = On("Error")

On Error loExcel = .NULL.

loExcel = GetObject(, "Excel.Application")

On Error &lcOldError

If IsNull(loExcel)

loExcel = CreateObject("Excel.Application")

Endif

loExcel.Visible = .T.

With loExcel

.WindowState = 2 && минимизировать

.ScreenUpdating = False

.WorkBooks.Add

.DisplayAlerts = False

lnSheets = .Sheets.Count

For lnCounter = 1 To lnSheets - 1

.Sheets(1).Delete

Endfor

With .Sheets(1)

.Select

.Name = "Ценники"

Endwith

.ActiveWindow.DisplayGridlines = True

.Cells.Select

With .Selection.Font

.Name = "Arial Narrow"

.FontStyle = "обычный"

.Size = 10

Endwith

.Selection.ColumnWidth = This.Parent.lenght.Value

.ActiveWindow.Zoom = 85

With .Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlCenter

Endwith

With .ActiveSheet.PageSetup

.LeftMargin = 0

.RightMargin = 0

.PrintGridlines = True

EndWith

I = 1

Do While !Eof()

For J = 1 To Kol_n

.Cells(I, J).Value = ThisForm.Pokup

.Cells(I, J).Select

With .Selection.Font

.Name = "Arial Cyr"

.Size = 6

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.ColorIndex = xlAutomatic

EndWith

.Cells(I+1, J).Value = "Накл. "+Str(Docnum,5)+" от "+Dtoc(Inpdate)

.Cells(I+2, J).Value = Namesp.Group_name

.Cells(I+3, J).Value = Namesp.Name

.Cells(I+4, J).Value = Alltr(Str(Floor(Costnalog),10))+"р."+;

Right("00"+Alltr(Str((Costnalog - Int(Costnalog))*100,2)),2)+"к."

.Cells(I+4, J).Select

With .Selection.Font

.Name = "Arial Cyr"

.Size = 20

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.ColorIndex = xlAutomatic

.Bold = True

EndWith

.Range(.Cells(I, J),.Cells(I+5, J)).Select

.Selection.Borders(xlDiagonalDown).LineStyle = xlNone

.Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With .Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

With .Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

With .Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

With .Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

EndWith

.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone

Skip

If Eof()

Exit

Endif

Endfor

I = I + 6

EndDo

.WindowState = 1 && максимиз

.ScreenUpdating = True

Endwith

loExcel.Visible = .T.

Close Databases

return

ENDPROC

PROCEDURE tscommandbutton2.Click

Local lcPath, lcPush, lcNaklpr, lcNaklprs, lcNmbr, lcNaklosp, lcNamesp

Restore From Type_mag Addi

Len_nds = Alen(Stat_nds,1)

Select Prixns

Set Filter To !Empty(Pech)

Go Top

If Eof()

Wait Windows "Ничего не выбрали"

Return

Endif

*!* m.cFile = .F.

*!* NNN = 0

*!* pathToMain=SYS(5)+SYS(2003)

*!* SET PROCEDURE tscommandbutton2.TO 'o_report.prg' ADDI

IF !DIRECTORY(Sys(5)+Sys(2003)+'\Temp\ASK')

CD (Sys(5)+Sys(2003)+'\Temp\')

MD ASK

CD ..

ENDIF

Name_f = Sys(5)+Sys(2003)+'\Temp\ASK\'

public array pp(50)

Store " " To pp

select firma

Store Space(10) To P_okohx,P_okpo,Pokadress,Pokname,Pokbank,P_inn

If Thisform.Slf_firm = 0

Wait Windows "Нет своей фирмы для данного склада"

Return

Endif

set relation to town into townsp, bank into banksp

Go Thisform.Slf_firm

pokname=Allt(namef)

*!* + ", ИНН " + Allt(INN) + ", " + Str(TownCode,6) + ", " + Trim(townsp.town) + ', ' + Trim(Adress)

*!* P_okohx='КПП ' + Trim(OKOHX) + ", БИК " + Trim(banksp.mfo) + ", Р/с " + Bill + " в " + banksp.bankname +;

*!* ", К/с " + Korsch

P_inn = Inn

P_okohx = Trim(OKOHX)

P_okpo=OKPO

If Thisform.Pr_prixn

Store pokname To pp(5), pp(8)

Store P_okohx To pp(50), pp(49)

Else

Store pokname To pp(1), pp(31)

Store P_okohx To pp(32), pp(2)

pp(7) = P_okpo

Endif

*!* Im_fil = Name_f + Num_d + "_" + Dtos(m.D_date_trade)+Iif(ThisForm.Level_do = 2,"","_Возврат") + ".RTL"

*!* =StrToFile("#G" + '"' + Num_d + '","' + Dat_d + '","-","-",' + Allt(Substr(m.C_pref_salon,3)) +;

*!* Tip_doc + Allt(Nvl(m.c_kod," ")) + '",' + Iif(ThisForm.Level_do = 2,'"","-","-"',;

*!* '"' + Alltr(Nvl(m.C_kom_Tradh,"")) + '"') + Chr(13) + Chr(10), Im_fil, 0)

*!* =StrToFile(Str1+Str2+Str3+Chr(13)+Chr(10), Im_fil, 1)

*!* Create Cursor Exel_otc (A1 C(4), A2 C(100), A3 C(1), A4 C(6), A5 C(5), A6 C(7), A7 C(7), A8 C(2),;

*!* A9 C(5), A10 N(10), A11 N(12,2), A12 N(12,2), A13 N(4,1), A14 N(12,2), A15 N(12,2))

Pr_newf = 0

Select Prixns

Go Top

Im_fil = Name_f + Iif(Thisform.Pr_prixn, "Прих_", "Расх_") + TRANSFORM(Docnum) + "_" + Dtos(Inpdate) + ".TXT"

=StrToFile("НачалоФайла"+Chr(13)+Chr(10), Im_fil, Pr_newf)

Scan

Numnak = TRANSFORM(Docnum)

Datnak = Inpdate

pp[21] = Iif(Dovnum > 0, Str(Dovnum,5), " ")

pp[22] = Dtoc(nvl(dovdate,{}))

*!* pp[23] = nvl(Fam,'')

select firma

_Kod_Firm = Recno()

Slfname=Allt(namef)

*!* + ", ИНН " + Allt(INN) + ", " + Str(TownCode,6) + ", " + Trim(townsp.town)+', '+Trim(Adress)

*!* S_okohx='КПП ' + Trim(OKOHX) + ", БИК " + Trim(banksp.mfo) + ", Р/с " + Bill + " в " + banksp.bankname +;

*!* ", К/с " + Korsch

S_okpo=OKPO

S_Inn = Inn

S_okohx = Trim(OKOHX)

If Thisform.Pr_prixn

Store Slfname To pp(1), pp(31)

Store S_okohx To pp(32), pp(2)

pp(7) = S_okpo

Else

Store Slfname To pp(5), pp(8)

Store S_okohx To pp(50), pp(49)

Endif

*!* Select Exel_otc

*!* Zap

II = Len_nds

_Nds = Stat_nds(II, 2)

Do While II > 0 AND Datnak < Stat_nds(II, 1)

_Nds = Stat_nds(II, 2)

II = II - 1

Enddo

Select Prixn

If Thisform.Pr_prixn

Set Filter To Inpdate=Prixns.Inpdate AND Docnum=Prixns.Docnum AND Sourcer=Prixns.Client

Else

Set Filter To Inpdate=Prixns.Inpdate AND Docnum=Prixns.Docnum

Endif

Go Top

Store 0 To rezsum, II, _Qwan

Sek_doc = "СекцияДокумент=" + Iif(Thisform.Pr_prixn, "ПоступлениеТоваровУслуг", "РеализацияТоваровУслуг")

Pr_newf = 1

=StrToFile(Sek_doc + Chr(13)+Chr(10)+"ДатаДокумента="+;

Dtos(Date())+"000000"+Chr(13)+Chr(10)+"ДатаВходящегоДокумента=" + Dtos(Datnak)+"000000"+Chr(13)+Chr(10)+;

"НомерДокумента=" + Numnak + Chr(13)+Chr(10) + "Поставщик=" + Slfname + Chr(13)+Chr(10)+ ;

"ИННПОставщика=" + S_inn + Chr(13)+Chr(10) + ;

"КПППоставщика=" + S_okohx + Chr(13)+Chr(10) + ;

"Склад=" + TRANSFORM(Thisform.Pageframe1.page1.sklad.Value) + Chr(13)+Chr(10), Im_fil, Pr_newf)

=StrToFile("СекцияРасшифровки" + Chr(13)+Chr(10), Im_fil, Pr_newf)

Scan

=StrToFile("НачалоСтроки" + Chr(13)+Chr(10), Im_fil, Pr_newf)

Scatter Memvar

II = II + 1

sumsn=Round(m.Qwantity*m.Costnalog, 4)

sumbn=Round(Sumsn/(1+_Nds/100),4)

Cen=IIF(m.Qwantity >0, Round(Sumbn/m.Qwantity,2),0)

_Qwan = _Qwan + m.Qwantity

rezsum = rezsum + sumsn

*!* Insert Into Exel_otc (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) ;

*!* Values (Str(II,4), Alltr(Namesp.Group_Name) + " " + Alltr(Namesp.Name), " ", Ed.Messed,;

*!* Iif(m.ed=1,"796"," "), " ", " ", " ", " ", m.Qwantity, Cen, sumbn, _Nds, sumsn - sumbn, sumsn)

*!* =StrToFile("КодГруппыТовара="+TRANSFORM(Group) + Chr(13)+Chr(10) + "ГруппаТовара=" + Alltr(Namesp.Group_Name)+;

*!* Chr(13)+Chr(10) + "КодТовара=" + TRANSFORM(Name) + Chr(13)+Chr(10) + "НаименованиеТовара=" + ;

*!* Alltr(Namesp.Name)+Chr(13)+Chr(10)+"ЕдиницаИзмерения=" + Allt(Ed.Messed) + Chr(13)+Chr(10) +;

*!* "КоличествоТовара=" + Allt(Str(m.Qwantity,6,3)) + Chr(13)+Chr(10)+;

*!* "ЦенаТовара=" + Allt(Str(Cen,12,2)) + Chr(13)+Chr(10) + "СтавкаНДС=" + Str(_Nds,3,1)+Chr(13)+Chr(10)+;

*!* "ЦенаСНДС=" + Allt(Str(m.Costnalog,10,2))+Chr(13)+Chr(10), Im_fil, Pr_newf)

=StrToFile("КодГруппыТовара="+TRANSFORM(Group) + Chr(13)+Chr(10) + "ГруппаТовара=" + Alltr(Namesp.Group_Name)+;

Chr(13)+Chr(10) + "КодТовара=" + TRANSFORM(Name) + Chr(13)+Chr(10) + "НаименованиеТовара=" + ;

Alltr(Namesp.Name)+Chr(13)+Chr(10)+"ЕдиницаИзмерения=" + Allt(Ed.Messed) + Chr(13)+Chr(10) +;

"КоличествоТовара=" + TRANSFORM(m.Qwantity) + Chr(13)+Chr(10)+;

"ЦенаТовара=" + TRANSFORM(Cen) + Chr(13)+Chr(10) + "СтавкаНДС=" + TRANSFORM(_Nds)+Chr(13)+Chr(10)+;

"ЦенаСНДС=" + TRANSFORM(m.Costnalog)+Chr(13)+Chr(10), Im_fil, Pr_newf)

=StrToFile("КонецСтроки" + Chr(13)+Chr(10), Im_fil, Pr_newf)

Endscan

=StrToFile("КонецРасшифровки" + Chr(13)+Chr(10), Im_fil, Pr_newf)

=StrToFile("КонецДокумента" + Chr(13)+Chr(10), Im_fil, Pr_newf)

*!* rezsum = Round(rezsum, 2)

*!* It_bn = Round(rezsum/(1+_Nds/100),2)

*!* It_nd = rezsum - It_bn

If .F.

SELECT otch1

pp[31]=nvl(_ott_t,"")

pp[1]=nvl(ott_t,"")

pp[32]=nvl(_bil_t,"")

pp[2]=nvl(bil_t,"")

pp[3]=nvl(okpo1,"")

pp[4]=Space(67)

pp[5]=nvl(ott2_td,"")

Store nvl(bil2_t,"") To pp[50], pp[49]

pp[6]=nvl(ott_td,"")

pp[7]=nvl(okpo2,"")

pp[8]=nvl(ott2_t1,"")

pp[9]=nvl(osnovan,"")

Endif

*!* Store _Qwan To pp[11], pp[15]

*!* Store It_bn To pp[12], pp[16]

*!* Store It_nd To pp[13], pp[17]

*!* Store rezsum To pp[14], pp[18]

*!* Kol_n = Anipp(II)

*!* pp[20]=nvl(Anip0(rezsum),'')

*!* pp[19]="и содержит "+alltr(Kol_n)+" порядковых номеров записей"

*!* pp[10]="ТОВАРНАЯ НАКЛАДНАЯ № "+alltr(nvl(numnak,""))+" от "+dtoc(datnak)

*!* pp[24]="М.П. "+nvl(dtoc(datnak),'')+" года"

*!* STORE " " TO _doldir, _dolglb, _dolotp, _podpdir, _podpglb, _podpotp, _spdir, _spglb, _spotp

*!* SELECT ALLTRIM(NVL(a1,SPACE(4))) as a1, ALLTRIM(NVL(a2,SPACE(100))) as a2, "" as qq, "-" as a3, ;

*!* ALLTRIM(NVL(a4,SPACE(80))) as a4, ALLTRIM(NVL(a5,SPACE(30))) as a5, "-" as a6, "-" as a7,;

*!* "-" as a8, "-" as a9, a10, a11, a12, a13, a14, a15 FROM exel_otc INTO CURSOR excel_otc1

*!*

*!* sele excel_otc1

*!* go top

*!*

*!* NNN = NNN + 1

*!* Name_o = Allt(Str(NNN,3))+'.xls'

*!* fl_=addbs(pathToMain)+'temp\Товарная накладная' + Name_o

*!* sh_=addbs(pathToMain)+'excel_shap\ExTovarNakl.xls'

*!* m.oEReport=CREATEOBJECT('o_report',fl_,sh_,,,.T.)

*!* IF TYPE('oEReport')='O'

*!* oEReport.destination=m.cFile

*!* oEReport.NoShowReport=.t.

*!* oEReport.make_report()

*!* m.cFile=Iif(Empty(m.cFile),oEReport.fullname,m.cFile)

*!* *!* WITH oEReport

*!* *!* .auto_fit(1)

*!* *!* .make_report()

*!* *!* ENDWITH

*!* ENDIF

Select Prixns

C_recn = Recno()

Endscan

=StrToFile("КонецФайла" + Chr(13)+Chr(10), Im_fil, Pr_newf)

*!* oEReport.open_file(m.cFile)

Replace All Pech With " "

Set Filter To

Select Prixn

Set Filter To

Select Prixns

Go C_recn

Wait Windows "Сформирован файл - " + Im_fil

RELEASE goOOoDesktop, goOOoConfigProvider

RELEASE oDesktop, cURL, aFileProperties, oDoc, oSheet, lcOOoVesion, oCalcCtrl

*!* SELECT Otch1

*!* GO TOP

Return

ENDPROC

PROCEDURE text1.Click

Select Prixn

replace Pech With Iif(Pech='*',' ','*')

KEYBOARD '{TAB}'

ENDPROC

ENDDEFINE

Размещено на Allbest.ru


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.