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

Sections not suppressing

Status
Not open for further replies.

samson123

Programmer
Jun 17, 2005
79
US
Suppression

I am using CR XI, Access 2000.
I am dynamically displaying values based on the user selection.

Following is the layout of the report

?Param1 ?Param2 ?Param3 ?Param4 ?Param5 ?Param6

@Col1 @Col2 @Col3 @Col4 @Col5 @Col6


?Param# are parameter accepting MULTIPLE VALUEs.

@col1 formula and the other &col# are the same, except ?Param#

@col1
-------
Select {?Param1}[2]
Case "CONID":totext({TCON.CONID},"00")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""

It is grouped by formula @grp1

@grp1
------
Select {?grpParam1}
Case "CONID":totext({TCON.CONID},"00")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": totext({TCON.CONTPID})
default: ""

I have 6 sections
GF1a, GF1b,.... GF1f


?Param1 ?Param2 ?Param3 ?Param4 ?Param5 ?Param6

Details @Col1 @Col2 @Col3 @Col4 @Col5 @Col6

GF1a @Count6
GF1b @count5
GF1c @count4
GF1d @count3
GF1e @count2
GF1f @count1

@count6 and all the fomula are the same excecpt the numbers
@count6
-----
Select {?grpParam1}
Case "CONID": count({@col6},{@grp1})
Case "CONFNM": count({@col6},{@grp1})
Case "CONMNM": count({@col6},{@grp1})
Case "CONLNM": count({@col6},{@grp1})
Case "CONCMP": count({@col6},{@grp1})
Case "CONTPID": count({@col6},{@grp1})
default:0

I have a formula @colnumber

@colnumber
---------------
numbervar column1;
numbervar column2;
numbervar column3;
numbervar column4;
numbervar column5;
numbervar column6;

if len({?Param1}[2]) > 0 then column1 := 1;
if len({?Param2}[2]) > 0 then column2 := 1;
if len({?Param3}[2]) > 0 then column3 := 1;
if len({?Param4}[2]) > 0 then column4 := 1;
if len({?Param5}[2]) > 0 then column5 := 1;
if len({?Param6}[2]) > 0 then column6 := 1;

column1+column2+column3+column4+column5+column6;

To suppress the sections GF1 thru GF6 I have in their corresponding section the following code

GF1a-> Suppress-> x+2-> {@colnumber} <> 6
..
.
.
GF1f-->Suppress-> x+2-> {@colnumber} <> 1

My PROBLEM:

These sections are not suppressing the count.
For example, if I pass 4 parameters, This is what I see

?Param1 ?Param2 ?Param3 ?Param4

Details @Col1 @Col2 @Col3 @Col4


GF1c @count4
GF1d @count3
GF1e @count2
GF1f @count1

THIS IS WHAT I EXPECT TO SEE

?Param1 ?Param2 ?Param3 ?Param4

Details @Col1 @Col2 @Col3 @Col4



GF1c @count4


I am sure I am missing something very obvious..

Please advise.

 
Just wanted to inform one more thing..

When I run the preview from crystal reports and enter just 3 parameters, and leave the other 3 parameters blank

For example
?Param1[1] = "First Name"
?Param1[2] = "CONFNM"

?Param2[1] = "Middle Name"
?Param2[2] = "CONMNM"

?Param3[1] = "Last Name"
?Param3[2] = "CONLNM"


I get this error message on Param4 "Value is not valid"

But when I enter value in the 4th parameter as below

?Param4[1] = "Company Name"
?Param4[2] = ""

I get this error message
"A subscript must be between 1 and the size of the array"

HELP!!!!

I do not understand what am I missing ?



 
I can't recreate your problem--this works for me, although I have a couple of comments.

First, it is unclear why you need to make the parameters multiple value, since each column can only be one field at a time. If you eliminate the multiple value option, you then won't need to use the subscripts on the parameter in your formulas. It looks like you want to group on the results of the first parameter. It appears that you are not allowing multiple values here, and that therefore this formula would pick up the equivalent of {?param}[1] (except for the last option). Not sure what the implications of this are.

