我目前有一个报告,我通过参数传递,但它只显示参数的单个记录(它可以找到的第一个记录)。
在我的数据集中查询:
SELECT CID, HID, Customer_Name, Appointment_Date, Appointment_Begin, Appointment_End, Room_No, RoomType, Discount FROM Appointment WHERE Appointment_Date = ?
我的RDLC设计
代码:
private void Report_Load(object sender, EventArgs e)
{
using (OleDbConnection db_connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\KAZEM\Documents\Hairsalon\employees.accdb;
Persist Security Info=False;"))
{
String query = "SELECT Distinct Appointment_Date FROM Appointment";
using (OleDbCommand db_command = new OleDbCommand(query, db_connection))
{
db_connection.Open();
OleDbDataReader reader = db_command.ExecuteReader();
while (reader.Read())
{
combo_AptDate.Items.Add(reader.GetString(0));
}
}
}
}
private void combo_AptDate_SelectedValueChanged(object sender, EventArgs e)
{
this.AppointmentTableAdapter.Fill(this.hairsalonDataset.Appointment, combo_AptDate.SelectedItem.ToString());
this.reportViewer1.RefreshReport();
}