<asp:Table id="myTable" runat="server" width="80%" style="vertical-align:middle; border-color:#999999;" border="2"/>
long infoID = Shove._Convert.StrToLong(Request.QueryString["infoID"].ToString(), -1);
long companyID = Shove._Convert.StrToLong(Request.QueryString["CompanyID"].ToString(), -1);
TableRow TabRow = new TableRow();
TabRow.HorizontalAlign = HorizontalAlign.Center;
TableCell TabCell = new TableCell();
TabCell.Text = "选项名称";
TabRow.Cells.Add(TabCell);
TabCell = new TableCell();
TabCell.Text = "选中次数";
TabRow.Cells.Add(TabCell);
TabCell = new TableCell();
TabCell.Text = "选中百分比";
TabRow.Cells.Add(TabCell);
myTable.Rows.Add(TabRow);
string StrMsg = "";
DataSet ds = new DataSet();
int Result = DAL.Procedures.P_GetCompanyInfoDetailsByID(ref ds,infoID, companyID, ref StrMsg);
int TatalCount = 0;
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
TatalCount += Shove._Convert.StrToInt(ds.Tables[0].Rows[i]["chooseCount"].ToString(), 0);
}
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
TabRow = new TableRow();
TabCell = new TableCell();
TabCell.Text = ds.Tables[0].Rows[i]["Name"].ToString();
TabRow.Cells.Add(TabCell);
TabCell = new TableCell();
TabCell.Text = ds.Tables[0].Rows[i]["chooseCount"].ToString();
TabRow.Cells.Add(TabCell);
TabCell = new TableCell();
TabCell.Text = Math.Round(Shove._Convert.StrToDouble(ds.Tables[0].Rows[i]["chooseCount"].ToString(), 0) / TatalCount * 100, 2) + "%";
TabRow.Cells.Add(TabCell);
myTable.Rows.Add(TabRow);
}