Cascading parameters when two fields have the same name

Saturday 1 March 2008 @ 4:09 pm

I was recently asked to solve another problem with a cascading parameter. Apparently two fields in the cascade had the same field name (but were from different tables). This isn’t unusual when you have several tables with fields named “Description” or “Code”. But in a cascade each level may need to create a separate parameter, and each parameter is named after the field that provides its data. So when CR finds a duplicate field name in the cascade it tries to create a duplicate parameter name and this generates an error. There is no visible option for renaming either parameter.

The solution is to click “Create” on only one of the duplicate levels and then save the entire parameter. Once the parameter is saved you can rename that first duplicate so it isn’t a duplicate anymore. Then you can go back and Edit the parameter’s properties and click “Create” on the second duplicate. Since the first was renamed the parameter name won’t be a duplicate any more.

If you create your dynamic parameters from commands (something I recommend) you can prevent this problem then another option is to rename one of the duplicate fields by adding an alias in the SQL.

Leave a Reply

Recrystallize Pro

Crystal Reports Server