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

Suppress/select formula to Display in a subreport if it is NOT in the main report

Status
Not open for further replies.

bordway

IS-IT--Management
Sep 24, 2002
54
US
Hi,

I've been stuck for a while on how to suppress subreport groups if their value matches a line in the main report.
Thanks in advance for any suggestions.

I want to show backorders on a pack slip.
Unfortunately the business rules will not allow a zero quantity line on a shipment.
I can't change anything in the shipment data, I can only add/join to related tables.
So I can pull in all the orderrel data to a subreport as long as I only join to the shipment table by the ordernum.
The data table/joins are a little funky but is gets me the Order lines, including those not included on the shipment.
Resulting line multiplication in the subreport, so I've grouped by OrderNum, OrderLine and OrderRel (OrderRel table) to eliminate duplicates.

Now I only want the "Non Matching" group to display.
In the example below for 20000000_________1________1.
I apologize for the look


****** Main Report ************
***** {Shipment} table ********
******* Columns ***************
OrderNum_OrderLine_OrderRel
20000000_________2________1
20000000_________3________1
20000000_________4________1


***** Subreport *****************************
***** {OrderRel} table + {Shipment} data ****
(Linking by the OrderNum only so that all lines of OrderRel are returned)
3 lines in main report so each orderrel line is multiplied by 3
************************************
** Group by OrderNum_OrderLine_OrderRel
OrderNum_OrderLine_OrderRel from the OrderRel table_______ OrderNum OrderLine OrderRel from the ShipMent table
20000000_________1________1________________________________ 20000000______2________1_____Detail Line
20000000_________1________1________________________________ 20000000______3________1_____Detail Line
20000000_________1________1________________________________ 20000000______4________1_____Detail Line
** Group Footer - ********* DISPLAY this because it is NOT on the main report ***
20000000_________2________1 ________________________________ 20000000______2________1_____Detail Line
20000000_________2________1 ________________________________ 20000000______3________1_____Detail Line
20000000_________2________1 ________________________________ 20000000______4________1_____Detail Line
** Group Footer - SUPPRESS because it has a match on the main report
20000000_________3________1 ________________________________ 20000000______2________1_____Detail Line
20000000_________3________1 ________________________________ 20000000______3________1_____Detail Line
20000000_________3________1 ________________________________ 20000000______4________1_____Detail Line
** Group Footer - SUPPRESS because it has a match on the main report
20000000_________4________1 ________________________________ 20000000______2________1_____Detail Line
20000000_________4________1 ________________________________ 20000000______3________1_____Detail Line
20000000_________4________1 ________________________________ 20000000______4________1_____Detail Line
** Group Footer - SUPPRESS because it has a match on the main report



Bruce O
 
Using Shared Variables, you can pass data back from a subreport to the main report. But this will only work in a section below the section that calls the subreport.

You should be able to devise a system that will use the subreport to collect data and show details in a lower section of the main report.

Use SEARCH to find details of Shared Variables.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Thanks, I hadn't thought about a second subreport.
I think that would work.

For now I'm trying to change the process sequence.
I wouldn't need the customization then.
But... people don't like change.


Bruce O
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top