Domanda

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
È stato utile?

Soluzione

The CRM <-> SSRS connector should apply the pre filter to your new_bookingscreen1 entity when you alias it as CRMAF_Filterednew_bookingscreen1.

The problem is probably that you're aliasing the results of the subquery instead of the table.

I would recommend you either eliminate the subquery all together by changing:

    (select Filterednew_bookingscreen1.* from Filterednew_bookingscreen1) 
     as CRMAF_filterednew_bookingscreen1

to

    Filterednew_bookingscreen1 as CRMAF_filterednew_bookingscreen1

or put the alias on the table in the subquery by changing:

    (select Filterednew_bookingscreen1.* from Filterednew_bookingscreen1)
      as CRMAF_filterednew_bookingscreen1

to

    (select CRMAF_filterednew_bookingscreen1.* from Filterednew_bookingscreen1 
     as CRMAF_filterednew_bookingscreen1) as bookingscreen1
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top