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!

Parameter with multiple discrete values

Status
Not open for further replies.

crystalpro

Technical User
Jan 22, 2002
95
US
I'm using Crystal Reports v9.
I need a parameter for users to enter multiple assembly item id's and the quantities to build each assembly. How can I associate the quantity needed to build with each assembly?

For the {?Assembly ID}, I am allowing multiple descrete values.

The {?Units to Assemble}allows a discrete value only.

I want to be able to take the assemblies entered in the parameter {?Assembly ID} and enter the quantities needed for each assembly in the parameter {?Units to Assemble}.

The report selects the item id's matching those entered in the parameter, {?Assembly ID} and groups the components of the bill of materials for those assembly id's entered in the parameter.

Component Qty Needed Qty on Hand Qty Avail Shortage

 
It sounds like you expect Crystal to associate the first assembly ID entered in the parameter array, to the first quantity entered in the units to assemble parameter as part of the record selection formula to be passed to the database.

If so, then no, Crystal doesn't construct SQL at that level of granularity, you'd need seperate parameters.

However if what you're requesting is we only display the units to build alongside each returned component (Assumed that this is the Assembly ID, changing naming conventions in the middle of a description will only confuse people, try to remain consistent with columns/business terms), then you can easily do this by using a formula in the assmbly unit grouping, such as:

whileprintingrecords;
numbervar currqty:=0;
numbervar counter;
For counter := 1 to ubound({?Assembly ID}) do(
If {?Assembly ID}[counter] = {table.assemblyid} then
currqty:={?Units to Assemble}.[counter]
);
currqty

Too many assumptions were required in your post. In general successful posts include example data, showing tables.columns and some data, and the required output and at what section within the report.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top