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!

text field suppresion 1

Status
Not open for further replies.

keo216

Technical User
Nov 26, 2002
102
US
I want to display a text object in a gf based on a field in the record. I created a text box that is either suppressed or not depending on value of mtpm.com_code. With some help from a local group we came up with the following.

if isnull ({mtpm.com_code}) or {mtpm.com_code} in ["water","waste","offic","treat","lab"]
then true
else
false

This works if the field mtpm.com_code is the same for each record, but I might have 20 records and they will all have a dif value. The question is: how do I get the text object to print if only one record out of 20 is the right value?
thanks
keo kowen@rrwa.net
 
if you place this formula field in the group footer, it will behave as if it is reading the LAST record in that group.

How do you want it to behave? Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
So you only want it to print if one record is the same for the group?

ref: "but I might have 20 records and they will all have a dif value. The question is: how do I get the text object to print if only one record out of 20 is the right value?"

Or is that that you want any to print if they are the right value, or the first, or ???

Anyway, consider the following to determine if any have the criteria:

In the group header place:
whileprintingrecords;
global booleanvar CheckMe := False;

In the details place:
whileprintingrecords;
global booleanvar Checkme;
if isnull ({mtpm.com_code}) or {mtpm.com_code} in ["water","waste","offic","treat","lab"]
then Checkme := true

In the group footer use:
whileprintingrecords;
global booleanvar CheckMe;
CheckMe

CheckMe will tell you if any are in the criteria.

-k
 
I look back and feel I did not explain this well enough:
An example of a report would be:

Page H. Stk No Price Qty Comm_code
Record 1 AB46 $2.35 21 Water
Record 2 JE90 $2.45 10 Lab
Record 3 KL29 $3.99 11 Treat
Record 4 $12.83 29 SIRIS
Record 5 XY28 $3.88 33

Note that Comm_code for record 5 is null and for record 4 is something other than what is in my list of comm_code to check for. If comm_code is 'SIRIS' the I want it to print
"If Stock Number is Printed in RED then part is for SIRIS".
I'm trying to suppress the text object if none of the records have SIRIS as a comm_code. And print it if ANY one of the records have comm_code that reads SIRIS.
I think I may have errored from the very beginning in that I started out trying to do it the most complicated way and then expecting you to tell me how to make it work. If you see a simplier way, please set me straight.


kowen@rrwa.net
 
Ok...I am not sure what you are grouping on here.

You seem to be displaying the results in the Group footer but from your example there doesn't seem to be anything common to the records.

All the stock nos are different if that is what you are grouping on.

Your formula stated at the beginning is fine...perhaps it is placed in the wrong spot. Maybe you should be displaying your data in the detail section and placing the formula there where it can act on each record. In the Footer it only acts on the last record of a group...and frankly I am not sure what that is from your data.

If there is a reason why this is being done in the footer...please explain ....this...and what the data is grouped on. Jim Broadbent
 
You could try this:

1-Create a formula {@SIRIS}:

if is null({Comm_Code}) or {Comm_Code} <> &quot;SIRIS&quot; then 0
else 1

2-Place this in detail section and suppress the field.

3-Create a formula {@textnote} and place in your group footer:

if sum({@SIRIS},{yourgroup}) >= 1 then
&quot;If Stock Number is Printed in RED then part is for SIRIS&quot; else &quot;&quot;

What I don't understand in your example is that the stock number for SIRIS is not shown, so how can it be red? :) Is there some additional requirement that I'm missing?

-LB
 
That worked great. Thanks for your help. Sorry it took so long to explain it right. kowen@rrwa.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top