/// <summary>
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ButtonExport_Click(object sender, EventArgs e)
{
try
{
string fId = Request["fId"].Trim();
DataTable dt = new Mindray.MMIP.EDPManageService.BaseInfo.MATLSAPSynchronizationLogService().GetPortalServiceLogDetail(fId);
DataSet ds = new DataSet();
if (dt != null && dt.Rows.Count > 0)
{
string xmlStr = dt.Rows[0]["FContentXML"].ToString();
HttpResponse resp;
resp = Page.Response;
resp.Clear();
resp.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
resp.Charset = "GB2312";
resp.AppendHeader("Content-Disposition", "attachment;filename=" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xml");
//从DataSet中直接导出XML数据并且写到HTTP输出流中
resp.Write("<?xml version=\"1.0\" encoding=\"gb2312\"?>" + xmlStr);
//写缓冲区中的数据到HTTP头文档中
resp.End();
}
else
{
lblTip.Text = "无XML数据!";
}
}
catch (Exception ex)
{
lblTip.Text = "导出失败,请稍后重试!";
}
}
/// 导出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ButtonExport_Click(object sender, EventArgs e)
{
try
{
string fId = Request["fId"].Trim();
DataTable dt = new Mindray.MMIP.EDPManageService.BaseInfo.MATLSAPSynchronizationLogService().GetPortalServiceLogDetail(fId);
DataSet ds = new DataSet();
if (dt != null && dt.Rows.Count > 0)
{
string xmlStr = dt.Rows[0]["FContentXML"].ToString();
HttpResponse resp;
resp = Page.Response;
resp.Clear();
resp.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
resp.Charset = "GB2312";
resp.AppendHeader("Content-Disposition", "attachment;filename=" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xml");
//从DataSet中直接导出XML数据并且写到HTTP输出流中
resp.Write("<?xml version=\"1.0\" encoding=\"gb2312\"?>" + xmlStr);
//写缓冲区中的数据到HTTP头文档中
resp.End();
}
else
{
lblTip.Text = "无XML数据!";
}
}
catch (Exception ex)
{
lblTip.Text = "导出失败,请稍后重试!";
}
}