C#.NET 通过button 实现RadGrid 中数据导出,具体代码如下,先执行后,没有反映!求解
protectedvoidbtnDownload_Click(objectsender,EventArgse){IRIS_FAirisFA=newIRIS_FA();Da...
protected void btnDownload_Click(object sender, EventArgs e)
{
IRIS_FA irisFA = new IRIS_FA();
DataTable dt = irisFA.SelectByDate1(DateTime.Now);
if (dt.Rows.Count == 0)
ExecuteJavascript(UpdatePanel1, "alert('没有数据,无需导出!! ');window.location='FA_Input.aspx';");
else
{
//导出Excel
string format = "yyyyMMdd";
string stringValue = DateTime.Now.ToString(format);
RadGrid2.DataSource = dt;
RadGrid2.DataBind();
RadGrid2.ExportSettings.IgnorePaging = true;
RadGrid2.ExportSettings.OpenInNewWindow = true;
RadGrid2.ExportSettings.FileName = "FA_ErrorCode_Download_" + stringValue;
RadGrid2.MasterTableView.ExportToExcel();
}
} 展开
{
IRIS_FA irisFA = new IRIS_FA();
DataTable dt = irisFA.SelectByDate1(DateTime.Now);
if (dt.Rows.Count == 0)
ExecuteJavascript(UpdatePanel1, "alert('没有数据,无需导出!! ');window.location='FA_Input.aspx';");
else
{
//导出Excel
string format = "yyyyMMdd";
string stringValue = DateTime.Now.ToString(format);
RadGrid2.DataSource = dt;
RadGrid2.DataBind();
RadGrid2.ExportSettings.IgnorePaging = true;
RadGrid2.ExportSettings.OpenInNewWindow = true;
RadGrid2.ExportSettings.FileName = "FA_ErrorCode_Download_" + stringValue;
RadGrid2.MasterTableView.ExportToExcel();
}
} 展开
1个回答
2017-01-19
展开全部
设个断点一步步走
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询