开发者

How to access child object's properties using ASP.NET ReportViewer?

开发者 https://www.devze.com 2023-02-24 14:43 出处:网络
In our project we are using MS ReportViewer to view the page for printing. The problem I face is when binding the local report with the object data source it sees the top level properties but not the

In our project we are using MS ReportViewer to view the page for printing. The problem I face is when binding the local report with the object data source it sees the top level properties but not the child object's properties!

Is there any method to s开发者_Go百科ee these properties of the child object?


Just an update to this, its now fixed in SP1. The requirement to get it to work is to make sure ALL classes used in properties of the datasource are serializable.

more info at:

http://wraithnath.blogspot.com/2011/04/reportviewer-object-datasource-nested.html


Which version of the report viewer? This is a bug in the 2010 version of the control. The work around is to bring the properties up to the top level object.

 public class MyTopLevelObject {

     public int MyChildsProperty {
         get {
              return _myChild.Property;
         }
     }
 }

Yeah it's not the greatest :-/


Make sure you've marked your class and its properties classes as [Serializable].

It has worked for me!

0

精彩评论

暂无评论...
验证码 换一张
取 消