首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于LocalReport方法渲染的线程的培养

用于LocalReport方法渲染的线程的培养
EN

Stack Overflow用户
提问于 2010-07-02 09:29:48
回答 1查看 1.7K关注 0票数 4

我在asp.net应用程序中使用localreport对象。此报告由一个对象数组提供。因此,在呈现报告时,调用类的一些属性。

代码语言:javascript
复制
Class ClassForReport
{
  string Date
  {
    get{return _aDate.ToshortDateString();}
  }
}

现在是用于呈现的代码和问题:

代码语言:javascript
复制
//first of all, I change de culture for taking in account the choice of the user
CultureInfo ci = CultureInfo.CreateSpecificCulture(isoLanguageName_);
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci; 
//Here, my culture is now: FR-be

MyLocalReport.render(...) // in this method, the property Date above is called. And when debugging I see that the culture is EN !!!

...
//and here, my culture is still Fr-be

因此,当方法呈现被调用时,它启动一个线程并接受服务器的区域性,而不是进程的区域性。

我看到的唯一解决办法是将我的报告更改为包含日期,然后给出一个区域性参数,并在我对给定区域性的所有报告中形成我的所有日期。

因此,我真的希望有一种方法,告诉报告采取现代文化的asp线程,而不是采取其他文化开始从任何地方。

thx预先

EN

回答 1

Stack Overflow用户

发布于 2011-05-11 14:18:16

在".rdlcDesigner on your ReportFile中,设置在Language属性"=User!Language”中的报表中。

代码语言:javascript
复制
<Report>
  ... 
  <Language>=User!Language</Language>
  ...
</Report>

然后,您的System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");将处理report.Render(...);中的值,如日期等。

干杯。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3164548

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档