Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Parameters - To much Data Post Reply Post New Topic
Author Message
Jaguar.Shaguar
Newbie
Newbie


Joined: 28 Jun 2009
Location: United States
Online Status: Offline
Posts: 2
Quote Jaguar.Shaguar Replybullet Topic: Parameters - To much Data
     Posted: 28 Jun 2009 at 1:30pm
Hello,

I have a report that uses a stored procedure that pulls survey data. There is a lot to pull. One of my parameters in the report (not in the stored procedure) is City. If I make a plain report with no parameters all the information of all the survey data shows correctly with every city. However, when I add a parameter for City, the user only gets to select the first city that shows up in the query. I believe it is because the first number of records (about 1000 of them) are all of that particular city. So the parameter only displays that. So if the first 1000 records where Dallas and the second 1000 records where Addison, only the Dallas one would show up. If I change the query so that the sort order is different then only Addison would show. In the case where there are 100 Dallas records and 100 Addison records both would show. I want to see all the distinct cities from the query that are available no matter how many of each there are.

I have tried creating views to only display distinct queries and add them to my report but that did not work. And in any case that would not let me pull only cities in a scenario where someone only wanted to see the cities for a particular user. If someone selects a user they want it to drill down so that only the cities for that user appear.

Can anyone send me in the right direction please? I hope I explained this well enough.


<ADDED>
I tried adding a greater number LOV (in the registry) as suggested by someone who had this problem but it did not work. I have not rebooted but maybe this will work once I do that.


Edited by Jaguar.Shaguar - 28 Jun 2009 at 6:20pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 29 Jun 2009 at 6:57am
Create a command object.  Look at the dataexpert and above the database where your stored proc is, there should be a line like 'Add Command'.  You can type your SQL for distinct cities here and they can be displayed as a parameter in the report.  You can select multiple of them, and then in the Reports/selection formulas/records, you can check if the city returned by the stored proc is in the ARRAY of cities the user selected, if yes, display the record, else suppress it from the record set that Crystal is going to report on.  I don't use this method (filtering the data) but I believe you use the IN keyword to check.
 
HTH
IP IP Logged
Jaguar.Shaguar
Newbie
Newbie


Joined: 28 Jun 2009
Location: United States
Online Status: Offline
Posts: 2
Quote Jaguar.Shaguar Replybullet Posted: 29 Jun 2009 at 8:25am
Great! Thanks for the reply Lockwelle. I also noticed that this does not occur in the Business Viewer. I get the full list of cities (which is what they will be using).

I am still going to try this out though and see if I can get it working. Thanks again.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum