I followed the tutorials here:
And I was able to make and display a report without incident (I'm doing this in VS 2008 in a winForm app, but I took the thrust of this tutorial and made it work). However I'm running into a problem trying to go beyond this tutorial.
I want to add a related object. So I created a StockTrade class that takes a stock symbol (string), timestamp, price, and quantity. I want to group on the symbol string and show some transactions. In the designer this appears to work in a straightforward way. The problem arises when I try to populate the datasets at runtime. Here's the code I'm using (the commented out stuff is the first report that works well):
//AssetListReport alr = new AssetListReport();
//alr.SetDataSource(Stock.GetSomeStocks());
//crystalReportViewer1.ReportSource = alr;
MoreComplicatedReport mcr = new MoreComplicatedReport();
//I've tried a few variations of the following couple of lines of code.
mcr.SetDataSource(Stock.GetSomeStocks());
mcr.SetDataSource(StockTrade.GetTrades());
crystalReportViewer1.ReportSource = mcr;
The report itself uses fields from both StockTrades objects and Stock objects. Any thoughts? It's obviously not production code, so I could zip the solution up if that would help.