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

Supression with two Details Section 1

Status
Not open for further replies.

michpaus

Programmer
Oct 18, 2005
11
US
I have a report that contains two details sections. I created a second details section to diplsay the exact information as the first with a little difference. Da displays the entire history of orders for a specific part number, Db displays only those records that have been ordered since the start of the fiscal year. What I need to do is when there is an instance of Db, only show that and supress Da else just show Da when Db doesn't exist. Is there a way to do this? I am open to all suggestions.

Thank you.

 
An instance isn't a database technical term (unless you mean in the Oracle sense, which has nothjing to do with data), please use database terms, or Crystal terms.

So, show what Da and Db display, or how you define "when there is an instance of Db".

If you mean that there may not be a field in Da or Db, you would right click each section and select format section (or section expert, also ALWYASZ post your software version anytime you post in any software forum). Now place a formula such as:

isnull({table.field})
or
{table.field} = ""

Then in the pother section you'd use the opposite, as in:

not(isnull({table.field}))
and
not({table.field} = "")

Note that null checks need to be first in formulas in Crystal.

As you can see, I'm shooting in the dark here.
In lieu of text descriptions, successful posts include:

Crystal version
Database/connectivity used
Example data
Expected output

-k
 
Hi synapse,

I mean that the fields in Da represent the orders purchased at the start of the fiscal year. I have the report grouped by item number. What I want to show is for each item number when there are no new orders, display the order history which is Db. If there are new orders then just display the new orders(Da). I used a suppression formula as shown below to get the most recent orders and placed it in Da.

If {pvmro_PO_response1;1.unit_of_meas}='NB' or {pvmro_PO_response1;1.Unit_Cost}=0
or {pvmro_PO_response1;1.SELECTED}='N' or cstr({pvmro_PO_response1;1.RFQ_NUM})<> cstr({pvmro_PO_response1;1.NUMBER})
then true
else
false

Now I need to find a way of displaying both details sections on the entire report. If there are new orders for an item number then it should only display those new orders. If there are no new orders for the item then the history is displayed.

As it is now I can only display one or the other.

Hope that explains it better. If not then I porbably need to scrap it and start again
 
I think that you need a flag to do this.

So I guess you want ONLY new orders, or if none, then only older orders.

Group by the part number, and create a formula for the group header such as:

whileprintingrecords;
booleanvar IsNew:=False;
If {pvmro_PO_response1;1.unit_of_meas}='NB' or {pvmro_PO_response1;1.Unit_Cost}=0
or {pvmro_PO_response1;1.SELECTED}='N' or cstr({pvmro_PO_response1;1.RFQ_NUM})<> cstr({pvmro_PO_response1;1.NUMBER})
then
IsNew := true
else
IsNew :=false

This assumes that the above formula denotes that the first record is new. So sort the rows accordingly to have the new orders first.

If {pvmro_PO_response1;1.unit_of_meas}='NB' or {pvmro_PO_response1;1.Unit_Cost}=0
or {pvmro_PO_response1;1.SELECTED}='N' or cstr({pvmro_PO_response1;1.RFQ_NUM})<> cstr({pvmro_PO_response1;1.NUMBER})
then
"New"
else
"Old"

Most databases have dates which you could use by sorting in descending order instead.

Anyway, now the details have a formula to decide what to suppress.

Details A suppression formula:

whileprintingrecords;
booleanvar IsNew;
IsNew = False

Details B suppression formula:

whileprintingrecords;
booleanvar IsNew;
IsNew = true

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top