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

Ideas on how to display random field parameter selection 1

Status
Not open for further replies.

Roscoe307

Programmer
Jun 20, 2007
24
US
I have a parameter that will allow users to pick up to 8 fields to display in the report. There are a total of 26 fields that the user can choose from. The question I have is, is there any way to format the report so that regardless of what fields the user chooses the report is still formatted porperly. Thanks!
 
lbass,

I'm using the thread that you directed me to, my question is, am I supposed to have 26 parameters from which the user has to select each field they want to display?

E.G.,
For {param1} the user selects Fiscal Year
{param2} user selects Office
{param3} user elects Plan Title
{param4}-{param24} are blank
{param25} user selects Vendor Name
So only those 4 fields display.

Is there any way to create a parameter that contains all of the field choices and from that still have the report formatted properly? The problem I have is that the customer will not want to go through 25 parameters to select only 8 fields. They would rather have one pick list and from that be able to select multiple fields they want to see in the report. I really appreciate your help!

-SS
 
Yes, you could create one string parameter {?Fields} with options suitable for column headings, and then create a formula like the following for each column:

//{@col1}:
select {?Fields}[1]
case "Cust" : totext({Orders.Customer ID} ,0,"")
case "Amt" : totext({Orders.Order Amount},0,"")
case "Order" : totext({Orders.Order ID},0,"")
case "Shipper" : {Orders.Ship Via}
case "Order Date" : totext({Orders.Order Date},"MM/dd/yyyy")
default : ""

You would change only the subscript for the parameter for each of the 8 allowable columns. For column labels, use formulas like this:

{?Fields}[1]

The columns would appear in the order that the user selected them, so you might want to instruct them to that effect in the prompt text. The downside is that you must convert all columns to strings in the formula and then possibly convert some of them back in additional formulas if you want to do calculations, etc.

-LB
 
Thanks lbass!

I'm getting a little closer to having this done. The only thing is now I'm getting the error "A subscript must be between 1 and the size of the array." This happens if I don't select all 8 fields. E.G., if I only choose 3 out of the possible 8 fields to display.
 
Set up the formulas (both column and labels) with an introductory clause like this:

if ubound({?fields}) >= 2 then (
select {?Fields}[2]
case "Cust" : totext({Orders.Customer ID} ,0,"")
case "Amt" : totext({Orders.Order Amount},0,"")
case "Order" : totext({Orders.Order ID},0,"")
case "Shipper" : {Orders.Ship Via}
case "Order Date" : totext({Orders.Order Date},"MM/dd/yyyy")
default : ""
)

-LB
 
That worked, thanks lbass!! I really appreciate all of your help.

-SS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top