使用BIDS for CRM 2011在SSRS报告中显示图像

问题描述:

我正在为BIDS for CRM 2011内部部署BIDS构建SSRS报告。我的报告需要显示附加到记录的注释ID的图像。使用BIDS for CRM 2011在SSRS报告中显示图像

我有两个图像附加到一个记录和三个记录总数。发生的情况是,当我运行报告时,图像仅与报告的第一条记录一起显示,并且该图像也不是附加的记录。

这是我对报告的sql查询。

select Annotation.DocumentBody, 
     inmate_FirstName, inmate_LastName,inmate_MiddleName,inmate_BookingNumber, inmate_InmateNumber,inmate_DOB,inmate_Gender, 
     inmate_BookingDate, inmate_Race 

from new_bookingscreen1 left outer join 
    Annotation on new_bookingscreen1.new_bookingscreen1Id = Annotation.ObjectId 

什么我的猜测是,当我在报告中添加图像控件,它只是简单地向我展示形象,是无论如何也不能与报告。正如上面粘贴的报告查询与图像控件之间没有关联。

我该如何解决这个问题?

我在图像工具的表达式字段中使用此=First(Fields!DocumentBody.Value, "DataSet1")

如何将报表查询结果绑定到图片工具结果?

+1

? –

您正在使用First() SSRS的功能其中Returns the first value来自指定表达式。试试这个

=Fields!DocumentBody.Value 

唯一的你为什么要使用First()函数提出你真正做类似的东西需要的Imagies ..

select Pic.Col1, inmate_FirstName, inmate_LastName,inmate_MiddleName 
     ,inmate_BookingNumber, inmate_InmateNumber,inmate_DOB,inmate_Gender,inmate_BookingDate, inmate_Race 


from new_bookingscreen1 OUTER APPLY (
            SELECT TOP 1 Annotation.DocumentBody 
            FROM Annotation 
            WHERE ObjectId = new_bookingscreen1.new_bookingscreen1Id 
            ORDER BY -- Your Condition (How you decide which one is the 1st Picture) 
            ) Pic(Col1) 
+0

我希望我的查询只返回与实体相关的几个中的第一个图像。图像保存在注释中。 – hkhan

+0

我改变了你的查询请看看,让我知道,如果钛帮助。 –