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

Suppressing Subreports 1

Status
Not open for further replies.

M8tt

Technical User
Feb 11, 2003
43
NL
I am passing a variable from a Sub-Report into Group Header 2 of a main Report. This variable is then used in further calculations which are summarised in Group Footer 1.

I do not wish to see either the variable or Group 2 information.

The problem is that I cannot suppress/hide Group Header 2 as this prevents the variable being calculated. I have reduced the variable to a height of 0.1, but as there are 20 occurences of Group 2 I am left with several small blank lines before Group Footer 1 is printed - which spoils the format of my Report.

I have tried reducing the Sub-Report height down further but this also seems to prevent the variable generation.
 
Two possible work-rounds are:

a) Put the subreport displays under or over something else. If they are blank it will not matter.

b) Create several identical subreports. This will allow you to put several on them on the same line.

Madawc Williams
East Anglia
Great Britain
 
I know this is a dumb question but is this variable JUST required for a Group 1 footer calculation? You seem to be generating it 20 times by your example....19 of them as a repeat.

Is it possible to stick it in the Group 1 Header??? The same fields are available to it as the first time it is calculated in Group 2 header.

of course if you are filling an array variable through this purpose that would be another story (you have not described the Type of the variable passed by the subreport).

if it is the last occurance of that variable that is used...create a subsection of the Group 1 footer and place it before the section needed...then you only have a 0.1
space to deal with

Jim Broadbent
 
Reducing the subreport height does not prevent the shared variable from working, I suspect something else is afoot...

-k
 
I have this problem a lot.. the basic answer always ends up.. you can't get there from here. I usually end up writing a SP to get the data in the format that Crystal can use. If you are using multiple data sources that can't talk to each other then the problem multiplies..

I just gave up on a report with a similar problem.. only I had 112 blank pages before the one "summary" page printed... All because people used different datatypes to store the same key on difference DB types (Oracle and Sybase).

One outside possibility is to use columns in the detail and groups. It didn't work for me, it seems Crystal can only handle so many Subreports displayed on one page before it goes belly up. When ever I tried this in my complete dataset (about 30000 records) Crystal crashed hard. It did work with my 5 record test set however.

Lisa
 
SV - reducing the height of the subreport isn't the problem....by doing this he has an annoying small blank line which if it were 1 line would not be a problem but it is repeated 20+ times which creates a big whitespace

If he suppresses the section the subreport won't run...therein lies his problem

Jim Broadbent
 
Jim: Read the last line of the original post...

"I have tried reducing the Sub-Report height down further but this also seems to prevent the variable generation."

-k
 
If you set the height of the subreport to a VERY small size.. *sometimes* crystal won't execute it. I have been able to get it down to .04 regularly without problems. That is the smallest that crystal will allow you to save it at anyway. Even if you set it smaller if you save the report and reopen it it will be back to .04

Lisa
 
Thanks for all of the responses, to answer the questions posed: -

- The reason I need 20 Group 2's is because a running calculation is being made on them, this is a numbervar which is based on the information below them in the Detailed section. It is only after assessing all 20 that I wish to return the result in Group Footer 1.

As a result of what you said I have played around with the oject height again and discovered:

- Reducing the height past a certain point was not what was preventing the Sub-Report generating.

- Rather this was the result of the Sub-Report 'popping' out of the section, i.e. - the 'Y' figure had gone negative, even though it still appeared to be in the right section.

- This changed automatically when I changed the Height of the object, every time I reduce the height of the object below 0.1 the 'Y' figure is proportionally and automatically reduced as well (this is what led me to believe I had reduced the height below 0.1).

- The height itself is reset to 0.1 whatever I do (Lisa - I tried 0.04 but the result is the same).


I'd appreciate any more ideas you have?

Many Thanks, Matt.
 
Has anyone been able to solve this problem yet ? I too need to suppress a subreport, but I do need it to run, to return a variable to the main report. I have tried suppressing the main report, reducing the height of the subreport ( I can only go down to 0.1 too ), but I still get a load of white space between my groups.
Maybe Crystal v9.next will have a fix ?

Bart
 
In addition to minimising the vertical dimensions of both your subreport and the section of the main report where it's placed, try formatting the section to Underlay Following Sections.

Naith
 
Nath,

I have tried this, but as the subreport runs in a group header, this doesn't work - it only underlays the details section below the group header, and not the next group header where the subreport will run again.
I still get loads of white space.

Bart
 
Just for prosperity's sake, Naith's Underlay Following Section works perfectly for this situation (as long as it's in the Detail, I suppose)

I was having the same problem.....
- Have a subreport populating some variables
- Needed some field in my detail based off those variables
- If I put the subreport in the Detail it wouldn't work
- If I put it in a Details A and moved everything else to Detail B and suppressed Details A, it didn't populate
- But, Checking the option to Underlay everything under
Details A worked great!

So, cheers, mate!
 
M8tt,
I have run into similar problems in the past and sometimes could resolve the problem by doing more in the subreport. Would it be possible to mod the sub report to do your 20 group 2 calc in the subreport and place you subreport in your group 1 header?
Of course this is not always possible but worth considering.
MrBill
 
I have found only two ways around this. (1) Create a database view or stored procedure to eliminate the subreport, where the view has a nested subquery returning the values you require or (2) if you can, eliminate the subreport by moving the tables in the subreport to the main report and do a left outer join and add conditional formatting for suppression and formula calculation. I usually chose option (1) as it seems to have the least impact on performance (the query is processed on the server).

Goes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top