When adding a DateTime variable like this:
Code: Select all
stiReport.Dictionary.Variables.Add("Variables", "DateTime1", "Date / Time", DateTime.Now);
then it is converted to a ShortDateString and back to DateTime, so that the time information get's lost. I've checked this in the source and it seem to be done be intend. But why? It doesn't seem to make any sense to me, to strip off the time from a DateTime variable.
And the workaround is kinda ugly:
Code: Select all
stiReport.Dictionary.Variables.Add("Variables", "DateTime2", "Date / Time", typeof(DateTime), DateTime.Now.ToString("yyyy-MM-dd HH:mm tt"), false);
...just curious,
Tobias