Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare strings in Crystal - sub reports

Status
Not open for further replies.

sarahp13

Programmer
May 20, 2011
1
US
Hi

I have company name in sub report 1 and company name in sub report 2, if both the values are same then they should be eliminated from the report.
CRYSTAL REPORTS
How do I solve this?


Help please!!

Sarah
 
You need to explain in what main report sections the subreports are located. Also explain whether the company names are only displayed in the subreports (so that you wanted them eliminated from each when there is a match) or whether the company name is in the main report and that is where you want it eliminated.

If the subs are linked to the main report, then also explain the group structure of the main report (what fields you are grouping on) and on what fields the subs are linked.

-LB
 
To pass data back from a subreport, use a shared variable. For a string, put a formula field in the subreport like
Code:
Shared StringVar 
NameFound := {report.name}
To access it in the main report, create another formula field with
Code:
whileprintingrecords;
Shared StringVar NameFound;
NameFound

Note that the shared variable is only available in the section after the section which contains the subreport.

In your case, you should have two separate shared variables for the two reports. And make them very small, assuming you are not intending to display anything from them.

If you can avoid subreports, this is more efficient. One option is to add the same table more than once: it is called an Alias and is treated as indepenent.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top