C# 以对象作为数据源的RDLC
我正试图显示来自我的类对象的rdlc报告 这是上课时间C# 以对象作为数据源的RDLC,c#,winforms,reportviewer,objectdatasource,C#,Winforms,Reportviewer,Objectdatasource,我正试图显示来自我的类对象的rdlc报告 这是上课时间 public class BillInfo { public String Name { get; set; } public String Date { get; set; } public String splInstructions { get; set; } public List<OrderItem> oItems { get; set; } public String Gros
public class BillInfo
{
public String Name { get; set; }
public String Date { get; set; }
public String splInstructions { get; set; }
public List<OrderItem> oItems { get; set; }
public String GrossTotal { get; set; }
public String DiscountAmount { get; set; }
public String NetTotal { get; set; }
}
public class OrderItem
{
public OrderItem() { }
public OrderItem(String sNo, String Qty, String Amt, String ttl)
{
this.SNo = sNo;
this.Quantity = Qty;
this.Amount = Amt;
this.Total = ttl;
}
public String SNo { get; set; }
public String Quantity { get; set; }
public String Amount { get; set; }
public String Total { get; set; }
}
我添加数据源的第二行给出了这个错误
Value does not fall within the expected range.
在Microsoft.Reporting.WinForms.ReportDataSource.set_ValueObject value\r\n的Billinator.ReportViewer.ReportViewer_LoadObject sender中,C:\Users\Guest1\Desktop\Billinator\Billinator\ReportViewer.cs中的EventArgs e:System.Windows.Forms.Form.OnLoadEventArgs e\r\n位于System.Windows.Forms.Control.CreateControlBoolean Fignorevible\r\n位于System.Windows.Forms.Control.CreateControl\r\n位于System.Windows.Forms.Control.WmShowWindowMessage&m\r\n位于System.Windows.Forms.Control.WndProcMessage&m\r\n位于System.Windows.Forms.Control.ControlNativeWindow.WndProcMessage&m\r\n位于System.Windows.Forms.NativeWindow.DebuggableCallbackIntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam
请指出哪里出了问题MainForm.GetBillData返回的是什么类型?你能发布那个方法的代码吗?
Value does not fall within the expected range.