Hello everyone,
I am working on project of purchase order in asp.net , in that i want crystal reports.
I am working on crystal reports push process.
the problem arising is when i fire the query and bind it to the crystal report, though the record is only one in the dataset it is coming twice in crystal report.
i.e
the data in data set is like this:
Sr.No PurchaseOrderNumber Item
1 PO/MA/2147 Dishes
but in crystal report it is displayed like this:
Sr.No PurchaseOrderNumber Item
1 PO/MA/2147 Dishes
2 PO/MA/2147 Dishes
Please help me out how to solve this, i m really stuck up..
Thanks in advance.
Krunal Panchal
[Update from OP]
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
cn.Open();
cmd = new SqlCommand("select Distinct Username.Password,UserTasks from User_Master,UserTasks where
User_Master.Id=UserTasks.UserId and User_Master.UserId='" + txtUerid.Text.ToString() + "' ", cn);
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
ReportDocument rep = new ReportDocument();
string reportPath = Convert.ToString (Server.MapPath("~/CrystalReport1.rpt"));
rep.Load(reportPath);
rep.SetDataSource(ds.Tables[0]);
CrystalReportViewer1.ReportSource=rep;
}
catch { }
finally
{
cn.Close();
}
}
This is my function for binding data to crystal report.. Please help me out..