Hello:
Although I am very new to using embedded Reports (.rdlc) in WinForm applications (in C#), I think I understand the basic concepts. I've been experimenting and practicing to get better at this. Yet, I am having one strange problem. I've Google searched all this morning for a solution or a lead but to avail so I am asking the community. Let me describe the issue. Please note, this is just simple practice exercise stuff and not a real application at this point.
Here is what I seem to be able to do without an issue. I can embed a very basic report (.rdlc) into my WinForm and show the report via the Report Viewer control. And, of course, all the fields are outputting their data. This tells me at least I have all the data wiring in place, so to speak. This means my DataSet (.xsd) seems correct and the BindingSource, TableAdapters, and the Report DataSet as well. There are lot of pieces here but I am slowly understanding it.
But for my future application I want to use a SQL Server Compact Edition 4.0 database. So I create all the appropriate connections and objects against the Northwind40 datasource and all is fine. This little CE 4.0 database I think got installed somewhere along the way and its good to practice with.
So I use the same skills and mostly create a simple report that shows the CategoryID and Category, Description fields from the [Northwind40].[Categories] table in my table control on the report. When I run the form and ReportViewer Control does its thing, strangely, all I see is the column with Description. Both CategoryID and Category columns are blank. When I export to Excel, again, CategoryID and Category are blank and Description is nice and filled in for each row. CategoryID is System.int and both Category and Description are System.String.
Well, I'm not sure if this an issue because I'm using SQL CE 4.0 database? I don't think its my dataset, BindingSource, or those data components because I am getting back the data I want. It just simply won't display two out of the three fields. I tried all sorts of changing the font color, column sizes, right/left cell alignment etc but nothing.
There are two lines in my Form1_Load code:
this.CategoriesTableAdapter.Fill(this.Northwind40.Categories);
this.reportViewer1.RefreshReport();
And I have put a breakpoint on the .RefreshReport line. At that point, certainly the Northwind.Categories DataTable has values for CategoryID (1) and Category (Beverages) but again they won't show on the report only the Description (Soft drinks, coffees, teas, beer, and ale)
Gosh, I'm just not sure what else to try.
Any help or leads will be welcome. Thank you in advance. And again, this is just practicing/learning question so please do give others who have real Production issue priority over my learning question. Thanks again.