【问题标题】:How to send array of images to rdlc reports?如何将图像数组发送到 rdlc 报告?
【发布时间】:2016-03-03 20:38:12
【问题描述】:

我需要向报告发送标题和一些图片,这是我的课程

public class ReportDataModel
    {
        public string Text { get; set; }
        public IEnumerable<byte[]> Images { get; set; }
    }

当我创建一个报告文件并将这个类设置为数据源类,然后在设计中我拖动报告上的图像字段时,在运行时而不是图像显示“#Error”。 提前致谢。

【问题讨论】:

    标签: c# reporting rdlc


    【解决方案1】:

    您当前的ReportDataModel 使用主从结构。因此,除非您使用像 First(Fields!Image.Value) 这样的表达式,否则无法在不显示 "#Error" 的情况下将拖放图像属性拖放到报告中。

    ReportDataModel 更改为以下内容:

      public  class ReportDataModel
      {
         public string Text { get; set; }
         public byte[] Image { get; set; } 
      }
    

    然后不要直接在报表上拖动Image字段,而是从工具箱中拖动一个图像,将图像源设置为数据库,选择您的图像字段并设置MIME 类型。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-22
      • 1970-01-01
      • 2017-12-16
      • 1970-01-01
      • 1970-01-01
      • 2015-09-26
      • 2012-03-04
      相关资源
      最近更新 更多