FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour To Antonio:
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
To Antonio:
Posted: Mon Oct 15, 2012 09:11 AM

Antonio:

Can this be done with the REPORT command ?
I got four tables:
1. Master product category
2. Master Products file
3. Product Category table (Product code & category code in this one) (Each product can have more than one category).
4. Transactions

I need a report to print this way:

Report Group 1: MASTER PRODUCT CATEGORY
Report Group 2:        PRODUCTS IN THAT CATEGORY (in alphabetical order)
Report Group 3:              TRANSACTIONS FOR EACH PRODUCT IN THAT CATEGORY

One important detail is that products should print in alphabetical order.
Thank you very much.

Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: To Antonio:
Posted: Mon Oct 15, 2012 03:09 PM
Gustavo,

The question was to Antonio but I think I have the answer. You´ll have to use 3 GROUP command in the right order.
GROUP ON TRANSACTION
GROUP ON PRODUCTS
GROUP ON CATEGORY

I do not remenber having used with 3 groups but with 2 it works fine. Here is a sample:
Code (fw): Select all Collapse
GROUP ON tmp->LOGR HEADER "LOGRADOURO: " + allTrim( oRepo:aGroups[ 1 ]:cValue ) + "-" + tmp->NLOG + "-" + tmp->BAIR + if( val( area->CODA ) >= 4, "-" + allTrim( area->NOME ), "" ) FONT 2 FOOTER ""
GROUP ON tmp->AREA + tmp->ROTA EJECT FOOTER ( SomaTiragem( nRota, aTira ) + "TOTAL ZONA " + subStr( oRepo:aGroups[ 2 ]:cValue, 1 , 6 ) + " ROT: " + subStr( oRepo:aGroups[ 2 ]:cValue, 7 ) + " (" + ;
        lTrim( str( oRepo:aGroups[ 2 ]:nCounter ) ) + " ASSINANTES ) ( " + allTrim( str( nRota ) ) + ( nRota := 0, "" ) + " JORNAIS )" ) FONT 2
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: To Antonio:
Posted: Thu Oct 18, 2012 08:56 PM

André:

Great idea and much easier to implement. Obrigado. Thank you.

Gustavo

Continue the discussion