0

I am building a SSRS report in BIDS for my crm 2011 on-premise. Following is my query to show the record along with the image saved in annotation of the record.

When I run the query it returns the result for all the records rather than the one record from where I run it from. I want it to return the result of one record only, the record that I have chosen.

How do I modify it to pre filter it? I have tried numerous options by putting WHERE clause but to no avail. Help needed guys.

select inmate_fullname,inmate_BookingNumber, inmate_InmateNumber,inmate_reportbookingdate,inmate_reportdob,
            inmate_reportgender, inmate_reportrace, Annotation.DocumentBody


    from (select Filterednew_bookingscreen1.* from Filterednew_bookingscreen1)
    as CRMAF_filterednew_bookingscreen1 left outer join Annotation on 
    CRMAF_filterednew_bookingscreen1.new_bookingscreen1Id =Annotation.ObjectId
4

1 回答 1

1

当您将其别名为 CRMAF_Filterednew_bookingscreen1 时,CRM <-> SSRS 连接器应将预过滤器应用于您的 new_bookingscreen1 实体。

问题可能是您正在对子查询的结果而不是表进行别名。

我建议您通过更改来消除所有子查询:

    (select Filterednew_bookingscreen1.* from Filterednew_bookingscreen1) 
     as CRMAF_filterednew_bookingscreen1

    Filterednew_bookingscreen1 as CRMAF_filterednew_bookingscreen1

或通过更改将别名放在子查询中的表上:

    (select Filterednew_bookingscreen1.* from Filterednew_bookingscreen1)
      as CRMAF_filterednew_bookingscreen1

    (select CRMAF_filterednew_bookingscreen1.* from Filterednew_bookingscreen1 
     as CRMAF_filterednew_bookingscreen1) as bookingscreen1
于 2014-03-14T15:27:43.663 回答