ReportWebService.Schedule描述日期格式

时间:2014-11-07 13:13:37

标签: c# c#-4.0 reporting-services

我查询报告服务时间表并取回项目数组。在这些项目中是这样的描述字段:

Every 1 hour(s) and 0 minute(s), starting 11/1/2014 at 2:00 AM and ending 3/31/2015

有没有为此设置文化的选项,以便它以英国格式返回?即。

Every 1 hour(s) and 0 minute(s), starting 1/11/2014 at 2:00 AM and ending 31/3/2015

我的代码是:

           var reportService = new ReportingService2005();
            reportService.Credentials = GetReportCredentials();

            var schedules = reportService.ListSchedules();
            var scheduleViews = schedules.Select(s => new ReportScheduleSearchView { 
                Guid = s.ScheduleID,
                Name = s.Name,
                Description = s.Description,
                State = s.State.ToString(),
            });

1 个答案:

答案 0 :(得分:0)

报告管理器的语言由浏览器设置定义(在IE中:工具> Internet选项>语言)。也许您可以尝试setting the locale/culture申请en-GB

using System.Threading;
using System.Globalization;
// Set the culture
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
// Set the UI culture
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");