如题
解决方案 »
- 小弟初学者,有个疑问。。还望指点。。
- 如何实例化 自定义类型的属性
- 如何在文本框的OnChange事件中得到文本框中的内容?
- 100分[求助]vs2005无法创建word项目
- 如何立即释放系统资源?up有分
- 这道题怎么编写啊?
- 用c#语言的串口读取数据的时候,当数据量较多时,不能1次读取完,必须先读1部分,处理后,再读另外一部分,我想1次全部读完,请问改如何解决
- 学习C#容易吗?我想转到C#,但不知道是不很困难
- 微软的toolbar上工具栏按钮可以绑定onclick事件吗?不是高手不要进,免得自取其辱!!!
- 如何让Form1在Form2中显示?不是弹出窗体,是Form2包含Form1
- 怎样才能在ComboBox下拉列中显示ToolTip信息?
- SHEET拷贝
Response.Buffer = true;
Response.Charset = "GB2312";
string _today = string.Format("{0:yyyyMMdd}", DateTime.Now.Date);
if (ViewState["leaderName"] == null)
{
Response.AppendHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode("领导行程") + "-" + _today + ".xls");
}
else
{
Response.AppendHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode("领导行程") + "-" + Server.UrlEncode(ViewState["leaderName"].ToString()) + "-" + _today + ".xls");
}
Response.ContentEncoding = System.Text.Encoding.UTF7;
Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); ///
Repeater rep = rep_Jourey;
rep.Controls[0].FindControl("delHead").Visible = false;
rep.Controls[0].FindControl("modifyHead").Visible = false;
rep.Controls[0].FindControl("addHead").Visible = false;
//隐藏修改 删除
//if (!Bussiness.IsManager(this))
//{
foreach (RepeaterItem item in rep.Items)
{
if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
HtmlTableCell cell1 = (HtmlTableCell)item.FindControl("null1");
cell1.Attributes.Remove("style"); HtmlTableCell cell2 = (HtmlTableCell)item.FindControl("null2");
cell2.Attributes.Remove("style"); HtmlTableCell cell3 = (HtmlTableCell)item.FindControl("null3");
cell3.Attributes.Remove("style"); HtmlTableCell cell4 = (HtmlTableCell)item.FindControl("null4");
cell4.Attributes.Remove("style"); HtmlTableCell cell5 = (HtmlTableCell)item.FindControl("null5");
cell5.Attributes.Remove("style"); HtmlTableCell cell6 = (HtmlTableCell)item.FindControl("null6");
cell6.Attributes.Remove("style"); HtmlTableCell cell7 = (HtmlTableCell)item.FindControl("null7");
cell7.Attributes.Remove("style"); HtmlTableCell cell8 = (HtmlTableCell)item.FindControl("null8");
cell8.Attributes.Remove("style"); HtmlTableCell cell9 = (HtmlTableCell)item.FindControl("null9");
cell9.Attributes.Remove("style"); HtmlTableCell cell10 = (HtmlTableCell)item.FindControl("null10");
cell10.Attributes.Remove("style"); HtmlTableCell cell11 = (HtmlTableCell)item.FindControl("null11");
cell11.Attributes.Remove("style"); //item.FindControl("null1").Visible = false;
//item.FindControl("null2").Visible = false;
//item.FindControl("null3").Visible = false;
//item.FindControl("null4").Visible = false;
//item.FindControl("null5").Visible = false;
//item.FindControl("null6").Visible = false;
//item.FindControl("null7").Visible = false;
//item.FindControl("null8").Visible = false;
item.FindControl("null9").Visible = false;
item.FindControl("null10").Visible = false;
item.FindControl("hideID").Visible = false;
item.FindControl("td_add").Visible = false;
Repeater rep_in = (Repeater)item.FindControl("rep_in");
foreach (RepeaterItem itemIn in rep_in.Items)
{
if (itemIn.ItemType == ListItemType.Item || itemIn.ItemType == ListItemType.AlternatingItem)
{
itemIn.FindControl("del").Visible = false;
itemIn.FindControl("modify").Visible = false;
itemIn.FindControl("img").Visible = false;
}
}
}
}
//}
rep.RenderControl(oHtmlTextWriter);
/// Response.Output.Write(oStringWriter.ToString());
Response.Flush();
Response.End();