The problem is related to culture-sensitive processing of parameter input from your CR application code. CR seems to be poorly designed when it comes to multilingual support in specific situations, such as that.
The solution, although ugly, is as follows.
For each Date
, Time
or DateTime
parameter field that you have in your report, follow these steps:
- In the CR designer, change the type of the parameter field to
String
. Create a new formula field and set its value to one of the following values:
CDate({?ParamFieldName}) // Date CTime({?ParamFieldName}) // Time CDateTime({?ParamFieldName}) // DateTime
depending on the type of source parameter, where ParamFieldName
is the name of your parameter field.
In the application code, pass the parameter value in one of the following ways:
// Date report.SetParameterValue( "ParamFieldName", DateTimeObject.ToShortDateString().TrimEnd('.')); // Time report.SetParameterValue( "ParamFieldName", DateTimeObject.ToShortTimeString()); // DateTime report.SetParameterValue( "ParamFieldName", string.Format("{0} {1}", DateTimeObject.ToShortDateString().TrimEnd('.'), DateTimeObject.ToShortTimeString()));
- In the CR designer, insert the formula fields instead of the parameter fields and format their display in the CR designer.
This has been tested on several cultures.
The end point in the date string is truncated because CR, for unknown reasons, cannot process the point, even in cultures that have a point at the end of the dates (for example, Serbian - 14.3.2015.
)
source share