【问题标题】:Broken images on ssrs report renderingssrs 报告渲染上的损坏图像
【发布时间】:2010-02-19 17:37:49
【问题描述】:

我在呈现报告时难以显示图像。文本全部呈现正常,但图像显示为损坏。我该如何解决这个问题?

我的代码:

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)
        {


        }

【问题讨论】:

    标签: c# reporting-services reportingservices-2005


    【解决方案1】:

    您需要使用从 Render 方法返回的 streamId 调用 RenderStream 方法。

    查看示例:http://ssrsphp.codeplex.com/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多