Question

Input values with '_' (underscore) in a parameter of a Quick Report (Crystal)


Badge +2

I have created a Quick Report (Crystal Report) that has a parameter  {?Proyecto}. But in the report filter it does not recognize the input values with '_'.

How can I fix it?


This topic has been closed for comments

9 replies

Userlevel 5
Badge +9

Hi @CONIRATBE ,

This is record selection formula right? Also are you passing the parameter as a text field? Maybe you could try TOTEXT(value) option. 

Or you will have to break input string to identify special characters. 

Badge +2

Hi @EntNadeeL,

That’s right, it’s the record selection formula. These are my attempts:

  • {JT_TASK_UIV_CFV\.PROJECT_ID} =  {?Proyecto}  DOESN’T WORK
  • {JT_TASK_UIV_CFV\.PROJECT_ID} =  ToText ({?Proyecto})  DOESN’T WORK
  • Replace({JT_TASK_UIV_CFV\.PROJECT_ID},'_','Z') = Replace(ToText ({?Proyecto}),'_','Z')  DOESN’T WORK

But I don’t know how I can break input string to identify special characters. 

 

Userlevel 5
Badge +9

Hi @CONIRATBE ,

{JT_TASK_UIV_CFV\.PROJECT_ID}  underscore in this field shouldn't be a problem. Because i have done many reports with such parameter names. 

Try printing both values ({JT_TASK_UIV_CFV\.PROJECT_ID} and {?Proyecto} ) in the report before filtering out and check whether they have similar format.

Because if project id is a number then {JT_TASK_UIV_CFV\.PROJECT_ID}  should print something like 10213.00.  Due to decimals this might not work.

You can avoid it by using ToText( ToNumber({JT_TASK_UIV_CFV\.PROJECT_ID}), "#").

So your condition would look like this

ToText( ToNumber({JT_TASK_UIV_CFV\.PROJECT_ID}), "#") = ToText ({?Proyecto})

 

This is how I normally troubleshoot this problem.

Badge +2

Hi @EntNadeeL ,

Both are the same format, string. The point is, it works with string like 'R4512', but not with 'AUU_2020'.

Might the solution  have to do with some configuration in IFS Applications ?, or with the configuration of Quick Reports?

 

Userlevel 5
Badge +9

Hi @CONIRATBE ,

To clear out the confusion,

you are saying {JT_TASK_UIV_CFV\.PROJECT_ID} = 'AUU_2020'  is not working right?

Badge +2

That’s right. The input value for the parameter, when the quick report runs, is AUU_2020, but then, the parameter loses the input value in then record selection formula due to underscore.

{?Proyecto} = ‘AUU_2020’

{JT_TASK_UIV_CFV\.PROJECT_ID} = {?Proyecto} 

 

 

 

Userlevel 5
Badge +9

 

Hi @CONIRATBE ,

Removing the special character from both sides should work. i am not sure why it is not working.

It would be the best option for your scenario.

Try replacing with a space and then trimming both sides. 

 or follow below format

stringvar output := {TABLE_NAME.FIELD_NAME};
output := Trim(output);  //get rid of leading & trailing spaces
output := Replace(output,Chr(13),'');  //get rid of line feed character
output := Replace(output,Chr(10),'');  //get rid of carriage return character

//add any other special characters you want to strip out.

Badge +2

Hi @EntNadeeL ,

Finally I could see the input value was arriving in the crystal report by replacing the underline with a '?', so I replaced the character '_' with '?' of the TABLE_NAME. FIELD_NAME in the selection formula and it worked.

Thank you very much for your time.

Userlevel 5
Badge +9

Hi @EntNadeeL ,

Finally I could see the input value was arriving in the crystal report by replacing the underline with a '?', so I replaced the character '_' with '?' of the TABLE_NAME. FIELD_NAME in the selection formula and it worked.

Thank you very much for your time.

Its good to know this. 

Thanks for the effort. :)