152
FROM ( Thisform.formalias ) ;
WHERE &lcFiltr ;
ORDER By 1, 4 ;
INTO Cursor cur_report_rest_holiday_excel
Copy To ( lcTmpFile ) Fields Except Status Xl5
Use In cur_report_rest_holiday_excel
oExcel.DisplayAlerts = .F.
oExcel.Workbooks.Open ( lcTmpFile )
oExcel.Rows(1).Insert()
oExcel.Range( 'A1:M1' ).MergeCells = .T.
oExcel.Cells( '1', 'A' ).Value = Thisform.lbl_end_period.Caption
oExcel.Cells( '1', 'A' ).Font.Size = 14
oExcel.Rows( 1 ).RowHeight = 25
oExcel.Range( 'A2:M2' ).Orientation = 90
oExcel.Rows( 2 ).RowHeight = 200
oExcel.Range( 'A1:K2' ).HorizontalAlignment = -4108
oExcel.Columns( 'L:L' ).HorizontalAlignment = -4108
oExcel.Columns( 'M:M' ).HorizontalAlignment = -4108
oExcel.Range( 'A1:D2' ).VerticalAlignment = -4108
oExcel.Columns( 'M:M' ).VerticalAlignment = -4108
oExcel.Cells( '2', 'A' ).Value = 'ОТДЕЛ'
oExcel.Cells( '2', 'B' ).Value = 'ТАБЕЛЬ'
oExcel.Cells( '2', 'C' ).Value = 'КАТЕГОРИЯ'
oExcel.Cells( '2', 'D' ).Value = 'ФИО'
oExcel.Range( 'E2:M2' ).WrapText = .T.
oExcel.Cells( '2', 'E' ).Value = 'Остаток на начало года'
oExcel.Cells( '2', 'F' ).Value = 'Заработано основного'
oExcel.Cells( '2', 'G' ).Value = 'Заработано за вред. усл. труда'
oExcel.Cells( '2', 'H' ).Value = 'Заработано за командировку на севере'
oExcel.Cells( '2', 'I' ).Value = 'Использовано основного'
oExcel.Cells( '2', 'J' ).Value = 'Использовано дней за вред. усл. труда'
oExcel.Cells( '2', 'K' ).Value = 'Компенсировано денежными средствами'
oExcel.Cells( '2', 'L' ).Value = 'Остаток на конец периода'
oExcel.Cells( '2', 'M' ).Value = 'ПРИМЕЧАНИЕ'
nRow = oExcel.ActiveSheet.usedRange.Rows.Count
oExcel.Cells( nRow+1, 'E' ).Formula = Textmerge( '=SUM( E3: E<<nRow>>)' )
oExcel.Cells( nRow+1, 'F' ).Formula = Textmerge( '=SUM( F3: F<<nRow>>)' )
oExcel.Cells( nRow+1, 'G' ).Formula = Textmerge( '=SUM( G3: G<<nRow>>)' )
oExcel.Cells( nRow+1, 'H' ).Formula = Textmerge( '=SUM( H3: H<<nRow>>)' )
oExcel.Cells( nRow+1, 'I' ).Formula = Textmerge( '=SUM( I3: I<<nRow>>)' )
oExcel.Cells( nRow+1, 'J' ).Formula = Textmerge( '=SUM( J3: J<<nRow>>)' )
oExcel.Cells( nRow+1, 'K' ).Formula = Textmerge( '=SUM( K3: K<<nRow>>)' )
oExcel.Cells( nRow+1, 'L' ).Formula = Textmerge( '=SUM( L3: L<<nRow>>)' )
oExcel.Range( 'A1:M1' ).Select()
oExcel.Selection.AutoFilter
nColor = Rgb( 192, 80, 77 )
oExcel.Columns( 'E:E' ).Font.Color = nColor
oExcel.Columns( 'L:L' ).Font.Color = nColor
nColor = Rgb( 112, 48, 160 )
oExcel.Columns( 'G:G' ).Font.Color = nColor
oExcel.Columns( 'J:J' ).Font.Color = nColor
oExcel.Columns( 'A:M' ).AutoFit()