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

Conditionally suppress sections based upon total by page

Status
Not open for further replies.

alley211

Instructor
Aug 10, 2001
61
US
Hi,

I am using 8.5.

Here is what I need to do.

I have a report that has 11 lines per page.

If there is 11 details on the page everything works fine.

If I have less, I want to have blank lines inserted for each detail section that is blank.

I also need to start a new group on a new page.

I've tried this:

variable in page header:

whileprintingrecords;
global numbervar record_count := 0;

variable on detail line:

whileprintingrecords;
global numbervar record_count := 1 + record_count



I've tried conditionally suppressing my 10 detail sections with this formula:

whileprintingrecords;
global numbervar record_count <= 1 to 10 depending upon section

This doesn't work. When I get to the third detail I start getting my blank lines.

I need to have a variable that calculates by page that my details sections are conditionally suppressed upon.

I've also tried putting a variable in the page footer that states this:

whileprintingrecords;
global numbervar record_count;
global numbervar gt := record_count

Then I tried conditionally suppressing on gt instead of record_count.

This doesn't work either, since it never quite figures out what gt should be per page.

Any suggestions.
 
Ok...you want 11 lines + headers and footers...right?

is there a lot of variables in this?

ON occasion ... I have run into this situation and gave up trying to control Crystal the way you are doing it.

So what I did was have all of the Details saved in an array variable(s)...reported in the last footer.

report header - suppressed
page header
group1 header
group 2 header (optional)
details - supressed but containing formulas
to capture the data into arrays for each
column.
group 2 footer - suppressed
group 1 footer
11 sections each with a set of array values
displayed
Page footer
report footer - suppressed

let us say we have 3 fields to report

Create an initialize formula @initialize and set 3 arrays to a single space with 11 elements/array

stringVar array field1 := [&quot; &quot;,&quot; &quot;,...&quot; &quot;]; (11 elements)
stringVar array field2 := [&quot; &quot;,&quot; &quot;,...&quot; &quot;]; (11 elements)
stringVar array field3 := [&quot; &quot;,&quot; &quot;,...&quot; &quot;]; (11 elements)
numbervar counterflag := 1;

then a calc formula to caputer the results placed in the detail section that is suppressed


stringVar array field1 ;
stringVar array field2 ;
stringVar array field3 ;
numbervar counterflag;

field1 [counterflag] := {table.field1};
field2 [counterflag] := {table.field2};
field3 [counterflag] := {table.field3};
counterflag := counterflag + 1;

now you create display fields in the results....this is tedious but works...you need 11 x 3 = 33 formulas like the following

whileprintingrecords;
stringVar array field1 ;
field1 [1];

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

whileprintingrecords;
stringVar array field1 ;
field1 [2];

...etc

the first is placed in the first footer subsection
the next in the 2nd subsection right under it

and so-on....very labour intensive boring and prone to error ...but works flawless when finished

now you are ready

since you always want 11 lines there is nothing more to do...array variables that are not changed...return a &quot; &quot; so the line is blank.

Hope this helps
 
Thanks for the response.

I did come up with another solution that appears to be shorter.

I inserted a group based upon a true statement:
id = id

Then I had the fields show up in my details section alongwith a variable that counted how many showed up.

Then I created 11 group footers and had them conditionally suppressed based upon the count from the variable. Therefore I got all 11 lines no matter if I had one detail or 11.

This works great.
 
i want to set crystal rport formulas from asp pages .
i can't do it till now can u help ?
thks
 
mnicolas,

please start a new thread, probably in the Integration forum. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top