protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             Inward  += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Inward"));
             Outward += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Outward"));
             Damaged += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Damage"));
             Closing += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Closing"));
             Amount  += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Amount"));
         }
         if (e.Row.RowType == DataControlRowType.Footer)
         {
             e.Row.Cells[6].Text  = "Total";
             e.Row.Cells[7].Text  = Inward.ToString("0.00");
             e.Row.Cells[8].Text  = Outward.ToString("0.00");
             e.Row.Cells[9].Text  = Damaged.ToString("0.00");
             e.Row.Cells[10].Text = Closing.ToString("0.00");
             e.Row.Cells[11].Text = Amount.ToString("0.00");
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemple #2
0
 protected void GrdReport_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             Opening       += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Opening"));
             Purchase      += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Purchase"));
             Sales         += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Sales"));
             SalesReturn   += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SalesReturn"));
             Inward        += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Inward"));
             Outward       += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Outward"));
             OutwardReturn += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "OutwardReturn"));
             TransferIN    += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferIN"));
             TransferOUT   += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "TransferOUT"));
             Damaged       += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Damage"));
             PurReturn     += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "ReturnToSupplier"));
             Closing       += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Closing"));
             Amount        += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Amount"));
             Consumption   += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Consumption"));
             ConvertUnit   += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "STOCKINHANDWITHUNITCONVERT"));
         }
         if (e.Row.RowType == DataControlRowType.Footer)
         {
             e.Row.Cells[7].Text  = "Total";
             e.Row.Cells[8].Text  = Opening.ToString("0.00");
             e.Row.Cells[9].Text  = Purchase.ToString("0.00");
             e.Row.Cells[10].Text = Sales.ToString("0.00");
             e.Row.Cells[11].Text = SalesReturn.ToString("0.00");
             e.Row.Cells[13].Text = Inward.ToString("0.00");
             e.Row.Cells[14].Text = Outward.ToString("0.00");
             e.Row.Cells[15].Text = OutwardReturn.ToString("0.00");
             e.Row.Cells[17].Text = TransferIN.ToString("0.00");
             e.Row.Cells[18].Text = TransferOUT.ToString("0.00");
             e.Row.Cells[16].Text = Damaged.ToString("0.00");
             e.Row.Cells[12].Text = PurReturn.ToString("0.00");
             e.Row.Cells[20].Text = Closing.ToString("0.00");
             e.Row.Cells[23].Text = Amount.ToString("0.00");
             e.Row.Cells[22].Text = ConvertUnit.ToString("0.00");
             e.Row.Cells[19].Text = Consumption.ToString("0.00");
         }
     }
     catch (Exception ex)
     {
     }
 }