Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How I can create 2 detail sections in Report?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00036115
Message ID:
00036180
Vues:
36
> I need to do some report, where should be information from 2 different > tables. So I need 2 detail sections. Or maybe there are some tools to make > lines on the paper? Since this question has been asked and answered twice in the past week, I decided to create an FAQ for it. Here's the guts of the answer: The easiest way to create two detail bands in a single report is to have a single cursor, with one record for each piece of detail that you want. If you want to print all of the information for an Invoice, for example, then you you have one record for each Invoice Item and one record for each Payment. Needless to say, these different types of items would require different items on the report. Set up an additional field in the cursor that you're reporting on to hold the type of information. For example: SELECT "I" as Type, inv_num, quantity, amount ; from inv_item ; where inv_item.inv_num = m.Invoice ; UNION ALL SELECT "P" as Type, inv_num, 00000 as Quantity, Amount ; from payment ; where payment.inv_num = m.Invoice ; ORDER BY 2,1 ; INTO CURSOR REP_CURS Then create a report from the result cursor. Have two distinct lines of fields in the Details band, one for the Invoice Items, and one for the Payments. In the items for the Invoice Item fields, set the "Print When" expression to: TYPE = "I" and for the Payment fields set the expression to: TYPE = "P" Also set the "Remove this Line if Blank" checkbox for all of the fields. This will allow a single line of records to print for the Invoice Items, and also a single line for the Payments. HTH --
Paul Russell
EMail: prussell@fox.nstn.ca
Phone: (902) 499-5043
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform