Hi,
I am new to creating reports in CRM 2011. I have a requirement to create a report that - list all activties
a) related to an opportunity
and b) related to the primary contact of an opportunity
and c) related to the account of the opportunity
The report should be designed to work for any selected opportunity.
MY APPROACH :
I have create a SQL query that joins the opportunity filtered view with the ActivityPointer filtered view and finds the activities for that opportunity, another SQL query that joins the opportunity and contacts filtered view to the ActivityPointer view, and another SQL query that joins the opportunity and account filtered view to the ActivityPointer view. In the end I do a UNION ALL of these three SQL queries. This resulting SQL query works perfect. I need to create a report in CRM to make the same SQL work for a selected opportunity. I am unable to do this. The steps I follwed are as follows.
Datasource Properties : Name : DataSource1
Credentials: Use Windows Authentication(integrated security)
Datasets: I have created 2 datasets - Dataset1 and Dataset2
Dataset 1 provides the opportunity id to the Dataset2. Then Datset2 uses the same opportunity id to generate a list of all the activities for that opportunity id.
Report Parameters : Name: CRM_SelectedOpportunity
Prompt: Selected Opportunity
Data type: text Tick - Allow blank value Tick : Allow null value Select parameter visibility :Visible
Available Values: 'Get value from query' Dataset : DataSet1(select from dropdown) Value field: opportunityid(select from dropdown) Label field : name(select from dropdown)
Default Values: 'Get value from query' Dataset : DataSet1(select from dropdown) Value field: opportunityid(select from dropdown) Label field : name(select from dropdown)
Then I design a table on the Report Layout with the fields from the Dataset2 and preview it in VisualStudio.
I get the 'Selected Opportunity' parameter prompt for a dropdown that lists all the opportunity names correctly. I select one opportunity and click '' View Report'.
The report displays the list of all activities correctly. This proves my SQL query of DataSet2 is perfect.
My big problem is how to customise this report to work in CRM.
Can anyone help me by telling the steps to follow to change this above mentioned report to work for a particular record in CRM ???
Cheers!