0
我正在從Intranet站點加載SSRS報告。當我轉到SSRS報告管理器並將文檔導出到Excel時,它將導出所有項目。當通過網址訪問時,SSRS到Excel缺失圖像和標題
然而,當我做同樣的事情,但通過網頁我錯過了一些頭文件和圖像。
這裏是我的C#代碼
Microsoft.Reporting.WebForms.ReportViewer rview = new Microsoft.Reporting.WebForms.ReportViewer();
rview.ServerReport.ReportServerUrl = new Uri(uri);
rview.ServerReport.ReportPath = "/T200/MiscAsset";
//For the ReportServerCredentials public class CustomReportCredentials must be added to the code
Microsoft.Reporting.WebForms.IReportServerCredentials irsc = new CustomReportCredentials(user, pass, domain);
rview.ServerReport.ReportServerCredentials = irsc;
if (_mode == null)
{
_mode = "PDF";
}
string deviceInfo, mimeType, encoding, extention;
string[] streamaids;
Microsoft.Reporting.WebForms.Warning[] warnings;
deviceInfo = "<DeviceInfo>" + "<SimplePageHeaders>True</SimplePageHeaders>" + "</DeviceInfo>";
byte[] bytes = rview.ServerReport.Render(_mode, deviceInfo, out mimeType, out encoding, out extention, out streamaids, out warnings);
Response.Clear();
if (_mode == "PDF")
{
Response.ContentType = "application/pdf";
Response.AddHeader("Content-disposition", "filename=MiscAsset.pdf");
}
else if (_mode == "excel")
{
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-disposition", "filename=MiscAsset.xls");
}
Response.OutputStream.Write(bytes, 0, bytes.Length);
Response.OutputStream.Flush();
Response.OutputStream.Close();
Response.Flush();
Response.Close();
你到目前爲止解決了什麼問題?你遇到了什麼問題,你在調試過程中得到了什麼信息? – Jeroen 2013-05-01 18:36:40