Reputation: 27
I use this code for pass a Number to stimulsoft report:
stiReport1.Load(Application.StartupPath + "\\MyReport.mrt");
(stiReport1.GetComponentByName("Text35") as StiText).Text = Mynumber.ToString();
stiReport1.RegData(databaseDataSet.Mytable);
stiReport1.Show();
I set Text35 Format in MyReport same this pic: https://i.imgsafe.org/0a7bb2d.png
But it dosen't Work and For example Show 12000 instead 12,000
Upvotes: 1
Views: 3813
Reputation: 198
You can handle it in c# and pass a formatted string to report:
Mynumber.ToString("##,###")
Upvotes: 1
Reputation: 1329
The Text Format have no matter. The number is converted to string in your code here :
= Mynumber.ToString();
If you need to change the format you should do it in ToString() method.
The other way is to use a numeric report variable, use it in the Text35 text component and set its value with next code:
report.Dictionary.Variables["Variable1"].Value = yourNumber;
Upvotes: 2