Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Returning results based on parameters Post Reply Post New Topic
Page  of 2 Next >>
Author Message
shabbaranks
Groupie
Groupie


Joined: 06 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 66
Quote shabbaranks Replybullet Topic: Returning results based on parameters
    Posted: 24 Jul 2018 at 5:23am
Hi,
Im just getting back into writing Crystal Reports after probably 5 years plus. I cant remember how you create a report based on a parameter? So I have created a parameter which points to a company name but the report returns all values instead of just those relating tot he company entered in the parameter.

Any help would be appreciated - thanks :)
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Jul 2018 at 4:24am
In the select expert.  Did you filter a field on that parameter?
IP IP Logged
shabbaranks
Groupie
Groupie


Joined: 06 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 66
Quote shabbaranks Replybullet Posted: 25 Jul 2018 at 4:27am
Hi Kevlray,

I managed to overcome this (the problem was due to my unfamiliarity) I remember in Crystal Reports 2008 you had a select expert, in this version you use interactive filtering which looks like the same thing :) Thanks!!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Jul 2018 at 9:49am
What version of Crystal Reports are you using?  I know that Crystal Reports for Enterprise has interactive filtering, but that is a bit different than the 'regular' filtering.
IP IP Logged
shabbaranks
Groupie
Groupie


Joined: 06 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 66
Quote shabbaranks Replybullet Posted: 25 Jul 2018 at 10:18am
Its Crystal Reporting built into SAP Business which is what your referring to by the sounds of it. I couldn't find the select expert filtering, I don't suppose you know where it is?

Edited by shabbaranks - 25 Jul 2018 at 10:20am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Jul 2018 at 12:55pm
The main filtering is done in Edit Query screen in Crystal Reports for Enterprise.  In the Query Filters section.  I wish I could attach a screen shot.
IP IP Logged
shabbaranks
Groupie
Groupie


Joined: 06 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 66
Quote shabbaranks Replybullet Posted: 25 Jul 2018 at 10:00pm
I found it (I think)its just called record filter?
One thing I am struggling with, it would seem the query needs to be in uppercase to work. I have converted the SQL view to uppercase but this has no impact on the parameter? If I use uppercase I get results and if I use lowercase it returns nothing?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 26 Jul 2018 at 4:14am
I have never heard of that issue.  I know that databases can be case aware, but that only applies to the data.
IP IP Logged
shabbaranks
Groupie
Groupie


Joined: 06 Oct 2013
Location: United Kingdom
Online Status: Offline
Posts: 66
Quote shabbaranks Replybullet Posted: 26 Jul 2018 at 5:42am
Well - I'm making progress. I found that if I manually create a parameter using the formula process I can get results which work. Below is my code:

IF {?Select Supplier} = "Select All"
THEN ({SS_Supplier_View.Company Name}) like '*'
ELSE ({SS_Supplier_View.Company Name}) like "*" & uppercase({?Select Supplier}) & "*"
AND
{@RecordDate} >= {?Date From} and {@RecordDate} <= {?Date To}

But it seems to ignore the from and to criteria if you leave the search as "Select All"
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 26 Jul 2018 at 6:44am
I would wrap everything in the Else clause in parenthesis.  Crystal is bad about ignoring multiple statement in a if else statement

ELSE (({SS_Supplier_View.Company Name}) like "*" & uppercase({?Select Supplier}) & "*"
AND
{@RecordDate} >= {?Date From} and {@RecordDate} <= {?Date To})
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.