Formatting Columns in SSRS Reports

by | Updated August 15, 2016 | Development, Dynamics AX

When working on SSRS reports in the Dynamics AX 2012 reporting framework, a lot of the information comes over from the MorphX Extended Data Types.  However, there are still times when you need to work in SSRS to make the format of the column match what your client requests.

For example, say you are calculating a percentage for your report, and your client wants to have the column display the value to one decimal place.  Also, the requirement is to show 0.0 if the value comes in as 0.  There really are a couple of ways to do this.

1.   From what I have seen, the recommended approach is to use the Format property of the textbox that contains your value.  Set the property to the following:

  • ###,##0.0

 

  • This will put a comma between the hundreds and thousands column (if applicable to the value) and will default 0.0 into the column if the value is 0, otherwise the value will show up with a single decimal place.

 

 2.   Right click on the textbox, and choose Properties from the menu that appears.  This allows you to control the formatting of the text that comes into the textbox based on the type of data (General, number, currency, etc.).  Set the appropriate values based on the Development criteria for your data.

 

3.   You can use an expression to do the work for you.  The expression would be something like the following:

 

  • =Format(Fields!Mypercentfield.Value,”###,##0.0”)

 

  • This will do the same as the first example.

 

So, the question is, why bring this up?  The reason I do so is, what happens if the client decides they want to have a percent sign ‘%’ be displayed after the value?  If you use the formatting method where you set the format on the column, if you try to append a ‘%’ to the value, the report will show #Error in that column.  BUT, if you use the second method, you can do an expression like the following (NO formatting property configuration on the text box):

=Format(Fields!Mypercentfield.Value,”###,##0.0”) + “  %”

 

This gives you additional flexibility in formatting the column, as you are not limiting what goes in the column by using the Format property of the textbox.  I prefer to use the first method, but there are times where that just won’t work.

 

 

Related Posts

  • SSRS in the Parameters Node If you regularly develop Dynamics AX 2012 reports you have likely seen the report parameters displayed in SSRS under the Parameters node.  It is the…

  • If the Debugger will not break in your SQL Server Reporting Services Report and/or you want to speed up the debugging session by not printing the report and only stepping…

  • The other day when I was going through one another check (cheque) customization in AX 2012, I found that there was one more possible solution that I did not discuss…

0 Comments

Submit a Comment

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

Upcoming Events

august

12aug10:00 am10:30 amWhy Levridge Grain? How to Achieve Efficient and Accurate Scale Tickets

12aug12:00 pm1:00 pmThe Three Paths to Dynamics 365 Finance and Supply Chain from Dynamics AX

13aug11:00 am12:00 pmConfab with Stoneridge - Livestream - Inspire Keynote Breakdown

19aug10:00 am11:00 amWhat is Levridge? An Overview of the Ultimate Ag Solution

19aug12:00 pm12:30 pmThe Modern Manufacturer - Death by Safety Stock

27aug12:00 pm1:00 pmConfab with Stoneridge - Livestream - Dynamics 365 2020 Wave 2 Preview

september

02sep10:00 am10:30 amThe Modern Manufacturer - Cycle Count Management

09sep10:00 am11:00 amWhat is Levridge? An Overview of the Ultimate Ag Solution

16sep10:00 am10:30 amThe Modern Manufacturer - Product Lifecycle Management

30sep10:00 am10:30 amThe Modern Manufacturer - Return Management

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