Tot_Charlas_E = 0;
Tot_Consejerias_E = 0;
Tot_VisitasDom_E = 0;
Tot_Referenecias_E = 0;
Tot_Ferias_E = 0;
Tot_Otros_E = 0;
Tot_TotaldeMujeres_E = 0;
Tot_DIUInsert_E = 0;
Tot_MedCap_E = 0;
Tot_EnfCap_E = 0;
Tot_Charlas_F = 0;
Tot_Consejerias_F = 0;
for each x in Datos
{
//to fetch the month from the Date field
Month = x.Fecha.getMonth();
if (Month == 1)
{
Tot_Charlas_E = (Tot_Charlas_E + x.Charlas);
Tot_Consejerias_E = (Tot_Consejerias_E + x.Consejerias);
Tot_VisitasDom_E = (Tot_VisitasDom_E + x.VisitasDom);
Tot_Referenecias_E = (Tot_Referenecias_E + x.Referenecias);
Tot_Ferias_E = (Tot_Ferias_E + x.Ferias);
Tot_Otros_E = (Tot_Otros_E + x.Otros);
Tot_TotaldeMujeres_E = (Tot_TotaldeMujeres_E + x.TotaldeMujeres);
Tot_DIUInsert_E = (Tot_DIUInsert_E + x.DIUInsert);
Tot_MedCap_E = (Tot_MedCap_E + x.MedCap);
Tot_EnfCap_E = (Tot_EnfCap_E + x.EnfCap);
// to fetch row from the Accounts_summary form with value of Month field as "Jan"
MonthJan = DatosMensuales [Mes == "Enero"];
MonthJan.CharlasSum = Tot_Charlas_E;
MonthJan.ConsejeriasSum = Tot_Consejerias_E;
MonthJan.VisitasDomSum = Tot_VisitasDom_E;
MonthJan.RefereneciasSum = Tot_Referenecias_E;
MonthJan.FeriasSum = Tot_Ferias_E;
MonthJan.OtrosSum = Tot_Otros_E;
MonthJan.TotaldeMujeresSum = Tot_TotaldeMujeres_E;
MonthJan.DIUInsertSum = Tot_DIUInsert_E;
MonthJan.MedCapSum = Tot_MedCap_E;
MonthJan.EnfCapSum = Tot_EnfCap_E;
}
else if (Month == 2)
{
Tot_Charlas_F = (Tot_Charlas_F + x.Charlas);
Tot_Consejerias_F = (Tot_Consejerias_F + x.Consejerias);
// to fetch row from the Accounts_summary form with value of Month field as "Jan"
MonthJan = DatosMensuales [Mes == "Feb"];
MonthJan.CharlasSum = Tot_Charlas_F;
MonthJan.ConsejeriasSum = Tot_Consejerias_F;
}
}