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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing records in two reports

Status
Not open for further replies.

dday01

Technical User
Feb 1, 2002
138
US
Hi all,

I have two different reports that should be coming up with the same total number of clients, however the totals are off by 10. I have checked table relationships, select criteria, and formulas over and over to no avail. Is there a way that I can compare the records that each report is totaling on by client ID number. And before you suggest it, manually comparing the detail portion is not realistic (over 25,000 clients ID's). I am not familiar enough with crystal to know if there is a way to do this.

Thanks,

D
 
Hi,
A few details please..

What Datasource?

Can you access that data externally and check the selection criteria ?

If a secure source, is the login info the same?

[profile]

 
One option is to export both reports to ODBC (2 different tables in MS Access). Then, use Access 'Find Unmatched Query Wizard' to locate the mismatches.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Hi Turk,

Both reports are based on the same data source (a SQL Server database).

D
 
Hi IDO,

That sounds doable, however the report i have is all totals and not details. Ie. it counts distinct client ID's but does not display them. How do I export the raw selected data to ACCESS tables.

Thanks,

D
 
You could also insert the subreport with smaller numbers as a subreport in the first report and then link the subreport to the main report by group field and client ID.

Before doing that, in the main report, go to format->section->details and uncheck "hide" or "suppress" so that this section is displayed. Insert two more detail sections. Then add the subreport into detail_b.

Within the subreport, create a shared variable for the client ID:

whileprintingrecords;
shared numbervar clientID := {table.clientID};

And place this formula in the subreport detail section (all other sections should be suppressed).

Similarly, create a shared variable in the main report:
whileprintingrecords;
shared numbervar clientIDx := {table.clientID};

And place this in detail_a in the main report, and then suppress detail_a.

Your main report fields should be in detail_c. In the main report, go to format section->detail_b AND detail_c ->suppress and enter:

whileprintingrecords;
shared numbervar clientID;
{table.clientID} = clientID;

Then within the subreport go to format section->detail->suppress and enter:

whileprintingrecords;
shared numbervar clientID;
shared numbervar clientIDx;

clientID = clientIDx;

In the design view in the main report, resize the subreport so that its height is as small as possible. Also make sure that "Suppress Blank Section" is checked for both detail sections b and c.

Now the only clientIDs that show should be the ones with no match in the subreport.

Running subreports at the detail level is time-consuming, so this may not be the best approach in that sense, but it should work.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top