Hi
In below code i want to display sum of Budget Amount in Footer
if (Result != null)
{
htmlTable.Append("
| # | Year | Department | Budget Amount | |
|---|---|---|---|---|
| " + rownum + " | ");" + colum.BusinessYear + " | ");" + colum.Department + " | ");" + Convert.ToDecimal(colum.BudgetAmount).ToString("0,0", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")) + " | ");
PlaceHolder1.Controls.Add(new Literal { Text = htmlTable.ToString() });
}
Thanks
Sachin SinghPosted Aug 2, 2022, 4:18 PM
Ramco RamcoPosted Aug 2, 2022, 4:13 PM
private void GetData()
{
try
{
PRDataContext context = new PRDataContext();
StringBuilder htmlTable = new StringBuilder();
Int32 rownum = 0;
var Result = (from t in context.View_Entries
where t. Code == Convert.ToInt32(hdfCode.Value)
select t);
if (Result != null)
{
htmlTable.Append("");
");
htmlTable.Append("# Year Budget Amount ");
htmlTable.Append("");
foreach (var colum in Result)
{
rownum++;
htmlTable.Append(""); " + rownum + " + colum.ID + " "); " + colum. Year + " "); " + Convert.ToDecimal(colum. Amount).ToString("0,0", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN")) + " "); ");
htmlTable.Append("
htmlTable.Append("
htmlTable.Append("
htmlTable.Append("
}
htmlTable.Append("
");htmlTable.Append("").Append("").Append("");
htmlTable.Append("
PlaceHolder1.Controls.Add(new Literal { Text = htmlTable.ToString() });
}
}
catch (Exception ex)
{
SaveErrorLog(ex.Message, System.IO.Path.GetFileName(Request.Path), System.Reflection.MethodBase.GetCurrentMethod().Name);
MessageBox.Show(ex.Message);
}
}
Sachin SinghPosted Aug 2, 2022, 3:53 PM
Sachin SinghPosted Aug 2, 2022, 3:51 PM
Ramco RamcoPosted Aug 2, 2022, 3:25 PM
Ramco RamcoPosted Aug 2, 2022, 3:17 PM
Sachin SinghPosted Aug 2, 2022, 3:07 PM