on 03-19-2012 12:53 AM
I am trying to run a formula as follows:
'*' & {Table.Field} & '*'
The idea being that I get the result: (where the field is '123')
*123*
However, every time I run this report, I get the result:
*123.00*
The decimal places are appearing for no apparent reason, the field has no decimal places.
I have tried to fix this with no result, it is confusing me very much.
Can someone help me?
Did you try ToText?
'*' & ToText({Table.Field},0) & '*'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ToText is very specific about the data types being passed into it, and the error you mention occurs when a string value is passed. So what type is the field you are trying to manipulate?
This is ugly but may get closer to a solution, wrap ToNumber into the ToText just for fun.
'*' & ToText(ToNumber({Table.Field}),0) & '*'
This worked:
'*' & ToText(ToNumber({Table.Field}),0) & '*'
The field i am passing to the report is and integer, from a mysql database.
Thanks everyone.
I needed this to suit certain types of scanners we have, they only scan numbers between the two '*'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Are you very specific that you need a formula itself in this case.
My suggestion is to put two stars in a text field and place the value you want to display in between them , also you can format this value in your desired format too.
Hope this helps
Regards
Vivek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try the following:
'*' + ToText({Table.Field},0) + '*'
With kind regards,
Pieter Jong
Crystal Advice
http://www.crystaladvice.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
More information required.
- Version of crystal Reports
- Version of Visual Studio.
- win or web app
- Does the report work from CR designer.
If the issue is from CR design, please post the query in the Crystal Reports design forum.
- Bhushan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.