Solved

ReportViewer Layout and custom datasource problem

Posted on 2010-09-21
4
980 Views
Last Modified: 2012-06-27
Ok I'll admit this is the first time I've tinkered with ReportViewer, I'm using VS2010.  My data is in the form of a List of Order objects, each contains info such as buyer's name, address, date, etc. and a List of OrderDetail objects.  Pretty straightforward.

First problem is I want to display a single Order with a subreport containing the OrderDetails.  If I drag fields from the Order onto the Report Designer the first and only first object in my list displays.  The back, next controls are disable.

However if I put all the field into a List on the Report Designer surface, each object in my List<Order> gets displayed all at once on the ReportViewer form.  How do I instruct the Viewer to display a single entity at a time?

2nd problem.  VS2010 ReportViewer has a problem in that it cannot drill down into nested objects, so I have flattened my objects.  Each time the viewer displays an object from my list, I want to be able to build a list to set to the bindingsource for the subreport.  But it seems RV wants a complete list of OrderDetails and set a filter.  I've read that it can be done manually, how?

Thanks!
0
Comment
Question by:KurgerBurger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:ina_don
ID: 33730880
I'm not sure if you need to add a subreport for what you're trying to do. You could easily do this by properly querying the database. You could run a single query that will return all the information that you need and then use grouping in the report so that all records bearing the same order number appear on a single page. Subreports are not that glamourous and may not be necessary in this case.
0
 

Author Comment

by:KurgerBurger
ID: 33731100
Well the whole app is designed around Linq/SQL and the data layers are segregated away from the business and presentation layers so I'd like to avoid doing some sort of data mangling just for the report.

0
 
LVL 5

Expert Comment

by:ina_don
ID: 33731195
Try looking at these
http://msdn.microsoft.com/en-US/library/ms251700%28v=VS.80%29.aspx
http://northwind.codeplex.com/ (sample application with reports that do exactly what you're trying to do except not with linq but I suspect the techniques should be similar)
0
 

Accepted Solution

by:
KurgerBurger earned 0 total points
ID: 33743985
I have finally figured this out by up converting an existing sample report from 2008 to 2010 then carefully matching all the settings.  The documentation for ReportViewer is awful!  The problem lay with how parameters between the main report and subreport were defined.

Please close this thread.  Thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question