Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to conditionally show single line or dotted line on change of group to a field

Status
Not open for further replies.

varadha72

Programmer
Oct 14, 2010
82
US
Hi can someone help me here.

Group Header: I have a group created called "Account" (each account has several funds)and suppressed.
In detail Section I have fields FundName and Amount only 2 fields.
Fund Name Amount Formatting Pattern
AccountA 100 Top:Line, bottom: dotted
AccountA 200 Top:dotted, bottom:Line
AccountB 300 Top:Line, bottom: Line
AccountC 25 Top:Line, bottom: dotted
AccountC 50 Top:dotted, bottom:Line
AccountD 1000 Top:Line, bottom: dotted
AccountD 2000 Top:dotted, bottom: dotted
AccountD 3000 Top:dotted, bottom:Line

Requirement:
Case:1
If group:Account has 1 fund only then the Fund_Name format would be; Top: Single Line, bottom-single line
Case-2
If group:Account has more than 1 fund then the Fund_Name format would be;
first fund would have Top: Single Line, bottom-dotted line and after that all funds underneath until the last would have Top and Bottom as dotted line. And the last fund within the same fund would have Single line

Please someone help me here.
I tried using the below logic in Top and bottom conditional formatting-
TOP-
if (not onfirstrecord and {FUND_name}=PREVIOUS({FUND_name}))
then crDottedLine
else crSingleLine

BOTTOM:
if (not onfirstrecord and {FUND_name}=PREVIOUS({FUND_name}))
then crDottedLine
else crSingleLine;

For some reason this was not showing what I needed, can someone help me out here please.

Thanks
 
 http://files.engineering.com/getfile.aspx?folder=7b1cdea5-4e84-4126-9126-d45d9de7a342&file=formatting.jpg
looks like misplace parens
if not(onfirstrecord) and . . .
 
Hi Charliy, I tried the way you suggested, but here is what is happening-
when there is a change in group, then the first fund is showing line in the top bottom, when there is more than one fund in that account.
Please help.
 
Sorry it should have been "top and bottom". Anyways I figured it out. I used running total and got it done.

if count{Group.FUND_name}=1 then crSingleLIne
else
if (Count {Group.FUND_name})=2 then
(if {#RTotal0}=1 then crSingleline else crDottedLIne)
else
if (Count ({Group.FUND_name}))>=2 then
(if {#RTotal0}=1 then crSingleline else
crdoubleline);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top