当前位置:编程学习 > C#/ASP.NET >>

顯示

頁面有﹕TextBox,DropDownList,RadioButton 三個控鍵﹐用于選擇﹐及一個Button按鈕﹐
如果單擊"按鈕"則通過Response.Write 顯示查詢出來的數據﹔
顯示的樣式通同報表一樣

﹖﹖﹖﹖﹖﹖﹖﹖﹖﹖﹖
能給個代易做图看看么﹖﹖ --------------------编程问答-------------------- 不懂 --------------------编程问答-------------------- 個為幫忙看看啦﹗﹗這個問題困擾我好多天了
.net中只能通過Response.Write顯示數據成報表樣式 --------------------编程问答-------------------- 那你可以通过Response.Write循环输出HTML不就行了吗


StringBuilder sb = new StringBuilder();
sb.AppendLine("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
for (int i=0; i<3; i++)
{
   sb.AppendLine("<tr>");
   sb.AppendLine("<td>");
   sb.AppendLine(i.ToString());
   sb.AppendLine("</td>");
   sb.AppendLine("</tr>");

}
sb.AppendLine("</table>");

Response.Write(sb.ToString()); --------------------编程问答-------------------- 表頭樣式我這樣顯示出來了﹐可是相關數據列 --------------------编程问答-------------------- 样的呀,循环查询出来的DataTable呀 --------------------编程问答-------------------- 我寫到下面就寫不出來了﹐如何繼續
 protected void btnSee_Click(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();
        ds = (new EXPENSE()).SelectAllEXPENSE(); 
        
            Response.Write(" " +
               "  <table id='td' border='1' cellspacing='1' cellpanding='1' style='width:556px;height:66px;text-align:center;' > " +
               "  <tr>    " +
               "  <td rowspan='2' style='width:100px'>          " +
               "  鋪號    " +
               "  </td>   " +
               "  <td colspan=4' style='text-align:center'>     " +
               "  2008 年3月收入  " +
               "  </td>   " +
               "  <td colspan='4' style='text-align:center'>    " +
               "  2008年4月收入  " +
               "  </td>   " +
               "  <td rowspan='2' style='width:100px'>          " +
               "   合計          " +
               "  </td>   " +
               "  </tr>    " +


                "  <tr>    " +
               "  <td  style='width:100px: height:21px'>          " +
               "  租金    " +
               "  </td>   " +
               "  <td  style='width:100px;height:21px'>     " +
               "  清潔費  " +
               "  </td>   " +
               "  <td  style='width:100px;height:21px'>    " +
               "  管理費  " +
               "  </td>   " +
               "  <td style='width:100px;height:21px'>          " +
               "   小計          " +
               "  </td>   " +
               "  <td  style='width:100px;height:21px'>     " +
               "  租金  " +
               "  </td>   " +
               "  <td  style='width:100px;height:21px'>    " +
               "  垃圾  " +
               "  </td>   " +
               "  <td style='width:100px;height:21px'>          " +
               "   水費          " +
               "  </td>   " +
                "  <td style='width:100px;height:21px'>          " +
               "   管理          " +
               "  </td>   " +
               "  </tr>    ");
        
            //for (int i = 0; i <= ds.Tables["EXPENSE"].Rows.Count -1; i++)
            //{
            //    for (int j = 0; j <=ds.Tables["EXPENSE"].Columns.Count -1 ; j++)
            //    {
            //        //int k = 1;
            //        TextBox1.Text=ds.Tables["EXPENSE"].Rows(i)(j);
            //        Response.Write(ss);
            //    }
            //}
    }
--------------------编程问答-------------------- 怎么每次提問都沒有人跟我解答啊~~~~
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,