CRM Online Reporting FetchXML (Handy SQL Reporting)

by | Updated November 6, 2020 | Development, Dynamics CRM

CRM Online Reporting with FetchXML Series
Intro: Intro to Series
Part I: How to Set up a Data Source to Access CRM Data in SQL Reporting Services 
Part II: How to Use FetchXML Data in the Report
Part IIa: CRM FetchXML Operators
Part III: Handy SQL Reporting Services Functions for CRM Online Reports

When creating a report in SQL Server Reporting Services, there are a number of tweaks you can make to a report to make it look professional.  Here are a few of my more common changes I like to make to reports.

Create “Banded Rows” – a different background color for each report

This is a way to make your report much easier to read, so I like to do this with all of my SQL Reporting Services reports.  To do this, first you need to highlight the row in the design view:

Project Task

Then click down in the lower right in the Properties box:

SSRS Row Properties

Enter an expression in the Background Color drop arrow to change colors for every other row.  You can substitute in the color of choice for Lemon Chiffron here:

=IIf(RowNumber(Nothing) Mod 2,”LemonChiffon”,”White”)

Date Functions – DateAdd

I like to be able to default in start and end dates for parameters when I do time-based reporting, so I end up using the DateAdd function quite a bit to set the Start date parameter to 7 or 30 days before today.  The DateAdd works like this:

=DateAdd(DateInterval.[Span],[First Value],[Second Value])

So I use it like this:

=DateAdd(DateInterval.Day,-7,Today())

This gives me a start date of 7 days prior to today in the ShortDate format (with no time stamp).  To factor in the hour of the day, use the Now() function instead.

The [Span] values you can use for the DateInterval options are as follows: Year, Quarter, Month, Week, Day, Hour, Minute, Second.  You can sub in short values, such as “hh” for hour, but I figure it’s just easier to use the full name.

Formatting Values with 2 Decimals

In my report I was putting the value for the hours we spend on each task, and our smallest increment of time that we’d record is 15 minutes.  I like to represent the time in hours, so that means the max number of decimals in the report is 2.  I want consistency in the report, so I want all values to have two decimal places.  To make sure this works, you can put an expression around your value to make sure the value has two decimal places:

=FormatNumber(Fields!Data.Value,2)

I hope you find these functions helpful – it had been a year or so since I created a report, so it took a while for it all to come back to me.  Now I have a place to look the next time I get stuck.

Help with CRM 2

Related Posts

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Upcoming Events

september

01sep10:00 am10:30 amEnsuring Quality and Compliance for Batch Manufacturers in Life Sciences

01sep12:00 pm12:30 pmIs it Worth It to Move to the Cloud? A Look at Considerations for Current Agribusinesses Using Dynamics GP

01sep2:00 pm2:45 pmWhat’s New in Dynamics 365 Finance and Supply Chain

09sep11:00 am12:00 pmConfab Live with Stoneridge – Data Strategy and Reporting – Mining Decision Making Insights

15sep10:00 am11:00 amSolving the Biggest Challenges in Agribusiness Through Innovation and Technology

22sep12:00 am12:30 pmSimplifying Payroll and HR Management with ADP Workforce Now

22sep10:00 am10:30 amStreamlining Batch Manufacturing with Technology

22sep2:00 pm2:30 pmProcess Automation for Microsoft Dynamics D365 for Business Central, Finance and Operations and GP

23sep11:00 am12:00 pmConfab LIVE with Stoneridge - Riding the Wave 2 Release – Key Features Coming to Dynamics 365 this October

29sep10:00 am11:00 amTop Five Reasons Why NOW is the Right Time to Move from Salesforce to Dynamics 365 Customer Engagement

29sep12:00 pm12:45 pmUnderstanding Job Costing and Tax Management in Business Central

29sep2:00 pm3:00 pmDigitalizing Horticulture & Agriculture - How to Sell Plants Online and Simplify Business Management

30sep12:00 pm4:00 pmSecurity and Permissions Training for D365 Business Central or Dynamics NAV

october

06oct10:00 am10:30 amPreview of D365 Business Central Fall Release Features and Functionality

06oct12:00 pm12:30 pmInsider's Guide to New Features Available in the Fall Release of D365 Finance and Supply Chain

07oct11:00 am12:00 pmConfab LIVE with Stoneridge - Dataverse and Dynamics in Review – Let’s Get Technical

21oct11:00 am12:00 pmConfab LIVE with Stoneridge - Dataverse and Dynamics in Review – Let’s Get Functional

26oct(oct 26)9:00 am28(oct 28)5:00 pmStoneridge Connect Leadership and Community Conference

About Stoneridge
Stoneridge Software is a unique Microsoft Gold Partner, with emphasis on partner. With specialties in Microsoft Dynamics 365, Microsoft Dynamics AX, Microsoft Dynamics NAV, Microsoft Dynamics GP and Microsoft Dynamics CRM, we focus on attracting the most knowledgeable experts in the field to our team, and prioritize delivering stellar solutions with maximum impact for your business. At Stoneridge, we are deeply committed to your results. Each engagement is met with a dedicated team, ready to provide thorough, tailored, and expert service. Based in Minnesota, we intentionally “step into your shoes,” wherever you are. We focus on what you care about, and develop trusting, long-term relationships with our clients.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X