how to fill a field with leading zeros

Stimulsoft Reports.NET discussion
Post Reply
miguels
Posts: 27
Joined: Tue Jun 23, 2009 5:05 pm

how to fill a field with leading zeros

Post by miguels »

hello I have a label which paints a numeric field in my data source, and I need to put them zeros in my report

example, my field in the data source 250 ok and I have in my report I need it so .. 000520 but the length must be 6 digits independent of the length of the field filled with zeros ..

is put in sql rigth ('00000 ', employee, 6) as employed but do not want to put in my data source if or paint my tag on my report, I hope you can
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

how to fill a field with leading zeros

Post by HighAley »

Hello.
miguels wrote:hello I have a label which paints a numeric field in my data source, and I need to put them zeros in my report

example, my field in the data source 250 ok and I have in my report I need it so .. 000520 but the length must be 6 digits independent of the length of the field filled with zeros ..

is put in sql rigth ('00000 ', employee, 6) as employed but do not want to put in my data source if or paint my tag on my report, I hope you can
If I clearly understood you, you could set the text Format of the Text box to the Custom and set it to "000000".

Thank you.
miguels
Posts: 27
Joined: Tue Jun 23, 2009 5:05 pm

how to fill a field with leading zeros

Post by miguels »

ok I need is forgiveness.

in a text box in a writing sample 250 and pass that value to a label in my report but I need a length of 6 characters filled with zeros, well in my report, I must leave 000250

and what I find is like putting those zeros to get the textbox value
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

how to fill a field with leading zeros

Post by HighAley »

Hello.
miguels wrote:ok I need is forgiveness.

in a text box in a writing sample 250 and pass that value to a label in my report but I need a length of 6 characters filled with zeros, well in my report, I must leave 000250

and what I find is like putting those zeros to get the textbox value
Did you set the Format property of the Text box?

Thank you.
fsimon
Posts: 3
Joined: Tue Sep 16, 2014 3:07 pm

Re: how to fill a field with leading zeros

Post by fsimon »

Hi,

We try to do the following without success.
- put "0000.000" in custom text format property.

We have a number field and we would like to have 4 digits with leading 0 before the decimal
Our field disapears on the display.

What is the correct syntax of the custom property, is there another way to do it (with a toString method ?)

Is this feature available on flex version (2016.1.10) ?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: how to fill a field with leading zeros

Post by Alex K. »

Hello,

In flex version please try to use the following mask in the Format:
#0000.0000
Capture1.PNG
Capture1.PNG (54.49 KiB) Viewed 4403 times
Capture2.PNG
Capture2.PNG (27.39 KiB) Viewed 4403 times
Thank you.
Post Reply