Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On Entry/On Exit band events
Message
De
05/04/2001 21:46:01
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00492141
Message ID:
00492640
Vues:
16
I agree - the where clause is the problem. I only want the count of the records for this group. The grouping is on facility. I am using this as a simple to test case. I want the count of how many records will appear in this group. If I needed this in the group footer, I would just have a calculated field. But I need it in the page footer. If the group extends beyond one page, the total shown in the page footer for the entire group will not be correct

In the actual app that cries for a resolution of this problem, there is a payment tear-off at the bottom of an invoice. The tear off is the page footer and appears on every page. The total for the invoice should be shown on the tear off. But the total amount of the invoice is only accurate on bottom of the last page of a multipage invoice - i am using the calculated field of the group. I would be satisfied to be able to have a print when that said "SEE LAST PAGE" instead of the amount if I knew the group did not end on this page. Summary band for the tear off is not an option, as these invoices are printed in batches of hundreds. Most are only one page, but the ones that have more line items and extend to multiple pages show partial totals on all the pages but the last.

So, the question is: in the UDF - or the band events - how do I say "Give me the total of all the records in this band." It seems I must do a SQL against the data, as the Report Writer hasn't processed those records yet. So, how do I tell the select the value of the current field I am using for grouping.

I can't imagine somebody isn't doing this regularly and sucessfully. I can easliy visualize a solution involving preprocessing that calculates all the totals for each group value etc and gets them from a related table but I was hoping there was a solution as outlined above

TIA

Charles

>Yes, but look at your code:
>
>SELECT count(account_name) FROM v_mcgann_parkers ;
>WHERE facility=v_mcgann_parkers.facility ;
>INTO ARRAY lajunk
>
>Your WHERE clause is saying you want records where facility (of v_mcgann_parkers) is equal to v_mcgann_parkers.facility. That's like saying WHERE 1=1. Maybe this is a typo?
>
>What is your main table driving the report? And what are you trying to count again?
>
>By the way, you can just do a COUNT(*)... you don't need to reference a variable in the parentheses. You only need to do that if you're using the DISTINCT keyword (i.e. SELECT COUNT(DISTINCT inv_date) FROM invoices will give you the number of different dates found in an invoice file.)
>
>--Brad


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform