Reporting Services Binding Related Object Fields

EdwardAF
EdwardAF used Ask the Experts™
on
After upgrading my SSRS reports in VS2010, several of the expression fields are now broken.  For instance, using a data set of OrderItem, which contains standard order lines, I can access the fields directly represented by that object (the object structure was built using LINQ).  

However, related data cannot be so easily accessed.  Consider a inventory object contained-in the order line (related-to in the underlying database).  The inventory object is called OrderItemType, and I want to print out the description on each order line.  Sounds easy enough...

Before upgrading the following expression did in fact report the description from the related data:

=Fields!OrderItemType.Value.Description

However, now the "Description" portion is red-lined in the Expression editor, and when I run the report, it shows only "#VALUE" in the description field.

So what gives?  Did something change after the report upgrade that now requires a different syntax?  How can I once again print the description from the related table?
=Fields!OrderItemType.Value.Description

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Visual Studio 2010 does not inherently support SSRS projects.  SSRS is based on the SQL Server version and SQL 2008 R2 is the latest.  There is no SQL 2010, therefore, there is no SSRS in VS 2010.
Commented:
Admittedly, I may be calling this the wrong thing.  As a newcomer to the project, I inherited these reports from another developer who is no longer here.  What I can tell you for sure is that the report must reference the assemblies Microsoft.ReportViewer.* (it will not build otherwise), and when I first tried to edit these reports in VS2010, I was prompted to upgrade the report format or leave them read-only.  The report definition files have an extension of .rdlc, which I believe stands for Report Definition Language Client.

Does that help establish the correct product?
Commented:
After much research and hair pulling, I have found the solution.  It turns out that this is a known issue with the MS report client in VS2010.  See:

https://connect.microsoft.com/VisualStudio/feedback/details/553592/accessing-nested-objects-in-data-source-of-local-report-does-not-function 

There is a workaround, which is to extend your class with public read only properties that expose the underlying fields (in the nested class) that you wish to see in the report.  It violates encapsulation, but it works.

Author

Commented:
I found the workaround on another forum.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial