Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record selection formular Post Reply Post New Topic
Author Message
lozaldiniho
Newbie
Newbie


Joined: 22 Mar 2017
Online Status: Offline
Posts: 3
Quote lozaldiniho Replybullet Topic: Record selection formular
    Posted: 22 Mar 2017 at 7:22am
I'm a bit of a novice with this and have read post upon post, so apologies if it's really obvious and i've posted this in the wrong place etc...

Currently my data looks like this in preview mode:

SKU | Name | Selling Price | Price Rule | Price Rule Value

001 | Football | £20           | NOW          | £20
002 | TV        | £200          | NOW          | £200
003 | Shirt      | £50             | NOW          | £50
001 | Football | £20             | RRP            | £30
002 | TV          | £200          | RRP            | £250

I want the user to be able to select several SKUs (which I have worked out on select expert), and then only show the RRP rule unless it doesn't exist and then show the NOW rule.

Ideally user selects SKU's 001, 002 & 003 and gets this back:

SKU | Name | Selling Price | Price Rule | Price Rule Value

003 | Shirt      | £50             | NOW          | £50
001 | Football | £20             | RRP            | £30
002 | TV          | £200          | RRP            | £250

Thanks in advance! I'm using Crystal reports 2013

Lawrence



IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Mar 2017 at 1:54pm
if this is just about display and not calculations you can sort by SKU and Proce Rule then conditionally suppress a row using next() or previous() functions comparing the SKU and Price Rule values
maybe like this?
(Not onfirstrecord) and (previous(sku) = SKU and PriceRule = 'RRP')
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Mar 2017 at 1:55pm
The prior post assumes there are only up to two possible rows and each one is either RRP or NOW
IP IP Logged
lozaldiniho
Newbie
Newbie


Joined: 22 Mar 2017
Online Status: Offline
Posts: 3
Quote lozaldiniho Replybullet Posted: 22 Mar 2017 at 11:07pm
DBlank, thank you for the reply. In theory this sounds like it could work, thank you.

I've had a go at the Conditional Suppression, I did this via Section Expert > Details > Ticked Suppress (no drill down)
Clicked the formula and written the following:

(Not onfirstrecord) and (previous({tbleProduct.SKU}) = {tbleProduct.SKU} and {vw_OA_PriceRuleDetail.PriceRule} = 'RRP')

I don't get any errors upon Save&Close, but on the preview I don't see any changes to the data either, I still have Now & RRP price rules for the SKU?

Sorry if i've misunderstood your instructions. Any further thoughts?

Thanks again, Lawrence
IP IP Logged
lozaldiniho
Newbie
Newbie


Joined: 22 Mar 2017
Online Status: Offline
Posts: 3
Quote lozaldiniho Replybullet Posted: 22 Mar 2017 at 11:53pm
DBlank, I think I might have it working! I did the following:
(Not onfirstrecord) and (previous({tbleProduct.SKU}) = {tbleProduct.SKU} and (previous( {vw_OA_PriceRuleDetail.PriceRule} = 'RRP'))

I'll keep testing, thanks for your help.
IP IP Logged
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.