这是我的水晶报告代码:
private void MonthlyReport_Load(object sender, EventArgs e)
{
CrystalReport1 report = new CrystalReport1();
DataSet1TableAdapters.DataTable1TableAdapter table = new DataSet1TableAdapters.DataTable1TableAdapter();
DataSet1.DataTable1DataTable tables = table.GetData();
report.SetDataSource(tables.DefaultView);
crystalReportViewer1.ReportSource = report;
crystalReportViewer1.Refresh();
}
这是我在过滤我想要打印的数据时的 datagridview 代码。
private void button1_Click(object sender, EventArgs e)
{
string searchValue = textBox1.Text;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataTable1BindingSource.Filter = string.Format("{0} = '{1}'","bill_desc", searchValue );
//here you can do selection if you need
}
我的问题是如何将过滤后的数据传递给不同形式的水晶报表。请帮忙!!