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
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
RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT
When you say "put the value of the shared report field" what do you mean by that, would you be able to provide an example? I'm fairly new to Crystal so need assistance with formulas.
Please let me when possible as I have been on this project for a while and need to complete soon.
Many Thanks
RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT
Shared stringvar somevalue := {field value}; //You could also use the result of another formula. I just used the stringvar as an example. I do not know what data type you want to pass.
In the main report in s section after the where the sub-report is (and do not suppress the section where the sub-report is or it will not execute). Another formula
Shared stringvar somevalue; // The value is now available to the main report. At this point you can do whatever comparison you need with the main report values.
RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT
The status field has the following info, 1-30 days, 31-60 days, 61-90 etc.
What I need to do is, pass this value to the main report from the subreport so it allows me to compare the subreport and main report Status field.
e.g.
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
The outcome needs to be on the main report as a field.
Thanks
RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT
Replace "SubReportStatus(previous month)" with the shared variable from the subreport.
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
RE: Compare a field from main report against a field from a subreport on CRYSTAL REPORT