Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Warning legend formula in case a row equals zero Post Reply Post New Topic
Author Message
sanur13
Newbie
Newbie


Joined: 25 Apr 2016
Location: France
Online Status: Offline
Posts: 18
Quote sanur13 Replybullet Topic: Warning legend formula in case a row equals zero
    Posted: 23 Jul 2017 at 10:33pm
Hi everyone,

I have a formula that multiplies the number of pieces produced by their price, for each row. The problem is that sometimes the price was not entered in the database, so it's zero. I have suppressed the details section, so that only the total is shown. I would like to make a formula to insert on the group footer, that warns us with the legend "incomplete" whenever there's a line with an article price as zezro.

Example

Details section (suppressed)

Pieces   Price    Pieces * Price
2        10          20
3        10          30
5        0            0
5        5            25
4        1            4
8        5            40
9        10          90

Group footer

                  Total
                   209           "incomplete"
                                   This is what I want to be shown, since we have a price zero at the first line of the 5 pieces. If all the pieces had a price, this legend would need to be hidden. So the formula has to be conditional.


Thanks a lot,
Santiago
IP IP Logged
sanur13
Newbie
Newbie


Joined: 25 Apr 2016
Location: France
Online Status: Offline
Posts: 18
Quote sanur13 Replybullet Posted: 23 Jul 2017 at 11:22pm
I just found the solution. Actually if you write the formula as if it was meant for the deatils section, and place it in the group footer it works fine.

Formula :

if {ARTICLE.PRICE} =0 then "INCOMPLETE" else ""

This will show INCOMPLETE at the group footer whenever there's a row with a zero price.
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 24 Jul 2017 at 3:22am
Hi

I don't think the formula which you have placed in group footer will not work all the times. Because, it always pull group last record price then it compares it with zero.

Do the following to avoid inaccurate results :

The same formula you place it in detail instead of in group footer, then create below formula and place it in group footer.

Maximum({@formual},Groupname)

Thanks,
Sastry
Thanks,
Sastry
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.016 seconds.