0
我正在创建一个小型应用程序,并使用了Business Class。现在,我想创建报告。 首先,这是我的物业类别:如何在报表查看器中显示子类 - VS 2010
public class Property
{
public int PropertyId { get; set; }
public int OwnerId { get; set; }
//User is another Class
public User Owner { get; set; }
public int StaffUserId { get; set; }
public Staff StaffPerson { get; set; }
public string Address { get; set; }
public int NoGarage { get; set; }
public int NoRoom { get; set; }
public int NoToilet { get; set; }
public string PropertyType { get; set; }
public string PropertyStatus { get; set; }
public double SalePrice { get; set; }
public double RentPricePerMonth { get; set; }
public bool IsAvailable { get; set; }
...............
,这里是我的用户类别:
public class User
{
public int UserId { get; set; }
public string UserName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Password { get; set; }
public string PhoneNo { get; set; }
public string Email { get; set; }
现在我想创建一个使用Property类报告,也希望显示的User类。 我能够显示Property类的对象,但无法显示用户类。
我该怎么做?
目前我使用这生成报告:
Property p = Property.GetPropertyByPropertyId(propertyId);
PropertyBindingSource.DataSource = p;
reportViewer1.RefreshReport();
我试过你的方式,但似乎没有发生。 –