cancel
Showing results for 
Search instead for 
Did you mean: 

How do you convert an input parameter string into a number

Former Member
0 Kudos

Hello...

I'm trying to create a selection formula on a hierarchically grouped report where the input is in the form of "1,2,3,4,23,45" as string. How do I create a statement like:

{view_assets.AssetId} in [1, 2, 5]

The problem is that after the "in" it's looking for a number. How do I convert the input string to a number that will work with "in"?

Thanks in advance,

Donald

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Donald,

I think it is not possible to add the string in record selection formula to comapare it with numeric field. For this I think it is better to create a command level parameter and link this to subreport link parameter and your command in your subreport should be like this

select * from table where field in [{?Parameter}]

Regards,

Raghavendra

Former Member
0 Kudos

Raghavendra,

Do I have to use a subreport? I'm not sure what you meant by this? Could you elaborate a bit more - thanks a bunch...

Don

Former Member
0 Kudos

Yes if you can create a subreport as mentioned before you can pass the calculated string to a subreport command level parameter using subreport links.

Regards,

Raghavendra

Former Member
0 Kudos

The idea was to pass in the string parameter from a .NET application (treeview node ID) into the report for filtering. The multiple integers are the children ID's for the selected node. How would I pass this in via a subreport link?

former_member292966
Active Contributor
0 Kudos

Hi Donald,

You need to encapsulate each ID with quotes so Crystal knows they are strings. Ultimately your formula you are passing should looked like:

{view_assets.AssetId} in ['1','2','3','4','23','45']

Now, I am under the assumption {view_assets.AssetId} is defined as a String datatype.

Good luck,

Brian

Answers (0)