I am new to Crystal Reports, and am attempting to fix a report that was started by the vendor of the
application where the report is run from, and I've identified 2 problem areas:
1. The report isn't grouping data in the subreport correctly (records are duplicated),
2. the running total for the groups contained in the subreport isn't summing correctly.
The report doesn't use any stored procedures, and the data consists of information regarding purchase
orders. The report displays the purchase order record and associated purchase order detail records (line
items). The main report displays "common" information for the purchase order record, and the subreport
displays detail information (line items) for the purchase order, and is supposed to be grouped by part
number, date, and then cost (of the part).
The subreport is placed in a GF. The layout of the main report:
RH - suppressed
PHa-PHb, GH1a-GH1h - record information
GH2 - Suppressed, with formula to create item numbers representing groups
GF2a-GF2d - record detail information, formula fields, including a running total from the subreport
GF2e - subreport containing additional record detail
GF2g - formula field
The layout of the subreport:
RH - suppressed
GH1 - group header
Details - data
GF1 - suppressed
RF - suppressed
The first issue that I was able to identify is that the running total is incorrect, and has been
placed above the subreport. I've read that because Crystal processes information in a linear fashion, a
running total won't work where it's been placed (above the subreport). Is this correct? As it is,
only the first record in the group is being processed. I used a shared variable, but this also presented
a problem with the first record's sum being skipped and subsequent summed values (even though summed
correctly) placed in the next/subsequent record. Given that most people believe that it's not possible
to use a running total placed above the subreport whose values are summed, I haven't moved forward with
troubleshooting until someone states that this can be done.
I don't understand why some records are being duplicated on the subreport, I'm sure because I'm having
trouble understanding how the groups are grouped as they currently are. I changed the group on the
subreport to group by part because it seemed more intuitively correct (initially the subreport was set
to group by purchase order line ID), but the duplication of records still exists. I also eliminated some
of the existing subreport links that appeared to be redundant (for lack of a better term), but this also
made no impact on the subreport data.
I've included a link to 2 pics: 1 to illustrate the problem, the other to show the desired result. The shaded rows are heading rows, and the second level heading rows should repeat for each group. The red lines
illustrate the duplication.
https://goo.gl/photos/wEqBv7bByZFPRjBP7
FWIW, by suppressing the second level group header, the duplication of records ceases.
If you would provide any input, I'd appreciate it.
Thank you.
Matt
|