Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complicated logic for Report
Message
From
14/08/2002 04:43:38
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00689239
Message ID:
00689451
Views:
101
This message has been marked as the solution to the initial question of the thread.
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.
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform