thanks
Crystal report
i want a complete code for crystal report to filter the data by maximum present in database.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 11, 2012, 11:26 PM EDT
Try
CrystalReport1 r1 = new CrystalReport1();
private void button2_Click(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection(ConnectionString);
con.Open();
str = "select * from product where price=(select max(price) from product)";
com = new OleDbCommand(str, con);
oledbda = new OleDbDataAdapter(com);
ds = new DataSet();
oledbda.Fill(ds, "product");
dataGridView1.DataMember = "product";
dataGridView1.DataSource = ds;
con.Close();
r1.SetDataSource(ds);
CrystalReportViewer1.ReportSource = r1;
CrystalReportViewer1.RefreshReport();
CrystalReportViewer1.Refresh();
}Thanks