none
calling external code library sometimes work sometimes not. RRS feed

  • Question

  • I am using local report mode on the WinForms reportviewer control. I use object data source exclusively to pass the data into my reports (containing 2 extra levels of subreports).

    During report rendering step, one of the reporting field (which backed by a textbox using expression as for binding and calling my external code library to format my own defined type) causes following exception in debug output window:

    A first chance exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportProcessingException_FieldError' occurred in Microsoft.ReportViewer.Common.dll
    A first chance exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportProcessingException_FieldError' occurred in expression_host_47f9a1abddfe44da858e4e28977b6d07

    Before this error, it has following error:

    A first chance exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll.

    The trouble is sometimes it works (i.e. my code is stopped by debugger at my set breakpoints). However most of the time, it just spits out above errors and won't stop on my breakpoints.  I have a similar project which is working all the time.

    BTW, I don't use strong named assemly at all in above mentioned projects.

    I'd appreciate any help on how to troubleshoot and solve this problem.


    Jun HY

    Thursday, August 2, 2012 10:04 PM

Answers

  • It turned out the culprit is in my value injection related code.

    The value injecter code created some shared in memory object (it's never 100% deep cloning by the value injecter code) among the data bound WPF forms, the ViewModel class objects, and the object data sources for the RDLC.  For some reason, the reportviewer rendering engine cannot handle object data sources which are indirectly connected to WPF form. Once I sever the link between them (e.g. reloading data from xml file), the above mentioned problem goes away.



    Jun HY

    • Marked as answer by Jun HY Tuesday, August 7, 2012 7:56 PM
    Tuesday, August 7, 2012 7:56 PM

All replies

  • Forgot to mention the development environment I am on:

    Windows 7, Visual Studio 2010 SP1, ReportViewer control (version 10.0.0), all related projects targets the .NET 4.0 framework.

    Thanks in advance for any help or advice you can offer.


    Jun HY

    Friday, August 3, 2012 6:20 AM
  •  I further found out that all class types in my external code library cause problems. However the many defined enum types ( and internal types, such as double, int, string) work as expected.

    What project settings contribute to this strange behavior?? BTW, my other working examples are running on the same PC here. Therefore the difference must be due to visual studio solution/project settings, etc.


    Jun HY

    Friday, August 3, 2012 6:45 PM
  • It turned out the culprit is in my value injection related code.

    The value injecter code created some shared in memory object (it's never 100% deep cloning by the value injecter code) among the data bound WPF forms, the ViewModel class objects, and the object data sources for the RDLC.  For some reason, the reportviewer rendering engine cannot handle object data sources which are indirectly connected to WPF form. Once I sever the link between them (e.g. reloading data from xml file), the above mentioned problem goes away.



    Jun HY

    • Marked as answer by Jun HY Tuesday, August 7, 2012 7:56 PM
    Tuesday, August 7, 2012 7:56 PM