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!

Sections not getting suppressed 1

Status
Not open for further replies.

samson123

Programmer
Jun 17, 2005
79
US
I am using CRXI, Access...

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

Following is the layout of the report

?Disp1 ?Disp2 ?Disp3 ?Disp4 ?Disp5 ?Disp66

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


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: ""

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


@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

*********************
I am creating summary for each col in the sections.
Suppose I pass 5 parameters,
The output that I am expecting is

?Disp1 ?Disp2 ?Disp3 ?Disp4 ?Disp5

Details @Col1 @Col2 @Col3 @Col4 @Col5

GF1b @count5

But I am getting
?Disp1 ?Disp2 ?Disp3 ?Disp4 ?Disp5

Details @Col1 @Col2 @Col3 @Col4 @Col5

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

The strange thing the correct output is visible from within the crystal Preview window...

What is wrong with my code ? I will aprreciate if somebody could give me a direction .
 
Well I forgot to mention that it does not display correct out when I call the report from VB and pass parameters.

It displays it correctly when i preview in crystal report.
 
Then your concern is likely with VB, not Crystal.

I would guess that you're passing nulls from your VB app so checks such as if len(trim({?Param1})) > 0 don't work the way you expect, so modifying to check for null may resolve, as in:

if not(isnull({?Param1}))
and
len(trim({?Param1})) > 0 then
column1 := 1
else
column1 := 0;

-k
 
K,

It worked....Thanks for your help Really appreciate it...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top