我在asp.net应用程序中使用localreport对象。此报告由一个对象数组提供。因此,在呈现报告时,调用类的一些属性。
Class ClassForReport
{
string Date
{
get{return _aDate.ToshortDateString();}
}
}现在是用于呈现的代码和问题:
//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预先
发布于 2011-05-11 14:18:16
在".rdlc“Designer on your ReportFile中,设置在Language属性"=User!Language”中的报表中。
<Report>
...
<Language>=User!Language</Language>
...
</Report>然后,您的System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("de-DE");将处理report.Render(...);中的值,如日期等。
干杯。
https://stackoverflow.com/questions/3164548
复制相似问题