I'm having a show-stopping issue with the ReportViewer component that's part of SSRS. I'm working on a WinForms application and have a couple of local reports that show DateTime
values from the database in various locations. Regardless of how the formatting is done (no formatting at all, using "d" in the Format
property, or using FormatDateTime
with any of the DateFormat enumeration values), it always appears to format the DateTime with the en-US culture rather than the system date and number formatting culture.
I've validated that CurrentCulture
is as expected. The report language is set to "Default". The Language
tag is not even present in the .rdlc file. If I change the report language then it appears to reflect the formatting for that culture regardless of the system culture.
Is there a way either to render the report with the current system culture, or programmatically modify the language of the report based upon the culture?
It turns out that "Default" as a Language setting doesn't do much. In order to pick up the user's current culture, Language has to be specified as the expression "=User.Language" (this also needs to be set on all subreports, as the value doesn't propagate or inherit).
Credit to Chris May in his blog article on the subject.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With