Ok, it has been a while since I blogged. One of the reasons for that was that we bought another house and moved last month. This has a huge impact on a family with young children and my wife is pregnant. Right now we are settled and everything is starting to be on its place.
Another reason is, I have to be honest, that after finishing the book my mind was not exactly on writing at all. The book has been publised now for quite a while and I had many nice reactions. I even signed a couple of books which feels very special.
Enough about me, what is this blog entry about. A tip, yes. Number 29 already. There has been a lot of talk about the changes that RDLC reporting brings to Dynamics NAV. A lot of good things, new possibilities, but also a new learning curve for developers. Also for me.
A while ago I was fiddling with formatting in RDLC. The syntax for formatting is different compared to the classic report designer. For example a decimal number can be formatted as #.##000. The format is saved in the Format propery of each field.
Since Dynamics NAV (Navision) can have dynamic decimal formatting depending on the Currency code this format is by default brought over in the DataSet, for example in the Sales Invoice (Report 206, my favorite) you have Sales_Invoice_Line__Line_Amount_Format.Value representing the format for the Line Amount field.
However, for many Navision end-users formatting is not such rocket science. They have formatting which is always the same.
Good news for these scenario's is that RDLC has some formatting shorcuts that can be easily implemented.
Here is a list:
C or c
D or d
E or e
F or f
G or g
N or n
P or p
R or r
X or x
How easy can you have it...
So if you want a DateTime field to be Time formatted you just enter t in the format property. If you enter P0 your percentage will be formatted as 80%. How cool is that.
Formatting Dates is just as easy. The following table lists common .NET Framework date formatting strings.
Full date/time (short time)
Full date/time (long time)
General date/time (short time)
General date/time (long time)
M or m
Y or y
So did I find this out myself? No... I used google. (not Bing, sorry Microsoft).
Here is the link.
Enjoy. I hope to blog more in the near future but no prommisses.
This blog ends here, I am going to prepare my presenatation for Directions USA in october.