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!

Condtional Suppression of a Field

Status
Not open for further replies.

malam123

Programmer
May 23, 2006
13
US
Hi
I have a report which has 6 static paramters,and these 5 clients have a field on the report which needs to be displayed for 3 clients suppressed for two clients and i have parameter 'ALL' and that need to be displayed with their respective criteria when ALL is used i.e when it needs to be displayed for 3 clients it should come up with that value and for the other 2 clients I need just a blank space.
 
Consider using example data as opposed to attempting to write descriptions.

In general technical information is key, after stating it then you might try to:

Crystal version
Database/connectivity
Example data
Expected output

Not sure what "'ALL' and that need to be displayed with their respective criteria", I guess there's a bit of a language barrier.

And do you only want a field suppressed in certain instances, or the rows filtered from the report?

Genrally it's the latter.

Check my FAQs, perhaps that will help you:

Filtering data:
faq767-3825

Displaying parameters:
faq767-5684

Suppressing a field is very basic, right click the field and select format field and place the code in the X2 next to suppress, so I'm guessing that's not what you really want.

-k
 
I want to make it little clear,these 6 parameters are 5 clients name and ALL refers to ALL clients.Ther field is present in the report and i want just that field to be supressed or displayed accordingly.When ALL parameter is used I want the field to be shown/supressed accordingly.
 
Consider with a Example
A,B,C,D,E are clients and parameters (parameter names are als0 A,B,C,D,E and ALL ) are based on them,'ALL' is the parameter which displays all these 5 clients data.I have a number field Table1.field_1 and this field need to be supressed when A,B, or C are used and displayed for D & E. When 'ALL' is used this field need to be supressed for A,B,C and displayed for D and E. I hope this is little more clear.
 
Hi,
So, a different field in the record needs to be supressed based on the parameter passed - BUT, if ALL is passed,for some reason, you still want to supress A,B,C and show D and E???
How can your report KNOW that ( unless you always want to show that field for D and E clients,and never show it for A, B or C). Your example is too ambiguous to be sure but why not a simple supression formula like:

Client In ('A'.'B','C')



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The report has parameter by client name i.e A,B,C,D,E and 'ALL'. When A is used as aparamter it will get data for client A .I want to show that field for A and When 'All' is used I want that to be shown for A,B,C parameter and suppressed for D and E.
 
Which is it?


When 'ALL' is used this field need to be supressed for A,B,C and displayed for D and E.


OR


When 'All' is used I want that to be shown for A,B,C parameter and suppressed for D and E.


They cannot BOTH be what you want..

Show us Examples when each parameter is chosen and show it by client record..

Like:
If Parameter is A, for Client A, show field, suppress for all other clients.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
When 'All' is used I want that to be shown for A,B,C parameter and suppressed for D and E.
When Client is A,selected as a parameter the report is designed is such a way that it shows data only for client A.When ALL is used as parameter it pulls data for all the clients,now I want this particular field to show up only for client A,B,C and suppressed those values for D and E.

 
Hi,
OK, then your suppression formula would be

{client_field} in ('D','E')


That will only show that field for clients A,B,C



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I am using this code in supression and its working fine but except for ALL parameter its showing up values for all trusts.

if({?Trust}='A') then {name_info_10_Trust.full_name} ='xyz'
else if({?Trust}='B') then {name_info_10_Trust.full_name} ='pqr'
else if({?Trust}='C') then {name_info_10_Trust.full_name} ='stw'
else if({?Trust}='D') then {name_info_10_Trust.full_name} ='mno'
else if({?Trust}='E') then {name_info_10_Trust.full_name} ='def'
else if({?Trust}='F') then {name_info_10_Trust.full_name} ='stw'
else if({?Trust}='ALL') then {name_info_10_Trust.full_name} like '*'
 
Hi,
That code appears to be a record selection formula, not a field suppression one..

It seems to work because only 1 client is selected from the
table when A-F are used, but ALL clients are returned when ALL is used..

Right-click on the actual field you want to suppress, select format field, and, from the 'Common' tab, click on the x*2 button next to 'suppress' and, in the formula entry section that is opened, use the formula I posted..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Change it to:

if ({?Trust}='ALL') then {name_info_10_Trust.full_name} in ["xyz","pqr","stw"]
else if({?Trust}='A') then {name_info_10_Trust.full_name} ='xyz'
else if({?Trust}='B') then {name_info_10_Trust.full_name} ='pqr'
else if({?Trust}='C') then {name_info_10_Trust.full_name} ='stw'
else if({?Trust}='D') then {name_info_10_Trust.full_name} ='mno'
else if({?Trust}='E') then {name_info_10_Trust.full_name} ='def'
else if({?Trust}='F') then {name_info_10_Trust.full_name} ='stw'

Why would you use a like '*' when you stated that "When 'All' is used I want that to be shown for A,B,C parameter"

Also you are probably using the term parameter improperly, and you should NOT be using suppression at all, you should be placing this in the Report-Record Selection-Record, which applies filtering, it does not suppress.

-k
 
Hi
This helped me..with little modification I accomplished the task.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top