I have a string field that can contains numeric values (eg. "6000" or "123,45") or text values (eg. "This is a text"). If the value is numeric i need to format it (eg. "6.000,00"). Does anybody can help? I cannot manage report events, all i can do is to write text or formulas in the field in the designer.
A subquestion: assuming that the string can contains only numeric values (eg. "6000" or "123,45") how can i format it (eg. "6.000,00")?
Thank you.
Formatting a string field
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Formatting a string field
Hello, Fabio.
Right-click on the text field and set its format as number with appropriate formatting parameters.
Write the following in the text property:
Thank you.
Please declare an int type variable in the Dictionary.Fabio wrote:I have a string field that can contains numeric values (eg. "6000" or "123,45") or text values (eg. "This is a text"). If the value is numeric i need to format it (eg. "6.000,00"). Does anybody can help? I cannot manage report events, all i can do is to write text or formulas in the field in the designer.
Right-click on the text field and set its format as number with appropriate formatting parameters.
Write the following in the text property:
Code: Select all
{IIF(Integer.TryParse("6000", MyVariableFromDictionary),Me.Text1.TextFormat.Format(Integer.Parse("6000")),"not a number")}
The simplest way is right-click on the text and to select ''Format in context menu and set appropriate values there as in the attached report.A subquestion: assuming that the string can contains only numeric values (eg. "6000" or "123,45") how can i format it (eg. "6.000,00")?
Thank you.
- Attachments
-
- 99.TryParseInExpression.mrt
- (3.81 KiB) Downloaded 275 times