Formating Values

Stimulsoft Reports.NET discussion
Post Reply
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Formating Values

Post by EDV Gradl »

When I have a datetime field {Date} and use the format option of the text box it works fine.
But when write something before the field like : Invoice date: {Date} the format does not apply, because of the extra text.

How do I use formattings in the text box?

Thanks!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Formating Values

Post by Edward »

EDV wrote:When I have a datetime field {Date} and use the format option of the text box it works fine.
But when write something before the field like : Invoice date: {Date} the format does not apply, because of the extra text.
How do I use formattings in the text box?
Thanks!
You can use standard formatting, providing by .Net Framework, for example:

Code: Select all

Invoice date: {Date.ToString("MM.dd.yyyy")}
But also you can use a trick:

Code: Select all

Invoice date: {this.Text3.TextFormat.Format(Date.Date)}
Where Text3 - our textbox. And the this.Text3.TextFormat.Format() method applies custom format that you have selected for the Text3 object in context menu.
In next version mechanizm of formatting will be greatly improved.
Post Reply