In my win form, I'm trying to display a Crystal report with the data in my
dataset only but, if I follow the steps in this msdn page:
http://msdn.microsoft.com/library/de...tinaviewer.asp
it always displays all the data regardless of the Select statement I run.
Here's my code:
InitializeCompo nent();
//my code
CrystalReport1 oRpt = new CrystalReport1( ); //CrystalReport1. rpt - it
contais 3 fields from table ClientData: clientid, fname, lname
SqlConnection SQLConn = new SqlConnection(" Data Source=localhos t; Integrated
Security=SSPI;" +
"Initial Catalog=invoici ng");
string strThisQuery = "select clientid, fname, lname from ClientData where
clientID = 4"; /it returns only one record
SqlDataAdapter MyDataAdapterCl ients = new SqlDataAdapter (strThisQuery,
SQLConn);
DataSet DS_MyReportsDS = new DataSet();
MyDataAdapterCl ients.Fill(DS_M yReportsDS, "ClientData ");
oRpt.SetDataSou rce (DS_MyReportsDS );
crystalReportVi ewer1.ReportSou rce = oRpt;
It doesn't matter what my Select returns, it'll always display all the data
in ClientData. I posted a similar message a few days ago, and someone posted
this:
"If it contains the schema of all the columns, the CrystalReportVi ewer will
display all the data in the table regardless of your select." but I really
didn't understand what he meant. How would I be able to pass my Select
statement into the report?
Thanks.