web.config中我需要认证<authentication mode="Forms"/>
<authorization>
<deny users="?"/>
</authorization>
结果用水晶报表倒出成word的时候,导出的报表页面就变成了登陆页面,我发现如果我装的是office xp就正常成报表,如果是office 2000就成了登陆页面Login.aspx,请高手指教!以下是导出程序
/// <summary>
/// 导出报表
/// </summary>
public void ExportDocument()
{
ExportOptions crExportOptions=new ExportOptions();
DiskFileDestinationOptions crDestinationOptions=new DiskFileDestinationOptions();
crDestinationOptions.DiskFileName=exportPath;
crExportOptions=rc.ExportOptions; crExportOptions.DestinationOptions=crDestinationOptions;
crExportOptions.ExportDestinationType=ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType=format;
rc.Export(); System.Web.HttpResponse Response=System.Web.HttpContext.Current.Response;
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType=contentType;
// Response.AppendHeader("",
Response.WriteFile(exportPath);
Response.Flush();
Response.Close(); try
{
System.IO.File.Delete(exportPath);
}
catch
{
}
}
<authorization>
<deny users="?"/>
</authorization>
结果用水晶报表倒出成word的时候,导出的报表页面就变成了登陆页面,我发现如果我装的是office xp就正常成报表,如果是office 2000就成了登陆页面Login.aspx,请高手指教!以下是导出程序
/// <summary>
/// 导出报表
/// </summary>
public void ExportDocument()
{
ExportOptions crExportOptions=new ExportOptions();
DiskFileDestinationOptions crDestinationOptions=new DiskFileDestinationOptions();
crDestinationOptions.DiskFileName=exportPath;
crExportOptions=rc.ExportOptions; crExportOptions.DestinationOptions=crDestinationOptions;
crExportOptions.ExportDestinationType=ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType=format;
rc.Export(); System.Web.HttpResponse Response=System.Web.HttpContext.Current.Response;
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType=contentType;
// Response.AppendHeader("",
Response.WriteFile(exportPath);
Response.Flush();
Response.Close(); try
{
System.IO.File.Delete(exportPath);
}
catch
{
}
}
查一下帮助文件,就知道,response.close会关闭Session,引发Session_end事件,相当于你login out了哈。