Bob, I calculate year-to-date AFE totals for the header of my invoices. I create a temporary view where I do the year-to-date calculations, then place a single variable on the header line which is defined as the H0 expression:
V_YTD_TOTAL = YTDTOTAL IN V_YTDBILL WHERE AFE = ID It does the lookup to the view and uses the same AFE break as does the detail of the invoice. SET ERROR MESSAGES 2038 OFF DROP VIEW v_ytdbill NOCHECK CREATE TEMPORARY VIEW `v_ytdbill` + (afe,ytdtotal) + AS SELECT + billing_id, + SUM(billing_amt) + FROM d_b_allocation + WHERE da_invoice_dt > 01/01/05 + GROUP BY billing_id SET ERROR MESSAGES 2038 ON RETURN Does that help? > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Thompson > Technology Consultants > Sent: Saturday, February 05, 2005 10:14 PM > To: RBG7-L Mailing List > Subject: [RBG7-L] - RE: Report Question > > The requirement is a report with the totals listed before the > detail line (in the Break Header) for each sales division. > (There will be a variable number of divisions printed on the > report depending on the selection criteria) > > Using the DBCalc, Look a Head, and Pass = 2, I can print > the totals ahead of the detail lines in the Break Header section > very easily and it works great. HOWEVER... (always something!), > they want total percentages as well. Since you cannot use the > DBCalc fields in calculations, I have not found an efficient way of > doing this. I have not been able to figure out how to put a "Sum of" > variable on a report and have it print on the Break Header. > I do not believe using computed columns will work either as the > DBCalc has Sum, Ave, Min, Max and Count options. None of > which suffice for Percentages. > > There is no "Look a head" function for regular variables that I can find. > > Trying to calculate the percentages before generating the report poses > the problems of the large number of select criteria and more importantly, > how do you place a variable in a Break Header and have it print only the > values for the current Break condition? I.E. If the report selection > generates 10 "divisions", how do you place 10 different global variable > values in the break header, matching the divisions? > > I have tried to get them to accept the totals in the Break Footer, but it > is being insisted upon having them in the Header. > > Any ideas? > > Thanks! > Bob > > > Thompson Technology Consultants > 276 Chippewa > LaPorte, IN 46350 > 219-324-2605 (Phone & Fax) > 219-363-7441 (Cell) > http://ttc.inc.home.comcast.net
