How to pass sql parameter query in crystal reports???

Posted by Sathiya_Narayanan under Sql Server on 3/27/2012 | Points: 10 | Views : 1152 | Status : [Member] | Replies : 2
Hi
'm generating crystal report from database..
Here i have to generate only specific rows...
i have used sql query is SELECT * FROM [TABLENAME] WHERE COLOUMNAME=" ".
Here this works in query builder but not performing in crystal reports, it shoes again entire report.
here is my cs coding

obj.Open();
string sqlquery = "select * from xcd where batch='24-28'";
SqlCommand objcmd = new SqlCommand(sqlquery, obj);
SqlDataAdapter da = new SqlDataAdapter(objcmd);
DataSet ds = new DataSet();
da.Fill(ds);
CrystalReportViewer1.DisplayGroupTree = false;
CrystalReportViewer1.HasCrystalLogo = false;
ReportDocument rptdoc;
rptdoc = new ReportDocument();
rptdoc.Load(Server.MapPath("crystalreport2.rpt"));
rptdoc.SetDatabaseLogon("sxxx", "xxxxx");
rptdoc.SetDataSource(ds);
CrystalReportViewer1.ReportSource = rptdoc;
CrystalReportViewer1.RefreshReport();



have to modify any query or how???

SATHIYANARAYANAN


Responses

Posted by: Rajni.Shekhar on: 3/27/2012 [Member] Bronze | Points: 25

Up
0
Down
run your report "crystalreport2.rpt" in crystal report tool segate crystal report to check the output.

Thanks,
Rajni Shekhar

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathiya_Narayanan on: 3/27/2012 [Member] Starter | Points: 25

Up
0
Down
cant get u, tell me detail
wat's segate crystal report



SATHIYANARAYANAN

Sathiya_Narayanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response