The DataTable's Rows show likw this, how do I fix it.
Month1 Month2 Month3
1
2
3
1
2
3
1
2
3
double C146_Calc = 0.0;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
// create the table
DataSet ds = GetTable();
outputView.DataSource = ds;
outputView.DataBind();
}
}
public DataSet GetTable()
{
double H30_Out = -63268973;
double H91_Out = 5640000;
double H94_Out = -846000;
C146_Calc = H91_Out / 12;
double C148_Calc = H94_Out / 12;
double G158_In = 8;
double C150_Out = C146_Calc + C148_Calc;
DataTable dt = new DataTable("Details");
DataSet ds = new DataSet();
ds.Tables.Add(dt);
for (int i = 1; i <= 240; i++)
{
dt.Columns.Add("Month"+i, typeof(string));
}
DataRow dr3, dr4;
DataRow dr = dt.NewRow();
dr["Month1"] = String.Format("{0:#,###,###,###.##}", H30_Out);
for (int i = 1; i <= 240; i++)
{
double num = 0.0;
if (i == 13 || i == 25)
{
num = (C146_Calc * G158_In) / 100;
}
C146_Calc += num;
DataRow row1 = dt.NewRow();
row1["Month" + i] = String.Format("{0:#,###,###,###.##}", C146_Calc);
DataRow row2 = dt.NewRow();
row2["Month" + i] = String.Format("{0:#,###,###,###.##}", C148_Calc);
DataRow row3 = dt.NewRow();
row3["Month" + i] = String.Format("{0:#,###,###,###.##}", C150_Out);
dt.Rows.Add(row1);
dt.Rows.Add(row2);
dt.Rows.Add(row3);
}
dt.Rows.Add(dr);
return ds;
}