Hello,
I use the following method to export report from console application.
The problem is that the generating report is exported only in default culture (en).
Setting the Thread.CurrentCulture and Thread.CurrentUICulture has no effect.
Thanks in advance.
Best regards,
Geoffrey
I use the following method to export report from console application.
The problem is that the generating report is exported only in default culture (en).
Setting the Thread.CurrentCulture and Thread.CurrentUICulture has no effect.
private
void
GenerateReportFromSource(InstanceReportSource reportSource, ReportType reportType, String path, CultureInfo cultureInfo)
{
LocalizationInfo.Culture = cultureInfo;
Thread thread =
new
Thread(() =>
{
try
{
ReportProcessor reportProcessor =
new
ReportProcessor();
RenderingResult result = reportProcessor.RenderReport(reportType.ToString().ToUpper(), reportSource,
null
);
FileInfo info =
new
FileInfo(path);
if
(info.DirectoryName !=
null
&& !Directory.Exists(info.DirectoryName))
Directory.CreateDirectory(info.DirectoryName);
File.WriteAllBytes(path +
"."
+ reportType.ToString().ToLower(), result.DocumentBytes);
}
catch
(Exception e)
{
Logger.WriteException(e);
}
});
thread.CurrentCulture = cultureInfo;
thread.CurrentUICulture = cultureInfo;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
}
Thanks in advance.
Best regards,
Geoffrey