Print Page | Close Window

Subreport falls onto next page when too long

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9305
Printed Date: 25 Apr 2024 at 12:56am


Topic: Subreport falls onto next page when too long
Posted By: bigburb
Subject: Subreport falls onto next page when too long
Date Posted: 05 Mar 2010 at 2:22pm
I have two subreports in my group footer. When my second subreport is too long to fit in the first page, it leaves the first page blank on and goes onto the second page. I've split the GF in to A and B, removed keep together for section and for the group, but it keeps falling onto the next page. I can't figure out what's causing this, and information on the web is scarce.



Replies:
Posted By: DBlank
Date Posted: 05 Mar 2010 at 2:37pm
Right click on the Sub Report and select Properties.
On the bottom of the properties is a box for Keep obbject together.
Uncheck it.


Posted By: bigburb
Date Posted: 08 Mar 2010 at 9:31am
OK that worked but now I have a new problem: If I have some kind of grouping on the subreport, the main report is only 2 pages long. However if I remove the grouping the subreport repeats for 6 pages.


Posted By: DBlank
Date Posted: 08 Mar 2010 at 9:35am

YOu mean if you remove grouping  in the main report? You placed the Sub-report onto the details section then, correct? If so it will reun the subreport for every time the detail section in the main report is used.

Move it from Details section to a report header or footer (in the main report).


Posted By: bigburb
Date Posted: 08 Mar 2010 at 9:49am
If I remove grouping in the subreport it repeats in the main report. The subreport is in GH5b in the main report.


Posted By: DBlank
Date Posted: 08 Mar 2010 at 9:51am
Are you linking the sub report to the main report?
If so on what field(s)? Were these the fields you had grouped on in the sub-report?


Posted By: bigburb
Date Posted: 08 Mar 2010 at 11:05am
The sub is linked in by CO number, CO line, and CO release.   The sub is grouped by job suffix.


Posted By: DBlank
Date Posted: 08 Mar 2010 at 12:12pm

one guess,

in the sub report are you using more than 1 table?
If so was the only field used from one of those tables the job-suffix field for the grouping?
If so go into the subreport edit mode, open Datbase Expert, Links Tab, Double click on the link and change your Enforce from NOt Enforced to Enforced Both


Posted By: bigburb
Date Posted: 08 Mar 2010 at 2:04pm
Worked beautifully... what exactly does changing the enforce method do?


Posted By: DBlank
Date Posted: 08 Mar 2010 at 2:18pm
I am really surprised we figured that one out...Shocked
 
(very oddly IMO) In Crystal within the Database Expert making a join between tables (or views or whatever) does not make the join "function". If you use any field from both tables the join will now "function" (or become enforced). You can use the fields in any part of the report not just displaying in the canvas (like in the select expert or a formula or grouping or a conditionalal formula) to 'enforce' the join.
If you are only using a field from 1 table but joining to another table you have to use the 'Enforce Joins' options in Crystal.
 
In SQL (and most other systems) just making the join "enforces" it so those options never made sense to me. But this is Crystal not SQL.
 
Anyway it does not come up too often as usually designers need at least one value from both tables so it often is moot (and makes it look as if Crystal automatically enforces the join).
It is the weirdest thing to watch and can really trip up your data results.
 
You can watch it in your report.
Cahange it back to Not Enforced.
Go into the Preview Mode.
See how it is too many pages.
Now take any field from the 'unused' table and drop it on the canvas. The report will shrink as it is now 'enforcing' the joins becasue you used a field from both tables.
 


Posted By: bigburb
Date Posted: 09 Mar 2010 at 8:20am
Wow that is really interesting. I learned something new today! Thanks DBlank.



Print Page | Close Window