Second, you do not need the {@count1-6} formulas. You can just right click on each detail level formula and insert a summary at the group level. The results will be the same in each case, since you are merely counting the number of times the formula executes.

I guess the point of this is to position the group summary under the last column.

-LB
 
LB,

Thanks for responding,

The reason for a multiple value parameter is as below

?Param1[1] = "First Name" ..(Value Coming from table)
will be the display name of the column

?Param1[2] = "CONFNM" ..(Value coming from a table)
will help retrieve the value for the column using select case in @col fomula

Hence i cannot hard code the first name
Case "First Name": {TCON.CONFNM}

That is why you see I do
Case "CONFNM": {TCON.CONFNM}

>>It looks like you want to group on the results of the first parameter
No I want to group on any parameter from Parma 1 thru Param
6 , whatever the user selects.


 
It would be much simpler for the user if you just allowed discrete parameter values and created separate column name formulas like:

select {?Param1}
Case "CONID" : "ID"
Case "CONFNM": "First Name"
Case "CONMNM": "Middle Name" //or whatever this is
Case "CONLNM": "Last Name"
Case "CONCMP": "Company Name"
Case "CONTPID": "Description"//or whatever this is
default: ""

I guess the grouping itself does not contribute to the problem. As I said, your formulas work for me when I mocked this up. You did use the suppression formulas in the section expert, right?

-LB
 
LB,

I created separate parameters for columns...

Disp1 thru Disp 6

I have created a @colnumber

numbervar column1;
numbervar column2;
numbervar column3;
numbervar column4;
numbervar column5;
numbervar column6;

if len(trim({?Disp1})) > 0 then column1 := 1 else column1 := 0;
if len(trim({?Disp2})) > 0 then column2 := 1 else column2 := 0;
if len(trim({?Disp3})) > 0 then column3 := 1 else column3 := 0;
if len(trim({?Disp4})) > 0 then column4 := 1 else column4 := 0;
if len(trim({?Disp5})) > 0 then column5 := 1 else column5 := 0;
if len(trim({?Disp6})) > 0 then column6 := 1 else column6 := 0;

column1+column2+column3+column4+column5+column6;

As suggested by you I just right click on each detail level formula and insert a summary at the group level.

in the suppression formula of the sectiions GF1a thru GF1f

gf1a
I include this {@colnumber} <> 6

gf1b...{@colnumber} <> 5 and so on..

It does not display as expected...

?Param1 ?Param2 ?Param3 ?Param4 ?Param5

Details @Col1 @Col2 @Col3 @Col4 @Col5

GF1b @count5
GF1c @count4
GF1d @count3
GF1e @count2
GF1f @count1

LB, I do not see colnumber value. I placed it to next to the count summary.. Looks like something is wrong with the colnumber formula which is messing up everything...

Can you see what I am missing ? Thanks for your help...

 
Correction

?Disp1 ?Disp2 ?Disp3 ?Disp4 ?Disp5

Details @Col1 @Col2 @Col3 @Col4 @Col5

GF1b @count5
GF1c @count4
GF1d @count3
GF1e @count2
GF1f @count1
 
You should be using {?param1},{param2}, etc. in your colnumber formula, not the header formula. You will also need to use conditional field suppression (right click on label->format field->common->suppress->x+2) on the column labels (you could use this for the group summaries, too, instead of using separate group footer sections):

//for col6:
{@colnumber} <> 6

-LB
 
I am now using {?param1},{?param2} , etc.. in the colnumber formula as suggested by u.. Still not giving the desired output...

As mentioned befor my colnumber value ashows 6 if all 6 parameters passed.

But any othen number of parameters , the colnumber does not display any value ...Why would that happen ?

I am thinking that could be the reason for this incorrect output..Your thought please..
 
Do you have {@colnumber} placed in a section that is suppressed? You don't really have to have it on the canvas at all--except to do this check.

-LB
 
I have just placed to check the value....and i do not see any value..
 
LB and others ,

what could be wrong in my approach..? I am lost ..

can somebody please provide a direction ?
 
Please check your {@colnumber} formula carefully. The only way I could recreate your problem was by changing the formula like this:

