Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Help: Record Selection Formula Post Reply Post New Topic
Author Message
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Topic: Help: Record Selection Formula
     Posted: 05 Feb 2010 at 11:18am
Hello Folks,
 I have a report which is populating data from a Stored procedure and driven by parameters coming from stored procedure. My requirement is to change the report as per the bursting requirement. i.e. have to include criteria in the record selection formula  as follows
 
Here {?payer = -1} is if we are selecting all payers.But for some reason i cannot pull the data with the parameters ?payer=-1 and ?product=-1.
Can anyobne throw some light on this. I can provide more information abt the procedure if needed.
 
 
Thanks a lot
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Feb 2010 at 11:26am
Check your stored proc.
In Crystal the -1 looks fine but likely is is still passing the -1 into the SP and if it is using that value there it is probably finding no records with those values.
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 05 Feb 2010 at 11:40am
hi thanks for getting back. am little disconnected right now at this point. But you mean to say that i shud modify the lines in the SP where it has
clientid=@payer or @payer =-1
and productid=@product or @product =-1
with
clientid=@payer or @payer =all
and productid=@product or @product =all
 
Is that the workaround.Please advice.
 
Thanks a lot
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Feb 2010 at 11:53am
I assumed in your first post that the
was the record selection in crystal select statement and not in the actual Stored Procedure.
The above would be fine in Crystal if was a crystal parameter and not a stored proc parameter.
What I was suggesting was that in the stored procedure you would have to make sure that it was written to make the -1 value not apply and filter in your WHERE or HAVING clause.
In that way you would not need to have it in the Crystal Select Statement at all.
So what is your Stored Proc WHERE or HAVING statement?


Edited by DBlank - 05 Feb 2010 at 11:54am
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 05 Feb 2010 at 12:07pm

Now i see what ur saying. But we are eventually bursting this report and we need the record selection and we hav to use it for the purpose of bursting, so that while Bursting, it looks into the selection formula and bursts to that specific payer folder in the CMC. Anywayz i will provide the where condition of the SP. Thanks for ur thoughts and ideas.

 

Select @Product as productID into #ppp

If @Product = -1

Begin

Delete from #ppp

Insert into #ppp Select productID from tblProducts

End

Else If @Product = 1

Begin

Insert into #ppp (productID) Values (8)

End

----------
select
*
into d#

From

tblclaims c with (nolock)

Inner Join

tblclaimproducts cp with (nolock) on c.claimid=cp.claimid

Inner Join

tblactions a with (nolock) on a.claimid=c.claimid and a.productid=cp.productid

Inner Join

tblstaff s with (nolock) on s.staffid=cp.auditorid

Inner Join

tblproviders pv with (nolock) on pv.providerid=c.providerid

Inner Join

tblclients cl with (nolock) on cl.clientid=c.clientid

Inner Join

tblproducts p with (nolock) on p.productid=cp.productid

Where

and cp.claimproductinvoicenum is null

and (c.clientid = @Payer or @Payer = -1)

and a.productid IN (Select productid from #ppp)

AND (LTRIM(RTRIM(C.ClaimGroupName)) = @ReportGroup OR @ReportGroup = '%')



Edited by Nav522 - 05 Feb 2010 at 12:15pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Feb 2010 at 12:22pm
Sorry, I no experience with bursting so can't tell you if that would work. Someone else might have thoughts.
In the mean time I would execute the sp directly in SQL using the -1 values to verify the SP works as intended outside of crysal. If it works you can focus on crystal and the param as the issue, if it is not working you can focus on fixing your sp.


Edited by DBlank - 05 Feb 2010 at 12:23pm
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 05 Feb 2010 at 1:15pm
Thanks for getting baack again. Well i have tested the SP with the parameters as -1. I strongly believe its the issue of crystal and parameters. Am not sure where to start ans what shud i do.. Any thoughts from you as what needs to be done can be helpful.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Feb 2010 at 2:03pm
Does it return data if you use values other than the '-1'?
IP IP Logged
Nav522
Senior Member
Senior Member


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 166
Quote Nav522 Replybullet Posted: 05 Feb 2010 at 2:18pm
Well its returning no data if i provide the parameters other than -1.
 
Thanks


Edited by Nav522 - 05 Feb 2010 at 2:24pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Feb 2010 at 2:41pm
Look in the Crystal Record Selection. Make sure there is nothing in there or what is there is correct. Double check the Group selection portion of it as well.
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