Sunteți pe pagina 1din 3

&EmpreDes=&ApplicationWebSession.Get('EmpreDes') &EmpreGir=&ApplicationWebSession.Get('EmpreGir') &EmpreRuc=&ApplicationWebSession.Get('EmpreRuc') &cPeriAnio=&ApplicationWebSession.Get('PeriAnio') &cPeriId=&ApplicationWebSession.Get('PeriId') &PeriMes=&ApplicationWebSession.Get('PeriMes') &PeriNombreMes=&ApplicationWebSession.

Get('PeriNombreMes') &nomMes=&PeriNombreMes+" - "+&cPeriAnio // Exports the contents of a grid (using the selected order and filters) to an Excel file. &Random = Random() * 10000 &Filename = !"ExportarReporteLibroDiarioSimp_" + &Random.ToString().Trim() + !".xls" &ExcelDocument.Open(&Filename) Do 'CheckStatus' &ExcelDocument.Clear() &CellRow = 6 &FirstColumn = 1 //ENCABEZADO &ExcelDocument.Cells(1, 1 + 0).Bold = True &ExcelDocument.Cells(1, 1 + 0).Text = 'FORMATO 5.2: "LIBRO DIARIO DE FORMATO SIMPLIFICADO"' &ExcelDocument.Cells(2, &ExcelDocument.Cells(2, &ExcelDocument.Cells(2, &ExcelDocument.Cells(2, &ExcelDocument.Cells(3, &ExcelDocument.Cells(3, &ExcelDocument.Cells(3, &ExcelDocument.Cells(3, 1 1 2 2 1 1 2 2 + + + + + + + + 0).Bold 0).Text 0).Bold 0).Text 0).Bold 0).Text 0).Bold 0).Text = = = = = = = = True 'PERIODO:' True &nomMes True 'RUC:' True &EmpreRuc

&ExcelDocument.Cells(4, 1 + 0).Bold = True &ExcelDocument.Cells(4, 1 + 0).Text = 'RAZ.SOCIAL:' &ExcelDocument.Cells(4, 2 + 0).Bold = True &ExcelDocument.Cells(4, 2 + 0).Text = &EmpreDes /////CANTIDAD DE CUENTAS For each defined by AsientoId,AsientoMes,AsiDetGlosa For each AsientoNum where AsientoMes=&PeriMes &CuentaCuentas=&CuentaCuentas+1 // Write cell values endfor Endfor // Write titles &ExcelDocumentAjustado.AutoFit=1 &ExcelDocument.Cells(&CellRow, &FirstColumn + 0).Bold = True &ExcelDocument.Cells(&CellRow, &FirstColumn + 0).Text = 'CODIGO' &ExcelDocument.Cells(&CellRow, &FirstColumn + 1).Bold = True &ExcelDocument.Cells(&CellRow, &FirstColumn + 1).Text = 'FECHA' &ExcelDocument.Cells(&CellRow, &FirstColumn + 2).Bold = True &ExcelDocument.Cells(&CellRow, &FirstColumn + 2).Text = 'GLOSA' //6,3 //for &y=1 to &CuentaCuentas // For each defined by AsientoId,AsientoMes,AsiDetGlosa // For each AsientoNum // // where AsientoMes=&PeriMes // &ExcelDocument.Cells(6, 2 + (2+&y)).Bold = True // &ExcelDocument.Cells(6,2 + (2+&y)).Number =&y // endfor // endfor //endfor //For each defined by AsientoId,AsientoMes,AsiDetGlosa // For each AsientoNum // where AsientoMes=&PeriMes //for &y=1 to &CuentaCuentas // endfor //endfor

For each defined by AsientoId,AsientoMes,AsiDetGlosa,PlanCuentaNivel For each AsientoNum where AsientoMes=&PeriMes //and PlanCuentaNivel='1' // Write cell values &AsientoId=str(AsientoId) &SubDiarioId=SubDiarioId &AsientoNum=str(AsientoNum) &CellRow += 1 &ExcelDocument.Cells(&CellRow, &FirstColumn LTrim(&AsientoNum) &ExcelDocument.Cells(&CellRow, &FirstColumn &ExcelDocument.Cells(&CellRow, &FirstColumn if PlanCuentaNivel='3' &planExtrae=substr(PlanCuentaId,1,2) &ExcelDocument.Cells(6, &CellRow -3).Text = endif &ExcelDocument.Cells(7, &CellRow -3).Number

+ 0).Text = &AsientoId+ &SubDiarioId + + 1).Date = AsientoFec + 2).Text = AsiDetGlosa &planExtrae = AsiDetDebes

//&ExcelDocument.Cells(7,2 + (2+&y)).Number =AsiDetDebes endfor Endfor //CALCULANDO DEBE-HABER For each AsientoNum where AsientoMes=&PeriMes For each (AsientoMes, SubDiarioCodigo, AsientoNum) if &opcion=0 //cuando es soles &enDebe =AsiDetDebes &enHaber=AsiDetHabers else //cuando es dolares &enDebe=AsiDetDebed &enHaber=AsiDetHaberd endif //for &var = 1 to &CuentaCuentas// people &Matriz.Add(PlanCuentaId)//substr(PlanCuentaId,1,2)) for &i=1 to &CuentaCuentas for &i in &Matriz if PlanCuentaId=str(&i) &MatrizN.Add(PlanCuentaId) for &i=1 to &CuentaCuentas &ExcelDocument.Cells(10, 20 -3).Number = &i endfor endif endfor endfor &totaldebe = &totaldebe+&enDebe &totalhaber = &totalhaber+&enHaber //&ExcelDocument.Cells(8, &CellRow -3).Number = &totaldebe-&totalhaber Endfor Endfor //&Matriz(50)= 0 //For &var = 1 to 10 // &Matriz(&var) = AsiDetHaberd //Endfor &ExcelDocument.Save() Do 'CheckStatus' &ExcelDocument.Close() Sub 'CheckStatus' If (&ExcelDocument.ErrCode <> 0) &Filename = ""

//&ErrorMessage = &ExcelDocument.ErrDescription &ExcelDocument.Close() Return Endif Endsub

S-ar putea să vă placă și