×
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

Compare a field from main report against a field from a subreport on CRYSTAL REPORT

Compare a field from main report against a field from a subreport on CRYSTAL REPORT

Compare a field from main report against a field from a subreport on CRYSTAL REPORT

(OP)
I was wondering if there is a way for comparing a field from the main report against the a field from a subreport.
My main report is pointing to the current month data and the same report is pointing to the previous month data in the sub report.

I need to do something like:
IF SubReportStatus(previous month) = '1-30 days' AND MainReportStatus(Current month) = '31-60 days' THEN "Worse" ELSE IF
IF SubReportStatus(previous month) = '61-90 days' AND MainReportStatus(Current month) = '91+ days' THEN "Worse"

etc etc.

It would be really helpful and really appreciated to know if there's a way this can be done.

Many Thanks

RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT

You can return info from the subreport to the main report via a shared variable.
Or you can pass information from the main report into the subreport using a subreport link.

view, export, burst, email, and schedule Crystal Reports.
www.MilletSoftware.com

RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT

(OP)
Hi Ido,

How would I go on about doing that?
I have tried a few ways, but what sort of shared variable and what would the steps be.
I want to be able to achieve the below and the outcome comes on the current month (main report):
IF SubReportStatus(previous month) = '1-30 days' AND MainReportStatus(Current month) = '31-60 days' THEN "Worse" ELSE IF
IF SubReportStatus(previous month) = '61-90 days' AND MainReportStatus(Current month) = '91+ days' THEN "Worse"

RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT

1) Declare a shared variable in the subreport and assign it a value

2) in the main report, somewhere after the placement of the subreport, compare the shared variable to the main report value

Macola Software Veteran and SAP Business One Consultant on Training Wheels

Check out our Macola tools:

www.gainfocus.biz/exceladdin.html

RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT

(OP)
Hi Dgillz,

The field's I am trying to compare are text fields.
Can you please provide an example as to how I can declare this please?
I tried a few different ways but non worked.

Thanks

RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT

In the subreport:

Shared Stringvar MyVar:={MySubreportField}

In the main report:

If Shared Stringvar MyVar<>{MyMainReportField} then.....

Macola Software Veteran and SAP Business One Consultant on Training Wheels

Check out our Macola tools:

www.gainfocus.biz/exceladdin.html

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