numbervar column1;
numbervar column2;
numbervar column3;
numbervar column4;
numbervar column5;
numbervar column6;

if len(trim({?Disp1})) > 0 then column1 := 1 else column1 := 0;
if len(trim({?Disp2})) > 0 then column2 := 1 else column2 := 0;
if len(trim({?Disp3})) > 0 then column3 := 1 else column3 := 0;
if len(trim({?Disp4})) > 0 then column4 := 1 else column4 := 0;
if len(trim({?Disp5})) > 0 then column5 := 1 else column4 := 0;
if len(trim({?Disp6})) > 0 then column6 := 1 else column4 := 0;

-LB
 
LB,

I checked my @colnumber code, and everything in that looks correct.

This is driving me crazy...
 
I think you should post all your formulas and tell us where they are placed, so that we can see where you are right now.

-LB
 
I am using the following formula

@col1

Select {?Param1}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""

@col2

Select {?Param2}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""


@col3

Select {?Param3}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""

@col4

Select {?Param4}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""

@col5

Select {?Param5}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""

@col6

Select {?Param6}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""



**************************

@colnumber

numbervar column1;
numbervar column2;
numbervar column3;
numbervar column4;
numbervar column5;
numbervar column6;

if len(trim({?Param1})) > 0 then column1 := 1 else column1 := 0;
if len(trim({?Param2})) > 0 then column2 := 1 else column2 := 0;
if len(trim({?Param3})) > 0 then column3 := 1 else column3 := 0;
if len(trim({?Param4})) > 0 then column4 := 1 else column4 := 0;
if len(trim({?Param5})) > 0 then column5 := 1 else column5 := 0;
if len(trim({?Param6})) > 0 then column6 := 1 else column6 := 0;

column1+column2+column3+column4+column5+column6;
******************************************************

Grouped by @grp1

@grp1
Select {?grpParam1}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": totext({TCON.CONTPID})
default: ""
************************************

In each of the section that needs to be suppressed it
GF1a.....{@colnumber} <> 6
GF1b.....{@colnumber} <> 5
GF1c.....{@colnumber} <> 4
GF1d.....{@colnumber} <> 3
GF1e.....{@colnumber} <> 2
GF1f.....{@colnumber} <> 1
 
Did you copy these into the post instead of recreating them?

For the section suppression formulas, the formulas are placed in the section expert->GF1a->suppress->x+2, right?

I just can't recreate this problem unless I misplace these formulas or make mistakes within them.

-LB
 
I just copied and pasted the code....

>>For the section suppression formulas, the formulas are placed in the section expert->GF1a->suppress->x+2, right?

Yes

I am thinking of creating this report all over again from scratch.. I do not think I have any other option.
 
Yes, your formulas look okay to me. Does the problem continue to be that no group footer sections are suppressed when you make selections for fewer than all six parameters, i.e., when {@colnumber} is something other than 6?

I don't have access to XI right now, so can't test it. How did you set up the parameters to allow for no selection?

-LB
 
Does the problem continue to be that no group footer sections are suppressed when you make selections for fewer than all six parameters, i.e., when {@colnumber} is something other than 6?

You understood it correctly..No group footer sections are suppressed when I make selections for fewer than all six parameters, i.e., when {@colnumber} is something other than 6?


How did you set up the parameters to allow for no selection?

I have not done anything special for no selection

@col1

Select {?Param1}
Case "CONID":totext({TCON.CONID},0,"")
Case "CONFNM": {TCON.CONFNM}
Case "CONMNM": {TCON.CONMNM}
Case "CONLNM": {TCON.CONLNM}
Case "CONCMP": {TCON.CONCMP}
Case "CONTPID": {MMISCCD.CDVLDESC}
default: ""

I have ?Disp1 thru ?Disp6 parameters which I use to display column Names.

?Disp1 ?Disp2 ?Disp3 ?Disp4 ?Disp5

Details @Col1 @Col2 @Col3 @Col4 @Col5

GF1b @count5
GF1c @count4
GF1d @count3
GF1e @count2
GF1f @count1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top