views:

14

answers:

0

Hi everybody,

I'm using a localreport object into an asp.net application. This report is fed by an array of object. So on the render of the report, some properties of the classe are called.

Class ClassForReport
{
  string Date
  {
    get{return _aDate.ToshortDateString();}
  }
}

Now the code for rendering and the problem:

//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

So it seems that when the method render is called, it launch a thread and take the culture of the server and not the culture of the process.

The only workarround I see is changing my report to contains a date and then giving a parameter of culture and formating all my date in all my reports to the given culture...

So I realy hope there is a way to tell the report to take the curent culture of the asp thread and not taking some other culture comming from nowhere.

thx in advance