Ordering of parameters changes in Crystal

CR 9

When i open the report in CR 9, the parameters are in the order i want.
When Crystal is called by our program, the report parameters are in a different order.

our program uses CR 9 library.

what is causing the parameters to be re-ordered?
LVL 44
zephyr_hex (Megan)DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WHat do you mean they are reordered?

Are you entering through the Crystal parameter screen or through code?

zephyr_hex (Megan)DeveloperAuthor Commented:
see the image below.
What order did you add the parameters in?

If you right click PARAMETERS in the FIELD EXPLORER do you have an option to SET PARAMETER ORDER?

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

zephyr_hex (Megan)DeveloperAuthor Commented:
here is what i see when i right click parameters in field explorer (see pic below).

the title parameter was added first, and then re-ordered using the Move Parameter Up/Down.

and i don't know if it makes a difference, but p_oih_id_start and p_oih_id_end are passed to an informix stored procedure

zephyr_hex (Megan)DeveloperAuthor Commented:
i tried deleting the title param, save the report, and then add the title param back in...
the problem still exists.
Order on that screen should not matter.

Are the 2 parameter SP parameters or did you build Crystal parameters for them?

If you eliminate the title parameter does the report pass them correctly?

zephyr_hex (Megan)DeveloperAuthor Commented:
p_oih_id_start and p_oih_id_end are parameters from the stored procedure
znbr~title is a parameter created in crystal

is there a way to build parameters in crystal for parameters from stored procedures?

if i eliminate the title parameter, the code shows the parameters are being called in the correct order.

if i move the title parameter to the stored procedure, the code calls the title parameter last (correct).

i need to know why this is happening.  i have hundreds of reports where there's a mix of parameters from stored procedure and parameters from crystal.
so, even though i can fix this one report by moving the title parameter to the stored procedure, that is not an ideal solution.
Are you passing the parameters through code or from the parameter prompting page?

zephyr_hex (Megan)DeveloperAuthor Commented:
code passes the values to the parameters.

but code is getting the parameter names from crystal.  for example, i changed the title param name in crystal to znbr_title, and code picks this up:
[znbr_title = 149748]
[p_oih_id_start = 149748]
[p_oih_id_end = 0]

should be:
[p_oih_id_start = 149748]
[p_oih_id_end = 149748]
[znbr_title = 0]
How is the code passing the parameters.

You can pass by name

zephyr_hex (Megan)DeveloperAuthor Commented:
the code doesn't pass by name.  
and we really don't want it to... because the code needs to work for both Informix and SQL 2005, and the naming scheme of parameters from a stored procedure differs.  we don't want to have to "hard code" parameter names for both database versions.

the code asks crystal for the parameters.  the code knows which order the parameters occur in, and passes database values based on that order.

The problem does not happen in SQL 2005.  The report structure is the same... where the p_oih_id parameters are in the stored procedure, and the title parameter is in Crystal.  in this case, Crystal passes the parameter names to the code in the correct order:

[@p_oih_id_start = 46209]
[@p_oih_id_end = 46209]
[znbr~title = 0]

the code calls Crystal in the same way for both versions of database.
Are you using the same report for 2 different databases?  Or is it 2 separate reports which are identical.

zephyr_hex (Megan)DeveloperAuthor Commented:
it is two different reports, two different databases.  the reports are different because of the difference in the way Informix & SQL 2005 return variables from a stored procedure
Need more help?


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zephyr_hex (Megan)DeveloperAuthor Commented:
i am going to move the title parameter to the stored procedure.  i can't find an explanation for why, in Informix, the parameters get re-ordered.  it's not the most ideal solution, but it will work.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.