Event 'Leer' &PromedioC1 = 0 &PromedioC2 = 0 Msg('Inicia lectura del documento xls... ') &ExcelDocument.Open(&DocumentoExcelBlob) Msg('Ruta del archivo '+ &DocumentoExcelBlob) If &ExcelDocument.ErrCode <> 0 //Verifica que el archivo exista o pueda ser leido por la página Msg("ERROR " + &ExcelDocument.ErrCode.ToString() + " - " + &ExcelDocument.ErrDescription) Return Else Msg('El archivo cargado, se está leyendo... ') &Linea = 1 &Columna = 1 &Elementos = 0 Do While &Linea <= 10 //Leer los valores del archivo xls &Elementos += 1 &C1 = &ExcelDocument.Cells(&Linea, 1).Number &C2 = &ExcelDocument.Cells(&Linea, 2).Number &SdtPrograma1Item.SdtPrograma1N1 = &C1 &SdtPrograma1Item.SdtPrograma1N2 = &C2 &SdtPrograma1.Add(&SdtPrograma1Item)//Agregar los datos al SDT &SdtPrograma1Item = New SdtPrograma1.SdtPrograma1Item() //Nuevp registro SDT &SumaC1 += &C1 &SumaC2 += &C2 &Linea += 1 //Leer el siguiente registro GrdDatos.Load() //Almacenar los datos en una tabla para que se puedan ver en pantalla EndDo EndIf //Obtener el promedio de las columnas &Promedio = &SumaC1 / &Elementos &Promedio2 = &SumaC2 / &Elementos &PromedioC1 = 0 &PromedioC2 = 0 &Linea = 1 &Columna = 1 For &SdtPrograma1Item in &SdtPrograma1 // Leer la estructura &C1 = &SdtPrograma1Item.SdtPrograma1N1 &C2 = &SdtPrograma1Item.SdtPrograma1N2 //Obtener la desviacion estandar &PromedioC1 += (&C1 - &Promedio) ^ 2 &PromedioC2 += (&C2 - &Promedio2) ^ 2 &Linea += 1 EndFor &DesviacionEstandar = (&PromedioC1 / (&Elementos - 1)) ^ .5 &DesviacionEstandar2 = (&PromedioC2 / (&Elementos - 1)) ^ .5 EndEvent