开发者

How can I get the date format from an SSRS report from the web service interface?

I get report params in C# code from the webservice as follows:

ReportingService2005 ReportingService = ConnectToSSRS();
ReportParameter[] ReportParams = ReportingService.GetReportParameters(reportSelector.SelectedValue, HistoryID, ForRendering, emptyParams, null);

DateTime parameters currently seem to always come up as mm/dd/yyyy. Where is the date format defined? It's not hardcoded like this is it? Is there a way for me to obtain the开发者_运维百科 DateFormat from code?

Thanks


What you're seeing is the default format string representation of the DateTime object (according to your locale...probably), so yes, in a sense, it is harcoded like that.

If you're working with a DateTime object though, rather than try and figure out what format it is in, you could just force it to whatever format you like best.

dt.ToString("MM/dd/yyyy hh:mm:sszzz")

You might want to take a look here for information that might help you. Also this.


Try to use ISO 8601 date format, e.g. 1999-06-01. It will work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