Step 1. Set the “Language” report properties according to your regional requirements. In my case: “es-MX” Step 2. Use the respective Expression, im have: CDbl(Fields!SALE_PRICE.Value).ToString(“C”) When the report running you have before: and after Background Color If you want that the alternate row in a table will be other color, you have to click on the row on Background Color and insert the following expression: =IIF(RowNumber(“Statements”) Mod 2, “White”, “WhiteSmoke”) Change Language If you can change the language of a report it is necessary that you create a parameter (for…
Month: August 2014
Anonymous View Models in ASP.NET MVC Using Dynamics
The introduction of the dynamic keyword in C# 4.0 allows you to do a lot of things you couldn’t do otherwise, but it also makes it easy to forget that C# is still not a dynamic language, so there are limitations. Recently I found myself wanting to whip up a quick test page for something, with a very simple controller action and view. It wasn’t meant to be permanent, so creating a dedicated view model class in the project seemed like overkill. I figured I could just return an anonymous…
Why does Html.ActionLink render “?Length=4â€
I’m VERY confused as to why this code Html.ActionLink(“About”, “About”, “Home”, new { hidefocus = “hidefocus” }) results in this link: <a hidefocus=”hidefocus” href=”/Home/About?Length=4″>About</a> The hidefocus part is what I was aiming to achieve, but where does the “?Length=4” come from? Solution The Length=4 is coming from an attempt to serialize a string object. Your code is running this ActionLink method: public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues, object htmlAttributes) This takes a string object “Home” for routeValues, which the MVC plumbing searches for public…
Globalization and Localization of Model Validation Messages in MVC
In this quick article you will learn how to globalize and localize the model validation messages in MVC Applications. At the end of this article, you will also learn how to display the localized message (greeting) on the page. Here is what we will build. I will use ASP.NET resource files to define the globalized (default) and localized strings and this string message will be displayed to the user based on the request header language that the client browser sends. Now, follow the steps from here. Step 1 To…