By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,749 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

discrepancy between data in dataset and data reported by Crystal viewer

P: n/a
JK
In my Windows form, I have a discrepancy between what the CrystaReport
viewer displays and what the dataset contains. The Report displays data
from three fields from same table but the reportviewer displays all the data
in the table regardless of the select I run (in this case, the select
returns only one record):

test MyRpt = new test();
DataSet DS_MyReportsDS = new DataSet();
SqlConnection SQLConn = new SqlConnection("Data Source=localhost; Integrated
Security=SSPI;" +
"Initial Catalog=invoicing");
string strThisQuery = "select clientid,fname, lname1 from clientdata where
clientid = '00001' "; //I should only get one record but the viewer
displays all of them
SqlDataAdapter MyDataAdapterClients = new SqlDataAdapter (strThisQuery,
SQLConn);
MyDataAdapterClients.Fill(DS_MyReportsDS);
MyRpt.SetDataSource (DS_MyReportsDS);
crystalReportViewer1.ReportSource = MyRpt;

I didn't save the report with the data.

Thanks.
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
hey.. change ur system clock!!!

"JK" <NONE> wrote in message news:#K**************@tk2msftngp13.phx.gbl...
In my Windows form, I have a discrepancy between what the CrystaReport
viewer displays and what the dataset contains. The Report displays data
from three fields from same table but the reportviewer displays all the data in the table regardless of the select I run (in this case, the select
returns only one record):

test MyRpt = new test();
DataSet DS_MyReportsDS = new DataSet();
SqlConnection SQLConn = new SqlConnection("Data Source=localhost; Integrated Security=SSPI;" +
"Initial Catalog=invoicing");
string strThisQuery = "select clientid,fname, lname1 from clientdata where
clientid = '00001' "; //I should only get one record but the viewer
displays all of them
SqlDataAdapter MyDataAdapterClients = new SqlDataAdapter (strThisQuery,
SQLConn);
MyDataAdapterClients.Fill(DS_MyReportsDS);
MyRpt.SetDataSource (DS_MyReportsDS);
crystalReportViewer1.ReportSource = MyRpt;

I didn't save the report with the data.

Thanks.

Nov 15 '05 #2

P: n/a
Hi JK,

In your code, MyRpt is an instance of "test" type. Is "test" a kind of
ReportDocument? If it contains the schema of all the columns, the
CrystalReportViewer will display all the data in the table regardless of
your select.

In addition to posting your question here, also look at
http://www.crystaldecisions.com/. Though it ships with Visual Studio,
Crystal Reports is supported by Crystal Decisions. They have a self-help
section and they offer phone & e-mail support. Their web sites states that
you get two Crystal incidents with the purchase of Visual Studio .NET.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 15 '05 #3

P: n/a
JK
"test" is test.rpt, a Crystal report. What would I need to do so the
CrystalReportViewer displays just the data in my Select? Is the change in
the code or in the report creation?
Thanks.

"Kevin Yu" <v-****@online.microsoft.com> wrote in message
news:H1**************@cpmsftngxa06.phx.gbl...
Hi JK,

In your code, MyRpt is an instance of "test" type. Is "test" a kind of
ReportDocument? If it contains the schema of all the columns, the
CrystalReportViewer will display all the data in the table regardless of
your select.

In addition to posting your question here, also look at
http://www.crystaldecisions.com/. Though it ships with Visual Studio,
Crystal Reports is supported by Crystal Decisions. They have a self-help
section and they offer phone & e-mail support. Their web sites states that
you get two Crystal incidents with the purchase of Visual Studio .NET.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 15 '05 #4

P: n/a
Hi JK,

I think you have to change the schema of your test.rpt file. Make sure it
has the same schema as you datasource.(Make it contains only 3 column you
need.)

In addition to posting your question here, also look at
http://www.crystaldecisions.com/. Though it ships with Visual Studio,
Crystal Reports is supported by Crystal Decisions. They have a self-help
section and they offer phone & e-mail support. Their web sites states that
you get two Crystal incidents with the purchase of Visual Studio .NET.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.