遍历ArrayList:
ArrayList tableHead = new ArrayList();
tableHead = ReportsProcess.TableHead(baoBiaoXinXi, LabelZhuJian.Text.Trim());
// 遍历ArrayList
foreach (object obj in tableHead)
{
Response.Write(obj.ToString());
}
tableHead = ReportsProcess.TableHead(baoBiaoXinXi, LabelZhuJian.Text.Trim());
// 遍历ArrayList
foreach (object obj in tableHead)
{
Response.Write(obj.ToString());
}
/// <summary>
/// 表头设置
/// </summary>
/// <param name="baoBiaoXinXi">报表信息表</param>
/// <param name="sn">报表主键</param>
/// <returns></returns>
public static ArrayList TableHead(string baoBiaoXinXi, string sn)
{
ArrayList tableHead = new ArrayList();
String conn = OracleHelper.DatabaseConnStr;
String queryBiaoTou = "SELECT * FROM " + baoBiaoXinXi + " WHERE SN='" + sn+ "' ";
OracleDataReader drBiaoTou = OracleHelper.ExecuteReader(conn, CommandType.Text, queryBiaoTou, null);
while (drBiaoTou.Read())
{
tableHead.Add("<table><tr><td>报表日期:</td><td>" + drBiaoTou.GetString(0) + "</td></tr>");
tableHead.Add("<table><tr><td>报表编号:</td><td>" + drBiaoTou.GetString(1) + "</td></tr></table>");
tableHead.Add("<table><tr><td>报表名称:</td><td>" + drBiaoTou.GetString(2) + "</td></tr></table>");
tableHead.Add("<table><tr><td>编制单位:</td><td>" + drBiaoTou.GetString(3) + "</td></tr></table>");
tableHead.Add("<table><tr><td>企业负责人:</td><td>" + drBiaoTou.GetString(4) + "</td></tr></table>");
tableHead.Add("<table><tr><td>统计负责人:</td><td>" + drBiaoTou.GetString(5) + "</td></tr></table>");
tableHead.Add("<table><tr><td>填表人:</td><td>" + drBiaoTou.GetString(6) + "</td></tr></table>");
tableHead.Add("<table><tr><td>联系电话:</td><td>" + drBiaoTou.GetString(7) + "</td></tr></table>");
tableHead.Add("<table><tr><td>报出日期:</td><td>" + drBiaoTou.GetString(8) + "</td></tr></table>");
tableHead.Add("<table><tr><td>主管领导:</td><td>" + drBiaoTou.GetString(9) + "</td></tr></table>");
tableHead.Add("<table><tr><td>备注:</td><td>" + drBiaoTou.GetString(10) + "</td></tr></table>");
tableHead.Add("<table><tr><td>录入人:</td><td>" + drBiaoTou.GetString(11) + "</td></tr></table>");
tableHead.Add("<br>");
}
drBiaoTou.Close();
return tableHead;
}
/// 表头设置
/// </summary>
/// <param name="baoBiaoXinXi">报表信息表</param>
/// <param name="sn">报表主键</param>
/// <returns></returns>
public static ArrayList TableHead(string baoBiaoXinXi, string sn)
{
ArrayList tableHead = new ArrayList();
String conn = OracleHelper.DatabaseConnStr;
String queryBiaoTou = "SELECT * FROM " + baoBiaoXinXi + " WHERE SN='" + sn+ "' ";
OracleDataReader drBiaoTou = OracleHelper.ExecuteReader(conn, CommandType.Text, queryBiaoTou, null);
while (drBiaoTou.Read())
{
tableHead.Add("<table><tr><td>报表日期:</td><td>" + drBiaoTou.GetString(0) + "</td></tr>");
tableHead.Add("<table><tr><td>报表编号:</td><td>" + drBiaoTou.GetString(1) + "</td></tr></table>");
tableHead.Add("<table><tr><td>报表名称:</td><td>" + drBiaoTou.GetString(2) + "</td></tr></table>");
tableHead.Add("<table><tr><td>编制单位:</td><td>" + drBiaoTou.GetString(3) + "</td></tr></table>");
tableHead.Add("<table><tr><td>企业负责人:</td><td>" + drBiaoTou.GetString(4) + "</td></tr></table>");
tableHead.Add("<table><tr><td>统计负责人:</td><td>" + drBiaoTou.GetString(5) + "</td></tr></table>");
tableHead.Add("<table><tr><td>填表人:</td><td>" + drBiaoTou.GetString(6) + "</td></tr></table>");
tableHead.Add("<table><tr><td>联系电话:</td><td>" + drBiaoTou.GetString(7) + "</td></tr></table>");
tableHead.Add("<table><tr><td>报出日期:</td><td>" + drBiaoTou.GetString(8) + "</td></tr></table>");
tableHead.Add("<table><tr><td>主管领导:</td><td>" + drBiaoTou.GetString(9) + "</td></tr></table>");
tableHead.Add("<table><tr><td>备注:</td><td>" + drBiaoTou.GetString(10) + "</td></tr></table>");
tableHead.Add("<table><tr><td>录入人:</td><td>" + drBiaoTou.GetString(11) + "</td></tr></table>");
tableHead.Add("<br>");
}
drBiaoTou.Close();
return tableHead;
}