Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Details in a group footer band
Message
De
19/02/2002 14:04:53
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00621957
Message ID:
00622099
Vues:
28
This message has been marked as a message which has helped to the initial question of the thread.
Roi,
I think it will be a PITA no matter what work around you use :(.

A similar approach I've used is to call a UDF from the group footer's onEntry(). Something like CaptainSummary(CaptainId, @raCaptainSummary). Make sure you define a report variable raCaptainSummary. The UDF calculates the summary info based on the captainId into an array. In the group's summary you can now put fields like this:
*-- Col1=Emp, Col2=Hours

*-- list the Emp fields
IIF(TYPE("raCaptainSummary[1,1]") = "U", "", raCaptainSummary[1, 1])
IIF(TYPE("raCaptainSummary[2,1]") = "U", "", raCaptainSummary[2, 1])
IIF(TYPE("raCaptainSummary[3,1]") = "U", "", raCaptainSummary[3, 1])
IIF(TYPE("raCaptainSummary[4,1]") = "U", "", raCaptainSummary[4, 1])
etc.

*-- list the Hours fields
IIF(TYPE("raCaptainSummary[1,2]") = "U", "", raCaptainSummary[1, 2])
IIF(TYPE("raCaptainSummary[2,2]") = "U", "", raCaptainSummary[2, 2])
IIF(TYPE("raCaptainSummary[3,2]") = "U", "", raCaptainSummary[3, 2])
IIF(TYPE("raCaptainSummary[4,2]") = "U", "", raCaptainSummary[4, 2])
etc.
This is obviously still a royal pita. But this approach has some major advantages over the memo solution:

- you can apply different formatting on each field
- you have more flexibility in the layout because you have different objects. E.g. right aligning of numeric values in a memo is difficult if you use proportional fonts.

However, the approach has one major drawback. If you can possibly have many rows in the group footer, then this approach doesn't work well. This approach is best suited in situations where you can predict the max. number of rows. E.g. if you are sure you never exceed 15 employees/per captain. You can place 15 rows in the group footer and specify "remove when blank". However, if one day you have 20 employees...then this will fail.

HTH
>Hi Steve,
>
>Thanks for the help. Sounds like a good plan, however, I simplified my example and there is a 3rd group under Project called Job. I can print the summaries in the detail band. They have to be in the project footer. Putting them in the detail would put the same Project summary under each job.
>
>I was thinking of building the summaries manually and putting them in a memo field. Every row in the cursor with (project = x) would have the project summary and then printing the memo in the project footer.
>
>That is going to be a PITA, I was hoping there was an easier way.
>
>>One way is to have the Team Captain Summary information as a part of your report cursor. You can create a summary cursor with the same structure as the report cursor, and UNION them together before printing the report.
>>
>>In the projectID field, put something that would never be a real projectID, 'ZZZ' for example.
>>
>>Your final cursor would look something like this:
>>
>>
>>TeamLead  ProjectID   Emp       Hours
>>Zaphod    001         Ford          3
>>Zaphod    001         Trillian      4
>>Zaphod    002         Ford          6
>>Zaphod    002         Marvin        2
>>Zaphod    ZZZ         Ford          9
>>Zaphod    ZZZ         Trillian      4
>>Zaphod    ZZZ         Marvin        2
>>
>>
>>The Team Captain Summary would print in the detail band. Use IIF() statements in project headers/footers (looking at projectID='ZZZ' to determine what to print there. It looks like you want the summary to print in order of descending hours...there could be a challenge getting that to work.
>>
>>>I'm working on a report that looks like:
>>>
>>>
teamCaptain  (a group)
>>>    projectNum    (a group)
>>>        employee  (detail band)
>>>
>>>
>>>The detail band shows all the employees that worked on a project that a teamCaptain managed. There could be many teamCaptins and each one can have many projects. I've got this part working.
>>>
>>>Now, I need to summarize all the projects for each teamCaptin. In the teamCaptain group footer I need to show a list of all the employees that did work for that teamCaptain and the total hours for all the projects worked.
>>>
>>>How do I do add the summary portion in the group footer?
>>>
>>>Sample:
>>>
Zaphod
>>>  001
>>>    Ford      3
>>>    Trillian  4
>>>  002
>>>    Ford      6
>>>    Marvin    2
>>>
>>>  Team Captain Summary
>>>    Ford      9
>>>    Trillian  4
>>>    Marvin    2
>>>
>>>(the next teamCaptain)
>>>
Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform