以法语获取广告系列报告会抛出DateTime.Parse错误 [英] Getting campaign report in French throw DateTime.Parse Error

查看:68
本文介绍了以法语获取广告系列报告会抛出DateTime.Parse错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好, 

我正在使用BingAds Api通过ReportingServiceManager查询CampaignPerformanceReport。 

I'm using BingAds Api to query CampaignPerformanceReport throught the ReportingServiceManager. 

如果我想要要使用法语报告,我的ReportingDownloadParameters看起来像这样: 

If I want to get the report in french, my ReportingDownloadParameters looks like this : 

var request = new CampaignPerformanceReportRequest
{
   Columns = columns,
   Scope = scope,
   Time = new ReportTime
   {
      CustomDateRangeStart = startDate,
      CustomDateRangeEnd = endDate
    },
    Language = ReportLanguage.French, 
    Format = ReportFormat.Xml, 
};

到目前为止一切顺利,报告下载进展顺利。

So far so good, the report download is going well.

但是,该方法程序崩溃时尝试构建返回的Report对象。 

However, the program crash when the method tries to build the Report object returned. 

据我所知,ReportTimeEnd和ReportTimeStart属性是从xml ReportTime属性设置的。

As I understand the ReportTimeEnd and ReportTimeStart properties are set from the xml ReportTime property.

但是一世t以法语记录,当程序解析它反转月份和日期的日期。当原始日期的日期大于12时,系统会抛出无效的输入字符串格式

But since it was recorded in French, when the program parse the date it reverses the month and the date of the day. And when the date of the original day is greater than 12 the system throws an invalid type input string format

我的开始日期是2019年2月9日,结束日期是3月11日,2019。

My start date was the February 9, 2019, the end date was March 11, 2019.

处理后的日期已于2019年9月2日更改为2019年11月3日

After processing the dates have been changed in september 2, 2019 until november 3, 2019

推荐答案

这是一个很好的标注,即ReportingServiceManager不支持French通过ReportFileReader 。此外,报告服务将在以后的版本中弃用法语对报告标题的支持,因此我建议您设置英语。 

That's a good callout i.e., French is not supported by the ReportingServiceManager via ReportFileReader. Also the Reporting service will deprecate French support for report headers in a future version, so I recommend that you set English instead. 

祝你好运,

Eric


这篇关于以法语获取广告系列报告会抛出DateTime.Parse错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