×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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.

Students Click Here

Subreports not updating parameters in each report

Subreports not updating parameters in each report

Subreports not updating parameters in each report

(OP)
I am using Crystal Reports 2008 with Peachtree Premium 2012 - PSQL is the database engine.

I created a report and saved it as a new report two additional times.
I opened the original report and inserted into the Report Footer A, a subreport which is a copy of the orginal.
I inserted into the Report Footer B, a subreport which is also a copy of the orginal.

When I refresh the report and enter the parameter for the main report, all the subreports display with the same data.
Why didn't the report ask for parameters (use current or new parameters) in subreport 1 and subreport 2?

I even tried entering new parameters for each report: main, subreport 1 and subreport 2.
The parameter is the date range for the report.
For the main report I enter 9/1/2011 through 11/30/2011 (3 months)
then for subreport 1 I enter 9/1/2011 through 2/29/2012 (6 months)
then for subreport 2 I enter 9/1/2011 through 8/31/2012 (12 months)

Each page header displays 9/1/2011 through 11/30/11 and all the data on the report is the same.
I want the main report to show 3 months of data, subreport 1 to show 6 months of data and subreport 2 to show 12 months of data.
What am I am missing?

RE: Subreports not updating parameters in each report

I would just use one parameter {?StartDate} in main and sub reports. You can link parameters in subreport linking pane, drag main parameter into linking window and then find SR parameter in drop down list in lower left hand side

In select expert main report

datefield >= {?StartDate} and
datefield < dateadd("m", 3, {?StartDate})

in subreport1

datefield >= {?StartDate} and
datefield < dateadd("m", 6, {?StartDate})

same for SR 2 but with 9 months

Ian

RE: Subreports not updating parameters in each report

(OP)
Perfect!
Thank you, Ian.

I did exactly what you suggested.
I eliminated the {?Date Range} parameter and eliminated the selection statement {JrnlHdr.TransactionDate} = {?Date Range}.
In the main report, I added the parameter {?StartDate} and added the selection statement
{JrnlHdr.TransactionDate} > {?StartDate} and {JrnlHdr.TransactionDate} < dateadd("m", 3, {?StartDate})

I did the same for Subreport 1 and Subreport 2: eliminated {?Date Range} and the selection statement
{JrnlHdr.TransactionDate} = {?Date Range}. Then added the parameter {?StartDate} and added the selection statement
{JrnlHdr.TransactionDate} > {?StartDate} and {JrnlHdr.TransactionDate} < dateadd("m", 6, {?StartDate})
or < dateadd("m", 12, {?StartDate})
I edited the subreport linking and used {?StartDate} as the main parameter in the subreport 1 and 2.
I also selected {?StartDate} as the Subreport Parameter Field to Use in the ?Start Date Field Link area of the linking window.

Now, the subreports are displaying the correct data regarding the dates.

Thank you so much! You're a star!

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! Already a Member? Login


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