none
ReportViewer changing CultureInfo? RRS feed

  • Question

  • I have created a windows form in .NET 4.0 which dynamically loads reports into a ReportViewer. However after certain reports are loaded my current threads culture info changes to "en-US" (System.Threading.Thread.CurrentThread.CurrentCulture). Is there any reason for this?

    PS This seems to be happening after the report has rendered on the screen.

    Monday, July 26, 2010 4:15 PM

Answers

  • This has been fixed in the dll versions of Microsoft.ReportViewer that come with Visual Studio 2010, version 10.0.40219.329.

    I've successfully reproduced the thread culture change error with the dlls version 10.0.30319.1. The offending call was to 

    Microsoft.Reporting.WinForms.Render(renderExtension, nullout mimeType, out encoding, out extension, out streams, out warnings);

    The dlls involved are:

    Microsoft.ReportViewer.Common.dll

    Microsoft.ReportViewer.DataVisualization.dll

    Microsoft.ReportViewer.ProcessingObjectModel.dll

    Microsoft.ReportViewer.WebForms.dll

    Microsoft.ReportViewer.WinForms.dll

    These were installed with the Microsoft Report Viewer 2010 redistributable, at some point, on the problem machine. So examine your references and the GAC, you might find the error there, or be sure to restore the old culture after rendering anything report related.



    Thursday, January 31, 2013 11:43 AM
  • Thanks for doing the extra investigation I am now able to repro the problem and it does appear to be a bug in the control. Please file a bug on connect https://connect.microsoft.com so you can track the progress of this issue. Thanks!

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights

     

    • Marked as answer by Alex Cluer Thursday, August 5, 2010 9:14 AM
    Wednesday, August 4, 2010 6:03 PM

All replies

  • I have done some more digging and it is definately the ReportViewer rendering that is causing the problem. I have created a work around using the RenderingBegin and RenderingComplete events to store the curent culture and reapply it post render. Is there anything in a report that can cause the culture to change (it isn't happening on all reports and I'm yet to find an obvious reason)?
    Tuesday, July 27, 2010 2:59 PM
  • I've tried to repro this locally but haven't had any luck so far, can you provide a little more information about the reports that are causing the issue such as what kind of data regions are on the report (Chart, Gauge, Tablix ...). Also are you able to create an isolated repro of the issue?

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights

    Thursday, July 29, 2010 7:34 PM
  • Done some more digging and this issue only occurs on reports with a document map.
    Wednesday, August 4, 2010 1:19 PM
  • Thanks for doing the extra investigation I am now able to repro the problem and it does appear to be a bug in the control. Please file a bug on connect https://connect.microsoft.com so you can track the progress of this issue. Thanks!

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights

     

    • Marked as answer by Alex Cluer Thursday, August 5, 2010 9:14 AM
    Wednesday, August 4, 2010 6:03 PM
  • Bug report filed
    Thursday, August 5, 2010 9:14 AM
  • can you please post link to bug report? i have same problem
    Friday, December 10, 2010 9:27 AM
  • Hi,

    Any update on this issue please ?

    Would you mind giving us the link to track the bug on the Microsoft Connect website please ?

    Thank you.

    Monday, May 9, 2011 2:31 PM
  • i have searched for this bug with no success, i have the same problem.

    Virginia

    Monday, April 23, 2012 6:52 PM
  • This has been fixed in the dll versions of Microsoft.ReportViewer that come with Visual Studio 2010, version 10.0.40219.329.

    I've successfully reproduced the thread culture change error with the dlls version 10.0.30319.1. The offending call was to 

    Microsoft.Reporting.WinForms.Render(renderExtension, nullout mimeType, out encoding, out extension, out streams, out warnings);

    The dlls involved are:

    Microsoft.ReportViewer.Common.dll

    Microsoft.ReportViewer.DataVisualization.dll

    Microsoft.ReportViewer.ProcessingObjectModel.dll

    Microsoft.ReportViewer.WebForms.dll

    Microsoft.ReportViewer.WinForms.dll

    These were installed with the Microsoft Report Viewer 2010 redistributable, at some point, on the problem machine. So examine your references and the GAC, you might find the error there, or be sure to restore the old culture after rendering anything report related.



    Thursday, January 31, 2013 11:43 AM