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.

mlmccCommented:
WHat do you mean they are reordered?

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

mlmcc
0
zephyr_hex (Megan)DeveloperAuthor Commented:
see the image below.
example.jpg
0
mlmccCommented:
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?

mlmcc
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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

params.jpg
0
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.
0
mlmccCommented:
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?

mlmcc
0
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.
0
mlmccCommented:
Are you passing the parameters through code or from the parameter prompting page?

mlmcc
0
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:
PARAMETERS
[znbr_title = 149748]
[p_oih_id_start = 149748]
[p_oih_id_end = 0]

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

You can pass by name

mlmcc
0
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:

PARAMETERS
[@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.
0
mlmccCommented:
Are you using the same report for 2 different databases?  Or is it 2 separate reports which are identical.

mlmcc
0
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
0
mlmccCommented:
Need more help?

mlmcc
0

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.

thanks.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.