Text Format Problem???
-
- Posts: 85
- Joined: Sat Jan 20, 2007 4:21 am
Text Format Problem???
Hi,
I want to set Text Format to Particular Text. the Text(Numeric Field) Contains the value like 12.300000. I want this value as 12.30 only.
So i set Text Format as Like,
Text1.TextFormat = new Stimulsoft.Report.Components.TextFormats.StiNumberFormatService(1, ".", 2, ",", 4, true, false, " ");
It doesn't Work ???
Please Provide the Solutions...
Thanks in Advance,
Jayakumar
I want to set Text Format to Particular Text. the Text(Numeric Field) Contains the value like 12.300000. I want this value as 12.30 only.
So i set Text Format as Like,
Text1.TextFormat = new Stimulsoft.Report.Components.TextFormats.StiNumberFormatService(1, ".", 2, ",", 4, true, false, " ");
It doesn't Work ???
Please Provide the Solutions...
Thanks in Advance,
Jayakumar
Text Format Problem???
Try to use: Text1.Text = String.Format("{0:0.00}", 12.300000);
Thank you.
Thank you.
Text Format Problem???
tanx for your reply
but I have a StiText in DataBand and I change Format String in designer and don't work.
how can i set formating to StiText in DataBand in my c# Code?
or is a better way?
becuse I have too many StiText that I want to change format.(about 100)!!
but I have a StiText in DataBand and I change Format String in designer and don't work.
how can i set formating to StiText in DataBand in my c# Code?
or is a better way?
becuse I have too many StiText that I want to change format.(about 100)!!
Text Format Problem???
Hello,
You can use following code:
Thank you.
You can use following code:
Code: Select all
StiComponentsCollection comps = report.GetComponents();
foreach (StiComponent comp in comps)
{
StiText text = comp as StiText;
if (text != null)
{
text.TextFormat = .....//new text format
}
}
Text Format Problem???
i use this code before but it does not work for my report.StiComponentsCollection comps = report.GetComponents();
foreach (StiComponent comp in comps)
{
StiText text = comp as StiText;
if (text != null)
{
text.TextFormat = .....//new text format
}
}
but below code work for me:
Code: Select all
text.Text = String.Format("{0:N2}", value)
plz help me.
Text Format Problem???
Hello,
Try to use following expression:
Thank you.
Try to use following expression:
Code: Select all
{Products.UnitPrice.ToString("N2")}