Zahara Hirani, MCAD
Crowe Chizek and Company LLC
July 31st, 2007
http://www.crowecrm.com
Summary: Zahara shows the steps needed to build a table report for Microsoft Dynamics CRM without using any wizards.
Creating a report using Visual Studio 2005
- Open Visual Studio 2005.
- Click on the File menu on the menu bar, point to Open, and then click Project/Solution.
-
In the New Project pop-up,
- Under Project Types, select the Business Intelligence Projects. Under Templates, select Report Server Project Wizard.
- Give the project a new name (e.g. AdventureWorksReports). Browse to a location where you wish to create the project.
- The Solution Name will be automatically populated with the Project Name that you specified earlier.
- Click OK.
- Click the View menu bar, and select Solution Explorer.
- This should open the solution Explorer on the right.
- Right click Shared Data Sources
- Enter the name of the shared Data source (e.g. AdventureWork_MSCRM)
- Select Type as Microsoft SQL Server
-
Enter the Connection string as Data Source=Servername;Initial Catalog=Databasename
- Click OK.
- Right click the folder named Report
- Select Add
- Select New Item
-
This should open a pop-up window to specify what type of item to add
- Select Report
- Enter the name of the report (e.g. OpportunityByOwner.rdl)
- Click Add
- This should create a new report and place it under the Report folder in the Solution Explorer.
- This should also open the report and select the Data tab.
-
Click the Dataset dropdown list and select <New Dataset...>
- Enter the name of the Dataset (e.g. OpportunityDS)
- Select the Data Source to use for the Data Set (e.g. AdventureWork_MSCRM)
- Select the Command Type (e.g. Text)
-
Enter the query to get the data.
- Click Ok.
- Execute the query by clicking the (
) Run button.
-
The records should display under the query statement.
- Click on the 'Layout' tab.
-
Click on 'View' from the top menu bar and select 'Toolbox'
- This should give you a list of all tools that can be used to setup the report layout.
- Drag and Drop the 'Table' tool from the Toolbox to your Layout tab body section.
- Right click the table in the Layout tab and select Properties.
- Select the Dataset that will be used to populate the table.
-
Select other header and footer properties for the report.
-
Navigate thru the tabs and select other properties for the report.
-
Sorting:
-
Grouping:
- Click on Add to add a group by field.(e.g. Group by Opportunity owner)
- Click OK.
-
Add a second group to group by customer
- Click OK.
- Click OK.
- Click on 'View' from the top menu bar and select 'Datasets'
-
This should give you a tree view of all datasets contained in the report and the fields each data set returns.
- Enter the display name for each column in the Header section of the table.
- Drag and drop the fields to display in each column as desired in the Detail section of the table.
- If you have fields for which total needs to be calculated, add the field to the footer row. (SRS will automatically add the SUM() function to the column).
- Edit the style information based on what you would like to display.
-
Click on the 'Preview' tab to see the report.
The report should now open in preview mode with the results.
- You will notice the report shows the opportunities grouped first by the Owner (i.e. Jeremy Cox owns 7 opportunities for 4 customers and Zahara Hirani owns 2 opportunities for 2 customers).
- The second grouping is by customer (i.e. Nancy Hirota has 2 opportunities open).
- The detail shows which stage each opportunity for a customer is at with the probability of closing and the rating.
- The total per customer is summed and displayed in the customer group footer.
- The total per owner is summed and displayed in the owner group footer.
- The total for all opportunities is displayed in the table footer.
Zahara Hirani, MCAD is a Microsoft CRM developer at Crowe Chizek (www.crowecrm.com) Zahara currently focuses on .NET / SQL / SRS development on the Microsoft Dynamics CRM 3.0 platform.