Reputation: 1321
I'm having serious issues with getting reportviewer to function in wpf, most of the information im finding on google is either the same tutorial copy&pasted or suggestions to buy £2k packages, neither of which helps me.
I have no error, no messages nothing, but the report shows as blank with no data. Yet i can in the debugger that the data is present. I have the following code:
private void reportViewer_Load(object sender, EventArgs e)
{
if (!_isReportViewLoaded)
{
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource = new Microsoft.Reporting.WinForms.ReportDataSource();
PackingListManager pManager = (PackingListManager)IoC.Get<IManager<PackingItem>>();
reportDataSource.Name = "PackingListDataset";
reportDataSource.Value = pManager.PackingItemList;
this._reportViewer.LocalReport.DataSources.Add(reportDataSource);
this._reportViewer.LocalReport.ReportEmbeddedResource = "ShippingClient.Report1.rdlc";
//_reportViewer.Refresh();
_isReportViewLoaded = true;
_reportViewer.Refresh();
}
The dataset name is correct for what is set in the report, and the pManager.PackingItemList
is a IEnumerable
collection, in this case a ObservableCollection
, the data is loaded and an event is picked up and the reportview refreshed when the data is loaded, i also have a button which runs the refresh when pressed, but no matter that i try the report always shows as having no data.
I'm sure im missing something here, but google results are flooded with pages from control packages such as Telerik and componentone which are far FAR to expensive to consider.
All this is being done, simply so i can print a datagrid over multiple pages maintaining the groups, something which i expected to be pretty standard but turns out to be insanely complicated to do.
EDIT:
Also just to note, the reportviewer seems to draw, but the report itself is missing, there are no headers, no data nothing, and all the controls are disabled, even tho i can clearly see that the datasource of the localreport has 49 values, i'm totally stumped.
Upvotes: 0
Views: 4026
Reputation: 48179
I have .net4 app built and working VERY WELL with built-in .RDLC reporting under a WPF app. I have had instances where a report would appear to get hosed with no specific understanding why. In some cases, I just had to drop the datasource / object schema references and then re-add them and it would work.
Another approach I have done was to create a brand new report, then add your data source to your report then just do a simple columnar report of say 2-3 fields and change your report to just run that one. Once that works, then I would copy/paste sections of the original report into the new report and keep working piece at a time. Maybe start with headings in the report and ignore detail/footer, then add any footer info, then the middle details. You might have some issues with case-sensitive schema name expectations causing a problem, or even "Hidden" or other conditional expressions on when to show/hide certain output fields.
Just to confirm, the report is visually failing in the debug mode too and not just at run-time correct?
Upvotes: 1