Author |
Message |
kirandb
Groupie
Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
|
Topic: conditional section Posted: 08 Sep 2009 at 9:15am |
i am using crystal 2008. I have to use conditional section as
if col3 = 50001 then
display columns 1,2,6,7,8
else
display columns 1,4,6,7,8
please help me in implementing this.
i could add a details section from section expert. so now my report has details a and details b but i dont know how to implement the above condition.
Thanks,
Kiran
|
share your knowledge
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Sep 2009 at 10:51am |
I assume you have columns 1,2,6,7,8 on detail section a and columns 1,4,6,7,8 on detail section b.
I also assume that column3 is really a field that is on each row.
In the section expert select detail section A.
Click on the formula button next to "Suppress no drill down" and add your suppression condition here...
{table.col3field}<>50001
//if it is text and not numeric make it <>"50001"
Now select section detail b and do the same thing but use the formul...
|
IP Logged |
|
kirandb
Groupie
Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
|
Posted: 08 Sep 2009 at 11:27am |
Thanks. It works.
My report displays background color on alternate rows.
What I did was to add following code
if RecordNumber mod 2 = 0 then crSilver else crNoColor
in both the Details a, Details b section.
It seems to work but is it the right way to do it.
Thanks,
Kiran
|
share your knowledge
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Sep 2009 at 11:36am |
Assuming you do not have conditional suppression ofa an entire row (both a and B) then your background should work.
If you do suppress an entire row /record # then you would need to add a counter / Running Total to use for the "x mod 2=0"
FYI - I assume you are just flipping "column 2 and 4" on these rows. You can also do this by placing these fields on top of each other on the same detail and conditionally suppress each field the same way you did the entire row... or you can make one formula field that would "flip" between the fields and display it instead...This formula fierld can also be used for sums/counts....
if {table.col3field}=50001 then {table.col2field} else {table.col4field}
Edited by DBlank - 08 Sep 2009 at 11:42am
|
IP Logged |
|
kirandb
Groupie
Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
|
Posted: 08 Sep 2009 at 11:41am |
Thanks, thats good information but is flipping just one column field is faster than the entire row ? do you think that the performance gets affected this way ?
|
share your knowledge
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Sep 2009 at 11:44am |
I am not an expert on that but my guess in this instance is that using one formula to flip would be better performance than conditiaonl suppression of a or b.
|
IP Logged |
|
kirandb
Groupie
Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
|
Posted: 08 Sep 2009 at 12:10pm |
Thanks for the reply.
Any idea on how to divide my columns by a number.
I want to divide the data coming in columns 6,7 by 1000.
How do i implement it ?
Thanks again.
Kiran
|
share your knowledge
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Sep 2009 at 12:28pm |
Assuming you mean each column individually then create 2 formula fields.
For column 6: {table.column6_field}/1000
For column 7: {table.column7_field}/1000
if you wanted the sum divided then:
({table.column6_field} +{table.column7_field})/1000
|
IP Logged |
|
kirandb
Groupie
Joined: 10 Jun 2009
Location: United States
Online Status: Offline
Posts: 69
|
Posted: 08 Sep 2009 at 2:40pm |
thanks.got it to work.
I am trying to display my header for col 5 as 'RIGHT({?period},2)' & ' Balance' and col 6 as ToNumber(RIGHT({?period},2))-1' & ' Balance' .
I am getting col5 as say 08 Balance and col 6 as 7.00 Balance.
I want col 5 as 07 Balance.
I could'nt figure out how to do this. I am doing the above in a formula.
Thanks,
Kiran
|
share your knowledge
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Sep 2009 at 2:42pm |
'0' + totext(ToNumber(RIGHT({?period},1))-1,0) + ' Balance'
Edited by DBlank - 08 Sep 2009 at 2:44pm
|
IP Logged |
|
|