Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating multiple arrays?

Status
Not open for further replies.

discskyer

Technical User
Nov 18, 2005
14
US
I was trying to set up an array to capture 4 different values per entry (reference, invoice, applydate, and amount). I then needed to have these records printed up in the subreport sorted by the overall Invoice number. Does anyone have an idea as to how I might go about doing this? Thanks!
 
I don't think you have provided enough information for someone to help. Also, why not describe what you want the report to do, describe the group structure, the purpose of the subreport, where you want to place it, etc. It is likely that there is some other solution besides using arrays.

-LB
 
I figured that might be the case, and I apologize for being so vague about it. Basically, I have a report that contains information sorted by vendor regarding invoices and credits to those invoices. However, in the main report, the invoices and credits are both stored in the same field of the database. For the subreport I will be using a second table that contains the information regarding which credit was applied to which invoice.

The subreport will be broken down by vendor first and then by invoice. For each invoice, a list will be printed afterwards with the information for each credit that was applied to it, and at the and of each row will be a running balance of what is left on the invoice. At the end of the subreport will be a grand total of what is left on all of the invoices. Since it will be grouped by vendor overall, I would need it run the report and subreport for one vendor and then go back and run the report and subreport for the next vendor.

example:
vendor a main report
vendor a subreport
vendor b main report
vendor b subreport
.
.
.
vendor last main report
vendor last subreport.

Thanks for any help you can provide, and definitely let me know if anything else needs clarification.
 
If your goal is to get the remaining balance by vendor, then it would probably be simpler to use the second table in the main report to distinguish invoice and credit amounts.

If your goal is to display all invoices, followed by all credits, per vendor, then the subreport is the way to go. You would then place the subreport in the group footer section for vendor ID and then link the subreport on the vendor ID. You could insert summaries on the credits per invoice and also insert a grand total. Then you could set the grand total to a shared variable so you can use it in the main report, as in:

whileprintingrecords;
shared numbervar allcr := sum({table.creditamt});

You would place this on the subreport report footer, and then in the main report, in a section below the one in which the subreport is located, you would create a formula like the following:

whileprintingrecords;
shared numbervar allcr;

sum({table.invoiceamt},{table.vendorID})-allcr

You would also need to add a reset formula in the main report vendor header:

whileprintingrecords;
shared numbervar allcr := 0;

If your amounts are of currency datatype, then change "numbervar" to "currencyvar".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top