问题描述
把一个list作为数据源绑定到reportviewer通过设断点发现值都赋上了可是运行还是显示尚未指定报表定义的来源privatevoidbutton1_Click(objectsender,EventArgse){EOFindfind=FormHelper.FromToFind<BasinfoContainer>(this);//查询数据IListlist=LocalService.InvokeFunGeneric<BasinfoContainer>(BasicCF.BasicModule,BasicCF.FunCode.F_Find,find);//吧list转化为datatableSystem.Data.DataTableaa=this.ToDataSet(list);reportViewer1.LocalReport.DataSources.Clear();ReportDataSourcerds=newReportDataSource("DataSet1",aa);reportViewer1.LocalReport.DataSources.Add(rds);this.reportViewer1.RefreshReport();this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);}
解决方案
解决方案二:
去掉System.Data.DataTableaa=this.ToDataSet(list);
时间: 2025-01-21 09:43:08