Print Page | Close Window

Can I pass my SQL statement to the report?

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=18178
Printed Date: 28 Apr 2024 at 5:53pm


Topic: Can I pass my SQL statement to the report?
Posted By: pgeorge33
Subject: Can I pass my SQL statement to the report?
Date Posted: 05 Dec 2012 at 3:30am
I have been experiencing problems with records getting displayed multiple times in several reports I am tryng to generate. 
 
In my program I generate the SQL statement (using Access), get the data from the database and pass the dataset to the report using

objRpt.SetDataSource(ds.Tables[0]);

However when I show the report, my report has thousands of more lines of data than the the data set I passed in.  Almost like the data was getting accessed from the database without the WHERE statement.
 
I suspect it is a problem with the Database Links I have setup but I can't seem to get it to work correctly.
 
Can I simply pass the SELECT command to the report and avoid these issues?
 


-------------
Peter



Print Page | Close Window