I like your idea. I've had to do something similar and I did it by 1) creating a temporary table 2) adding the total fields required to the table's structure 3) stepping through the table to get totals and put it the appropriate fields when finished.
I like your idea MUCH better! Thanks for posting it for Nadya-I'll use it! :o)
Tracy
>Nadya,
>
>If I understand correctly you want group/report totals/avg at the top of a group/report.
>
>It can be done (Had to do it for balance sheets where the total is printed before any detail)
>
>Basically, we produce a cursor that has the total info available when needed
>
>You need to run you report off a cursor
>
>prior to launching the report you modify the cursor a bit
>
>Let's go by a basic example
>
>Suppose a cursor
>
>State, year, week, amount
>
>
>select State, ;
> Year, ;
> Week, ;
> amount ;
> from Table1, Table2, ...
> into cursor tmp1 ;
> where ( .. ) ;
> order by 1, 2, 3
>
>select State ,;
> year, ;
> week, ;
> sum(amount) as State_year_week_amount ;
> from tmp1 ;
> into cursor tmp2 ;
> group by 1, 2, 3
>
>Select tmp1.State, ;
> tmp1.Year, ;
> tmp1.Week, ;
> tmp1.amount, ;
> tmp2.State_year_week_amount ;
> from tmp1, tmp2 ;
> into cursor tmp ;
> where ( tmp1.State == tmp2.State ) ;
> and ( tmp1.Year == tmp2.Year ) ;
> and ( tmp1.Week == tmp2.Week ) ;
> order by 1, 2, 3
>
>
>now you have State_year_week_amount available to print in the group header
>
>You can do similar for report totals (and print them on the first page only).
>
>just add the fields you need to the cusor with a select.
>Those fields will be available in the detail band, but there is no need to print them there. Only print them in a header
>
>In addition, if you need the whole summary upfront, add a blank state (group) which contains all the summary for the others, and join it with sql. It will be printed at the beginning of your report
>
>>Hi everybody,
>>
>>I have the following report:
>>
>>Transaction Filing Dates - '30 Day' Timeliness Scorecard for MA...
>>
>>Begining Issue Week: 200203 through Ending Issue Week: 200220
>>
>>Registry Issue Week Latest Filing Date Pub Delay Timely
>>
>>Barnstable 2002 03 12/14/2001 38 No
>> 2002 04 12/26/2001 33 No
>>....
>>
>>Registry Average for Report Period: Avg Timeliness 72.22%
>>=======================================
>>...
>>
>>======================
>>Massachusetts Average: Avg Timeliness all IssWeeks all registries 62.96%
>>
>>
>>I set up 4 report variables: Registry_Timely, Registry_Cnt (end on registry) and similar for report Rep_Timely Rep_Cnt (end on report).
>>
>>The user requested to repeat Registry Summary info right before State Summary, so they don't have to flip through the stack of paper...
>>
>>I explained, that it's quite complicated to achieve, but I'll try.
>>
>>However, I don't see an idea at this moment, how to produce such report. May be you can help me?
>>
>>Can I use two separate tables in one report?
>>
>>Thanks a lot in advance.
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"