Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Select Expert issue Post Reply Post New Topic
Author Message
OmniPants
Newbie
Newbie
Avatar

Joined: 10 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote OmniPants Replybullet Topic: Select Expert issue
     Posted: 10 Mar 2010 at 3:03am
Greetings, clever internet-people,
 
I'm pretty new to Crystal Reports, so forgive me if the answer to my question ought to be painfully obvious even to a squirrel, but I can't seem to find a pre-made answer to it anywhere... Perhaps my Google-fu has become weak.
 
My problem is this:
 
My report loops through a string in each record, counting the occurences of certain characters. If the string is entirely composed of several of these characters, specifically #, Z, X, *, Y, N, O, and Y, I want to exclude the record from the report, so my formula says:
 
shared stringvar rangestring;
local numbervar l := length(rangestring);
local numbervar c := 0;
local numbervar i :=1;
    for i :=1 to l
    do
    (
    if rangestring ['i] in ["Y","*","X","-","Z","#","O","N"] then
    c := c+1
    );
if c = l then 1
else 0
Of course, when I specify "{@myformula} <> 1" in the Select Expert, I get a message saying that no, I can't use it because the formula must be evaulated later. Is there any way I can tell Crystal to run the rotten thing anyway, and disregard those records after the event?
 
Oh, and I'm using Crystal XI.
 
Thanks muchly,
Jack
 
 


Edited by OmniPants - 10 Mar 2010 at 3:07am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Mar 2010 at 7:07am

Crystal does certain things in specific passes. Brian's book explains this much better than I can hope to so I won't try here. That being said the evaluate later is in reference to that. Crystal does not execute that formula type until after the it applies the select statement so you cannot do this.

I think you will be limited to suppressing the rows rather than excluding them.


Edited by DBlank - 10 Mar 2010 at 7:07am
IP IP Logged
OmniPants
Newbie
Newbie
Avatar

Joined: 10 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote OmniPants Replybullet Posted: 11 Mar 2010 at 6:11am
Ah well. Cheers anyway!
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