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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any way to populate an array using input parameters? 1

Status
Not open for further replies.

daguas

Technical User
Jul 8, 2004
24
0
0
US
Crystal 8.5 DWL Server DB. I need to produce a report that will allow the user to input some values that will be used in calculating a total. The simplest way of explaining it is I have two db and the user value that make up the total. The user value is a guess for a accrual value.

{Contract.Amount} - {Contract.InvoicePaid} - (User Input Value) = Balance.

The trick is that I need be able associate the User Input Value to the correct Contract record. and print multiple record lines, collecting the user input for each record (or contract).

Sorry if this is not clear, any ideas appreciated.
 
Create a multivalue parameter field for Contracts, and then create a record selection formula to limit the report to only those values entered in the parameter prompt:

{YourContractField} in {?Contracts}


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
As dgillz suggested, create a multiple value parameter {?contracts} and use it in the record selection formula:

{contract.contractno} = {?contracts}

Also create a parameter {?myinput}, which is a multiple value number parameter. For the prompt, instruct the user to enter the appropriate value in the same order that corresponds to the entry of the selected contract.

Then create a formula like this for the detail section:

whileprintingrecords;
stringvar array y := {?contracts};
numbervar z := ubound(y);
numbervar i;
numbervar array q := {?myinput};
currencyvar w := 0; //or numbervar depending upon your calculation

for i := 1 to z do(
if y = {contract.contractno} then
w := {contract.amount}-{contract.invoicepaid}-q);
w

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top