Merge branch 'master' of http://47.104.102.122:3000/lpf/SGGL_SeDin_New
This commit is contained in:
commit
ed76184db2
|
|
@ -7,6 +7,7 @@ using System.Data.SqlClient;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using AspNet = System.Web.UI.WebControls;
|
||||||
|
|
||||||
namespace FineUIPro.Web.HSSE.Check
|
namespace FineUIPro.Web.HSSE.Check
|
||||||
{
|
{
|
||||||
|
|
@ -342,6 +343,59 @@ namespace FineUIPro.Web.HSSE.Check
|
||||||
Response.Write(GetGridTableHtml(Grid1));
|
Response.Write(GetGridTableHtml(Grid1));
|
||||||
Response.End();
|
Response.End();
|
||||||
}
|
}
|
||||||
|
public static string GetGridTableHtml(Grid grid)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||||
|
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||||
|
sb.Append("<tr>");
|
||||||
|
|
||||||
|
foreach (GridColumn column in grid.Columns)
|
||||||
|
{
|
||||||
|
if (column.ColumnID != "Actions" && !column.Hidden)
|
||||||
|
{
|
||||||
|
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sb.Append("</tr>");
|
||||||
|
foreach (GridRow row in grid.Rows)
|
||||||
|
{
|
||||||
|
sb.Append("<tr>");
|
||||||
|
foreach (GridColumn column in grid.Columns)
|
||||||
|
{
|
||||||
|
if (column.ColumnID != "Actions" && !column.Hidden)
|
||||||
|
{
|
||||||
|
string html = row.Values[column.ColumnIndex].ToString();
|
||||||
|
if (column.ColumnID == "tfNumber" && (row.FindControl("labNumber") as AspNet.Label) != null)
|
||||||
|
{
|
||||||
|
html = (row.FindControl("labNumber") as AspNet.Label).Text;
|
||||||
|
}
|
||||||
|
if (column.ColumnID == "CheckManNames" && (row.FindControl("Label2") as AspNet.Label) != null)
|
||||||
|
{
|
||||||
|
html = (row.FindControl("Label2") as AspNet.Label).Text;
|
||||||
|
}
|
||||||
|
// 处理CheckBox
|
||||||
|
if (html.Contains("f-grid-static-checkbox"))
|
||||||
|
{
|
||||||
|
if (!html.Contains("f-checked"))
|
||||||
|
{
|
||||||
|
html = "×";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
html = "√";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sb.AppendFormat("<td style='vnd.ms-excel.numberformat:@;width:140px;'>{0}</td>", html);
|
||||||
|
// sb.AppendFormat("<td>{0}</td>", html);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.Append("</tr>");
|
||||||
|
}
|
||||||
|
sb.Append("</table>");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
protected void rbStates_SelectedIndexChanged(object sender, EventArgs e)
|
protected void rbStates_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue