INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Can a Main Report Section grow based on the size of a Sub Report

Can a Main Report Section grow based on the size of a Sub Report

(OP)
I'm using Crystal Reports 2011 and what I would like to do is have the Main Report footer section grow based on the size of the Sub Report.

Here is the layout of the report:

CODE

GF1a has a Sub Report for employee's job punches (could be from 1 to 4 jobs)
GF1b has a passed variable {@PassJobNumber} this comes from the Sub Report
GF1c has The employee's First and Last Name
GF1d has a line to seperate the records
Sections 1a and 1b have the underlay checked 

When there is only one record in the Sub Report everything is displayed in one line. However, when there is more than one record in the Sub Report then the resultes run into the line in GF1d. I can stop this by increasing the size of GF1c. Unfortunately it leaves a large white space for all of the Employee's who only have one record. I was wondering if there is some way to have the Main Report adjust for those employees who have more than one record from the Sub Report.

Thanks for your help!

RE: Can a Main Report Section grow based on the size of a Sub Report

You don't want to use underlay on a section that has a variable height. Remove the underlay from 1a and fine tune it from there.

RE: Can a Main Report Section grow based on the size of a Sub Report

(OP)
Thanks for your reply!
I've done that already but when you have an employee with one Job punch it doesn't display in one line.
What I'm trying now is to create a formula that counts the number of Job punches and pass that value to the Main Report. Which works fine! Now I'm trying to write a formula the Underlay whhich looks at the passed Job Count and if it's greater than 1 then don't underlay. So far it's not working but I'll keep trying.

RE: Can a Main Report Section grow based on the size of a Sub Report

(OP)
I have this working with one minor problem. When I pass the Job Count value from the subreport to the mainreport the values are off by one record. I've had this problem in the past and corrected it by placing the formulas in the correct section. I believe I have the formulas in the right sections but the passed value is still off by one record. I'll explain the structure below.

CODE

The mainreport has 1 table Employee and one group Employee
Everything is in the Group footer
GF1a has a Sub Report for employee's job punches 
GF1b has a passed variable {@PassJobCount} this comes from the Sub Report
GF1c has The employee's First and Last Name
GF1d has a line to seperate the records


The subreport has 3 tables
Job
Job_Operation
Transaction_Data
Transaction_Detail

The detail section has the following fields
Job.Job
Job_Operation.Op
Transaction_Detail.Start
{#JobCount) a running total formula on the Job.Job field set to count (eval each record and reset at change of group)

The Group Footer has one formula
{@PassJobCount}
whileprintingrecords;
shared numbervar jobcount := ({#JobCount})

The Pass formula in the Mainreport as listed above is in GF1b
(this is the formula)
whileprintingrecords;
shared numbervar jobcount; 
Any ideas would be greatly appreciated!!
Thanks for the help

RE: Can a Main Report Section grow based on the size of a Sub Report

Formulas in a section are evaluated before subreports in that same section. So I don't see a way to control the underlay of the section that contains the subreport using a value coming from that subreport. In some cases I have actually had to run the subreport twice, once invisibly ahead of the other, and use that to control the visible section.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
http://www.kenhamady.com/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close