Dear Stimulsoft Team,
I wonder whether it is possible to set dateformat for whole report in c# code by ourselves? We have clients in Europe and now in America (and they want MM/dd).
I am looking for something (pseudocode)
Report.setDefaultDateTimeFormat = new StiDateFormatService("dd/MM/yyyy", "");
IN CASE IF it is not possible
is it possible for StiText which has already set dateFormat
the solution can be for datetime
Regards,
Iskandar Anvarov
Set Date format for whole report
-
- Posts: 105
- Joined: Thu Aug 17, 2017 12:07 pm
-
- Posts: 105
- Joined: Thu Aug 17, 2017 12:07 pm
Re: Set Date format for whole report
Dear Stimulsoft Team,
We have resolved this issue.
In case if others will need it, here is code snippets
Regards,
Iskandar
We have resolved this issue.
In case if others will need it, here is code snippets
Code: Select all
var components = report.GetComponentsWithProperty("Text");
var dateFormat = _reportRepository.GetDateFormat();
foreach (var component in components)
{
if(component is StiText)
{
var textCell = component.GetProperty("TextFormat") as StiFormatService;
if (textCell is StiDateFormatService)
{
((StiText)component).TextFormat = new StiDateFormatService(dateFormat, "");
}
}
}
Iskandar
Re: Set Date format for whole report
Hello, Iskandar.
Thank you for sharing your solution here on the forum.
Thank you for sharing your solution here on the forum.