cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving report parameters with the same order as in CR Designer

Former Member
0 Kudos

For one application I am developing, I need to retrieve all the parameters fields defined on a crystal reports file, following the same order as defined in Crystal Reports Designer (that you can set by right clicking on Parameter Fields and choosing "Set Parameter Order"). I thought the following code, using Crystal Reports SDK, would do the trick:


Fields reportFields = reportClientDocument.getDataDefinition().getParameterFields();
for(Object f : reportFields) {
      ParameterField currentField = (ParameterField) f;
      // Process the field...
}

Unfortunately the fields are not returned using the same order. Is there any way to do this using the Crystal Reports SDK?

Artur Matos

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please set the Parameter Order in the order you want through Set Parameter Order( like you did before).

Try the following code and do let me know the results:

Fields fields=reportClientDocument.getDataDefController().getDataDefinition().getParameterFields();

for(int i=0;i<fields.size();i++)

out.println(fields.getField(i).getName());

Please let me know the results.

Thanks,

Neeraj

Former Member
0 Kudos

Hi Neeraj,

I've tried what you said, but the results are still the same.

The interesting thing is that changing the order in Crystal Reports designer does affect the ordering returned to the iterator in the code, is just that the ordering is not the same (albeit slightly similar).

Regards,

Artur

Answers (0)