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

Crystal Subreport causes duplicates in main report

Status
Not open for further replies.

mcbeth352001

Technical User
Jul 13, 2006
15
I have a statement report in Crystal 10.

First off, the report was grouped by Customer, apply to number, and date applied. The only problem with this is that all of the documents need to be in ascending order, not just inside the apply to number group.

So, I created the main report to only show the invoices in ascending order (details a). Next I have a subreport to show all of the items ( payments, finance charges, etc) that apply to the invoices (details b) also in ascending order.

everything appeared to look fine, but on customers where the invoices have no detail the last 3 or 4 invoices get duplicated. On the report where the valid invoices finish printing a page break occurs and then the dups getprinted on a different page.

note: the page footer show customers total and only prints on the page where the pagenumber = totalpagecount. The dups don't mess up the totals just add a lot of white space.

*********
If i don't suppress the subreport when it's blank then everything runs fine, but it will put a blank like under every invoice and still carry over to an extra page (killing our paper cost).

What am I missing.
 
How are customers linked to invoices? I'm not clear what's going on, but a 'Left Outer' might fix it.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
All of the tables that are linked to the main table I use for the report have left outer joins.

Good idea though

What it appears to be is that when crystal initially calculates where everything is to be printed it does take into account the white space that will later be suppressed.

So, what ever was originally calculated to be printed on the second page still gets printed. Even though it has been squeezed down to one page due to the suppressed white space.

I just don't know how to fix it.

Still open to suggestions?
 
Left-outer joins fail if you also put a test on the second table. That's because the test hits a null when that record is not there. A solution would be something like
Code:
not IsNull({table.jobcode})
and
{table.jobcode} in [1, 2, 3]
But looking again at what you say, that's probably not it. What you could do is section suppression when codes are duplicated. Test
Code:
{code} = Previous({code})

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top