FastReport使用List的方法
public class User
{
string username;
string password;
public User(string username, string password)
{
Username = username;
Password = password;
}
public string Username { get => username; set => username = value; }
public string Password { get => password; set => password = value; }
}
private void button1_Click(object sender, EventArgs e)
{
FastReport.Report report1 = new FastReport.Report();
List<User> list = new List<User>();
list.Add(new User("aaa","bbb"));
list.Add(new User("ccc", "ddd"));
try
{
report1.Load(@"C:\Users\zgj\Desktop\Untitled.frx");
report1.RegisterData(list,"aa");
report1.GetDataSource("aa").Enabled = true;
DataBand data = report1.Report.FindObject("Data1") as DataBand;
data.DataSource = report1.Report.GetDataSource("aa");
report1.Report.Show();
// report1.Report.Design();
/// report1.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
//throw;
}
}
另外建了几个QQ技术群:
2、全栈技术群:616945527
2、硬件嵌入式开发: 75764412
3、Go语言交流群:9924600
闲置域名WWW.EXAI.CN (超级人工智能)出售。