如何从 Web 服务界面获取 SSRS 报告的日期格式?
我从 Web 服务获取 C# 代码中的报告参数,如下所示:
ReportingService2005 ReportingService = ConnectToSSRS();
ReportParameter[] ReportParams = ReportingService.GetReportParameters(reportSelector.SelectedValue, HistoryID, ForRendering, emptyParams, null);
DateTime 参数当前似乎始终显示为 mm/dd/yyyy。日期格式在哪里定义的?它不是像这样硬编码的吗?有没有办法让我从代码中获取 DateFormat?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您看到的是 DateTime 对象的默认格式字符串表示形式(根据您的语言环境......可能),所以是的,从某种意义上说,它是这样编码的。
如果您正在使用 DateTime 对象,您可以将其强制为您最喜欢的格式,而不是尝试找出它的格式。
您可能需要查看此处以获取可能对您有帮助的信息。
还有这个。
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.
You might want to take a look here for information that might help you.
Also this.
尝试使用 ISO 8601 日期格式,例如 1999-06-01。它会起作用的。
Try to use ISO 8601 date format, e.g. 1999-06-01. It will work.