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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress each field but cant suppress in Section Expert?

Status
Not open for further replies.

rcrecelius

Technical User
Mar 13, 2003
108
US
Im using a simple formula to suppress the data I dont want to see...
{PARTS.p_part_type} = &quot;N&quot; and {PARTS.p_qty_avail} < 1
This works if i go to each field in the Format Field/Suppress area but I tried to do this in the Section Expert/Details and it doesnt work properly, it suppresses everything that is {PARTS.p_part_type} = &quot;N&quot;.
????
 
When you say it doesn't work, what result are you getting versus what you are expecting?

Also, suppressed records will still evaluate in any subtotals and/or grand totals that you may have. So instead of suppressing the records try using a record selection formula to remove them from the report entirely. Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Let me clarify..
When using the above formula in the Section Expert, it suppresses ALL records that are part type &quot;N&quot;.

When I use the same formula in Format Field, it suppresses part type &quot;N&quot; unless it has quantity available =>1, which is the desired result. Im not using any running totals so that is not an issue.
 
reverse the order and see if that works???

Or alternatively use this formula that seems to work at the formula level on EVERY formula in the section

Then enable the &quot;Suppress Blank Section&quot;

I never argue with Crystal if it wants to give attitude :)

Your original formula sould have worked though Jim Broadbent
 
ngolem,
I ended up using that formula in each field and I got what I wanted. However, using that report a second day brought out another oddity...
Using this formula for background color(also in Section expert)
if isnull({PARTS.p_zone}) or isnull({PARTS.p_bin})
then yellow else nocolor
This formula worked fine when I created the report. the next day using this same report i did not have the background color for the null values. I tried this formula...
If {PARTS.p_zone} = &quot;&quot; or {PARTS.p_bin} = &quot;&quot; then yellow else nocolor
This formula worked but then again, the following day THAT formula was not working! I ended up combining both formulas, I will find out another day if this clears up Crystals attitude.

 
Something weird is going on

Your colors should be CRYellow and CRNoColor but I suspect that is a typo on your part.

Weirdness is hard to diagnoze

Jim Broadbent
 
I'm guessing that your original problem is also because you are encountering nulls or empty fields for {PARTS.p_qty_avail}. For the field suppression, the evaluation formula would check for the presence of &quot;N&quot; for part type and then check whether quantity available was less than 1, and suppress it if there was a number there less than 1, and it would not evaluate the field at all if it were null or empty--but you wouldn't know it because it appears blank already (as if it were suppressed).

But at the record level (for detail section suppression), the formula is evaluating the record as a whole, and when it encounters nulls or empty fields for quantity available in some of the records, I'm guessing that it doesn't know what to do, and then disregards the second part of the formula altogether.

You could potentially eliminate the problem by replacing the quantity field with a formula that accounts for nulls or fields where a space has been entered.

Regarding the changing results in background color, I wondered whether, in trying to solve the first problem, you might have changed the setting in Report Options &quot;Convert nulls to defaults&quot; and then back again?

-LB
 
As Lbass mentiones, try the following as a sanity check:

(isnull({PARTS.p_part_type}) or {PARTS.p_part_type} = &quot;N&quot;) and
isnull({PARTS.p_qty_avail})
or
{PARTS.p_qty_avail} < 1

Ngolem: Crystal accepts Yellow and Nocolor.

-k
 
BTW, the above formula should be placed in the section as in the following:

Right click the section->Format Section->X-2 next to Suppress

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top