1
votes

Background

I am using Crystal Reports 2013 SP1 to create a customized invoicing report for a client. This client requires invoicing to be combined onto one 'consolidated invoice' for each of their products. Client invoices are typically created at each originating location of the work for each version of each product. As you might imagine, a client with many products can receive many invoices! So, in order to achieve this consolidation, I created two Formulas:

  • ProdNameNoDig - A string field that removes the word 'Digital' so that versions are grouped together (i.e. both 'traditional' version charges and 'digital' version charges are included on the same 'consolidated invoice').
  • InvLocation - A string field that indicates a region so that multiple originating locations can be grouped together (e.g. invoices normally be split by City1, City2, City3, but will now all be included as Region1 on the same 'consolidated invoice').

I then grouped the data by ProdNameNoDig, then InvLocation, then InvoiceNumber, then LineItem. Here is a snapshot of the Design View with the Group Expert open: Design View

When I view the reports, they are grouped properly- all of the invoices for a product's versions are grouped by region, and all of the details display as I intend.

The Problem

Here is the issue occurring when the report is created:

  • Product A, Region 1- Everything looks fine.
  • Product A, Region 2- Everything looks fine.
  • Product B, Region 1- Green circled areas of the report have the correct data. Red circled areas of the report use the ProdNameNoDig and InvLocation of Product A, Region 2
  • Product B, Region 2 - Everything looks fine.
  • Product C, Region 1- Green circled areas of the report have the correct data. Red circled areas of the report use the ProdNameNoDig and InvLocation of Product B, Region 2
  • This continues through the entire report
  • After the final product's last region, a blank (includes only the Page Header and Page Footer) page is created with the ProdNameNoDig and InvLocation of the final product's last region.

The Page Header is not properly displaying ProdNameNoDig or InvLocation (circled in Red) after a change in Group 1 (ProdNameNoDig). The SAME FIELD shown twice elsewhere on the report (circled in green) displays the correct information for the group being reported. The Page Header displays the information for the previous group! Why is a reference to the same Formula Field displaying different information in different parts of the report?

2

2 Answers

1
votes

What you can do is create a section B on your location group, move everything from A to B and copy the info on you PH to A. Then suppress you PH when pagenumber <> 1 and same for section A, but when pagenumber = 1. In that way your info will be changing once your group change.

1
votes

To the extent I understand your problem... whenever there is new Group you are facing this issue where last group2 and group1 are displayed in page header.

Without knowing how your data is getting printed as how group2 extends and where group1 starts.. my assumption is group1 is not starting when a new page starts and hence it still holds the previous value of group2 and group1...

one wayout would be instead of page header create one more group section of Group1 and display there your data.

Coming to the green area where data is correctly displayed.

  1. One is in group2 which holds the group1 data as group2 comes after group1 and displayed correct.
  2. second is page footer which comes after the group1 changes its values and correct data.

Let me know if it is not clear