ssrs 报告渲染上的图像损坏
当我提交报告时,我很难显示图像。文本全部呈现良好,但图像显示为损坏。我该如何解决这个问题?
我的代码:
ReportExecutionServiceSoapClient rs = new ReportExecutionServiceSoapClient();
rs.ClientCredentials.Windows.AllowedImpersonationLevel =
System.Security.Principal.TokenImpersonationLevel.Impersonation;
byte[] result = null;
string encoding, mimeType, extension, DeviceInfo = null;
ReportExecution2005.Warning[] warnings = null;
string[] streamIds = null;
DeviceInfo = "<DeviceInfo><StreamRoot>/Temp/Images/</StreamRoot><HTMLFragment>True</HTMLFragment></DeviceInfo>";
//ReportExecution2005.LogonUserResponse luResp = LogonUserE();
//rs.LogonUser()
try
{
string historyId = null;
ExecutionInfo executionInfo;
ExecutionHeader executionHeader;
ServerInfoHeader serverInfoHeader;
List<ParameterValue> parameterValues = new List<ParameterValue>();
ParameterValue param1= new ParameterValue();
param1.Name = "Id";
param1.Value = "17";
ParameterValue year = new ParameterValue();
year.Name = "Year";
year.Value = "2009";
ParameterValue region = new ParameterValue();
region.Name = "RegionId";
region.Value = "0";
parameterValues.Add(param1);
parameterValues.Add(year);
parameterValues.Add(region);
serverInfoHeader = rs.LogonUser("user", "pass", null);
executionHeader = rs.LoadReport(null, ReportPath, historyId, out serverInfoHeader,
out executionInfo);
rs.SetExecutionParameters(executionHeader, null, parameterValues.ToArray(), "en-us", out executionInfo);
rs.Render(executionHeader, null, "HTML4.0", DeviceInfo, out result, out extension, out mimeType,
out encoding, out warnings, out streamIds);
report.InnerHtml = System.Text.Encoding.ASCII.GetString(result);
}
catch (SoapException ex)
{
}
I am having difficulty getting images to display when I render a report. The text all renders fine, but the images appears as broken. How do I fix this?
My code:
ReportExecutionServiceSoapClient rs = new ReportExecutionServiceSoapClient();
rs.ClientCredentials.Windows.AllowedImpersonationLevel =
System.Security.Principal.TokenImpersonationLevel.Impersonation;
byte[] result = null;
string encoding, mimeType, extension, DeviceInfo = null;
ReportExecution2005.Warning[] warnings = null;
string[] streamIds = null;
DeviceInfo = "<DeviceInfo><StreamRoot>/Temp/Images/</StreamRoot><HTMLFragment>True</HTMLFragment></DeviceInfo>";
//ReportExecution2005.LogonUserResponse luResp = LogonUserE();
//rs.LogonUser()
try
{
string historyId = null;
ExecutionInfo executionInfo;
ExecutionHeader executionHeader;
ServerInfoHeader serverInfoHeader;
List<ParameterValue> parameterValues = new List<ParameterValue>();
ParameterValue param1= new ParameterValue();
param1.Name = "Id";
param1.Value = "17";
ParameterValue year = new ParameterValue();
year.Name = "Year";
year.Value = "2009";
ParameterValue region = new ParameterValue();
region.Name = "RegionId";
region.Value = "0";
parameterValues.Add(param1);
parameterValues.Add(year);
parameterValues.Add(region);
serverInfoHeader = rs.LogonUser("user", "pass", null);
executionHeader = rs.LoadReport(null, ReportPath, historyId, out serverInfoHeader,
out executionInfo);
rs.SetExecutionParameters(executionHeader, null, parameterValues.ToArray(), "en-us", out executionInfo);
rs.Render(executionHeader, null, "HTML4.0", DeviceInfo, out result, out extension, out mimeType,
out encoding, out warnings, out streamIds);
report.InnerHtml = System.Text.Encoding.ASCII.GetString(result);
}
catch (SoapException ex)
{
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用从 Render 方法返回的 StreamId 来调用 RenderStream 方法。
请参阅以下示例:http://ssrsphp.codeplex.com/
You'll need to call the RenderStream method using the streamIds that you get back from the Render method.
see the example at: http://ssrsphp.codeplex.com/