ms reportviewer 外联图片不显示的处理方式

在MS ReportViewer中加上LOGO,在开发过程中一切正常,部署到外网,LOGO不能显示

第一种方式:

图片地址格式化形如:

file:\\\c:\website\logo.jpg

或者

file:c:\website\logo.jpg

问题解决。

 

第二种方式:

            ReportViewer1.LocalReport.EnableExternalImages true;
            ReportViewer1.LocalReport.Refresh();


Code

    public partial class Report : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var path = "file:" + Server.MapPath("\\logo.png");
                ReportViewer1.LocalReport.EnableExternalImages = true;
                ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter("Logo1", path));
                ReportViewer1.LocalReport.Refresh();
            }
        }
    }

-------------------------------------------------

Hi!!
Solved.
i hust passed has parameter maptofileimage = "file:\\\\\\" + HttpContext.Current.Server.MapPath("~/barcodes") + "\\"
and put
in the image value
=Parameters!mapa.Value + Fields!image.Value
and with this i solved the problem... finally
Thank's very much for your concern.
Marco

参考:

http://answers.flyppdevportal.com/categories/csharp/csharpgeneral.aspx?ID=ff1a2f5b-896f-4eee-919d-97f6e654295b

posted @ 2013-03-14 10:39  I'm CY  阅读(734)  评论(0编辑  收藏  举报