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

SUBTOTAL Problem 1

Status
Not open for further replies.

Creeder

Programmer
Jul 5, 2000
110
MY
Dear All,

I will use the CAR table to illustrate my problem. Below is the code

TABLE FILE CAR
PRINT
COUNTRY
CAR
RETAIL_COST
DEALER_COST
BY COUNTRY NOPRINT
BY CAR NOPRINT SUBTOTAL DEALER_COST
END
-EXIT

However, when it is displayed on the webpage, the subtotal of the dealer cost is not in the same line as the subtotal.

What could be the problem? or how can i allign it so that it is in the same line?

Regards,

Yue-jeen
 
The problem is, because all your printed columns are verb objects, there's no PHYSICAL place to put the '* TOTAL' line, without overriding a verb object subtotal.

To solve this, use SUBFOOT instead. Through use of StyleSheet syntax, you can put the text for the '* TOTAL' anywhere you want.

Here's how I did what you asked:
Code:
TABLE FILE CAR
PRINT
COUNTRY
CAR
RETAIL_COST
DEALER_COST
BY COUNTRY NOPRINT
BY CAR NOPRINT SUBFOOT
"TOTAL RETAIL COST<ST.RETAIL_COST"
ON TABLE SET STYLE *
TYPE=SUBFOOT, HEADALIGN=BODY,$
TYPE=SUBFOOT, LINE=1, ITEM=1, COLSPAN=2,$
TYPE=SUBFOOT, LINE=1, ITEM=2, JUSTIFY=RIGHT,$
ENDSTYLE
END

I replaced your SUBTOTAL with a SUBFOOT, with TWO parts: text and an imbedded field (the subtotal of RETAIL_COST).

Using the StyleSheet code, I said the first item (the text) should span two columns (COUNTRY and CAR), and the second item should be right justified.
 
Dear focwizard,

Thank you very much!!! That is exactly what I needed.

Regards,

YJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top