| Author |
Message |
kaifiser
Newbie
Joined: 15 May 2009
Location: United States
Online Status: Offline
Posts: 18
|

Topic: crDoubleLine - if, then, else Posted: 15 Jun 2009 at 8:19am |
Hello,
I am new to Crystal and need help with a conditional crDoubleLine formula.
My main goal is: If one field value is greater than "0" then underline the other field value. This would enable my other field to stand out in the group.
Currently I have:
if {command.number} > "0" then "crDoubleline{command.State}" else "0"
I know this isn't right; it only shows the text from the formula when I place it in the report.
Any help is appreciated.
|
IP Logged |
|
|
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 15 Jun 2009 at 8:34am |
Right click on the field you want to have the double line appear on and select Format Field.
Click on the Broder option.
Click on the X-2 next to the Bottom border option.
Enter your condition here as (pick one option after the ELSE) :
if {command.number} > 0 then crDoubleLine else crSingleLine/CrNoLine
|
IP Logged |
|
kaifiser
Newbie
Joined: 15 May 2009
Location: United States
Online Status: Offline
Posts: 18
|

Posted: 15 Jun 2009 at 9:14am |
THANK YOU ! That worked perfectly; but to make it even better, can I ask one additional question please.
In my report, the STATE is in Group One and always contains more than one DOCUMENT. In Groups 2,3 and 4, they don't contain any DOCUMENTS - this is where I would need the crDoubleLine to apply.
Is it possible to only have the crDoubleline formula apply to only Groups 2, 3 and 4 ? In these groups there are never any documents.
Thank you again for your quick response and help!
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 15 Jun 2009 at 9:42am |
I am not sure what you want to do here. Do you mean you have 4 levels of groups or you have a 1 grouping with 4 different responses?
you can use the condition of NULL or a COUNT or SUM as your condition to show double lines.
Are you looking for something like...
if COUNT(table.field,groupfield)>0 then crSingleLine else CrDoubleLine
? Edited by DBlank - 15 Jun 2009 at 9:43am
|
IP Logged |
|
kaifiser
Newbie
Joined: 15 May 2009
Location: United States
Online Status: Offline
Posts: 18
|

Posted: 15 Jun 2009 at 10:17am |
Thank you again; I apologize for my bad clarification.
What I have is 4 groups all utalizing {command.state} which is GH1. I only want the {command.state} to be underlined when it is shown in Groups 2,3 and 4, NOT in Group 1. I need to be able to use crDoubleline only in Groups 2,3 and 4.
Group 1 is being used as a summary of all {command.state} fields and each {command.state} field has multiple {command.documents} in all 4 Groups; My issue is that I can't have it underlined in Group 1.
My necessity for the underline is that in Groups 2,3 and 4, certain other data elements have the same name as the {command.state} field; therefore my business user can't tell which data element the actual fields are.
I really hope that this helps clarify my issue and THANK YOU again.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 15 Jun 2009 at 11:06am |
If the value in group 1 is never changing then you can just use that value as you condition to change on:
if {command.state}="value in group 1" then crSingleLine/crnoline else CrDoubleLine
If the value does change you need a constant logic that you can key off of.
|
IP Logged |
|
kaifiser
Newbie
Joined: 15 May 2009
Location: United States
Online Status: Offline
Posts: 18
|

Posted: 15 Jun 2009 at 11:34am |
Yes, the value for {command.state} does change (it is all 50 States). The field {command.documents} changes on the COUNT of Documents per state. My biggest issue is that I need {command.state} displayed in all 4 Groups, but to only use crDoubleline in Groups 2,3 and 4 so I can distinguish that they are the States. Sounds odd, but Groups 2 and 3 have other fields that are actually named the same as the States. So when I have CALIFORNIA and CALIFORNIA in Group 3, I need to distinguish which one is the actual STATE and not an area. But, of course, my User requires that the list of the 50 States not be underlined in Group 1. The only field that I have to compare against is the {command.documents} field.
I really thank you for your help and I hope that I am making sense.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 15 Jun 2009 at 11:59am |
Sorry, this is confusing me
Do you have a report that is set up like:
GH1 {command.state} not underlined
GH2 {command.state} underlined
GH3 {command.state} underlined
GH4 {command.state} underlined
Details
If so each time you place the Command.state field on each header level it is a unique item and you can apply formatting to each instance that does not change the formatting of the other instances.
or is it set up like:
GH1 {command.state} value 1 not underlined
Details
GH1 {command.state} value 2 underlined
Details
GH1 {command.state} value 3 underlined
Details
GH1 {command.state} value 4 underlined
Details
If this is the case let me know and there are ways to handle it.
|
IP Logged |
|
kaifiser
Newbie
Joined: 15 May 2009
Location: United States
Online Status: Offline
Posts: 18
|

Posted: 15 Jun 2009 at 12:47pm |
Nope - I wish I did though. Sounds easy enough doing it that way, but I don't. I have 4 Unique Groups that roll up (or drill into) to GH1 which is STATE. The STATE needs to be displayed in each of the 4 Groups.
I have pasted an idea of what my report has to look like. Note that the STATE California needs to be underlined only in Groups 2,3 and 4. I only included Group 4 because Groups 2 and 3 are virtually the same..
I really hope this helps.
Basically I have all 50 states in Group 1 that can NOT be underlined but when I call them in the drill down, they HAVE to be underlined...
GROUP number 1 (shows only the states)
{command.state} {amount} {command.document}
ALASKA 8
ARIZONA 5
ARKANSAS 6
CALIFORNIA 3
ETC 8
ETC 6
GROUP number 4 (shows the drill down to authority level by state)
{command.state}
CALIFORNIA {command.authority} {command.document}
CALIFORNIA 0
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|

Posted: 15 Jun 2009 at 1:08pm |
Ahhh.
I think I understand.
DrillDownGroupLevel is a function and it is a number. Zero is when you open the report and no drilldown has occurred, then 1, 2 , 3 etc. so try:
if drilldowngrouplevel=0 then crNoLine else CrDoubleLine
|
IP Logged |
|
|
|