Page 1 of 2
Report culture
Posted: Tue Oct 06, 2015 12:44 pm
by victorinable
Hi,
It is possible to obtain the culture selected for the report and print it on the report itself?
Thanks in advance.
Re: Report culture
Posted: Tue Oct 06, 2015 2:38 pm
by HighAley
Hello, Victor.
You could use next expression in the Text component:
Thank you.
Re: Report culture
Posted: Wed Oct 07, 2015 7:32 am
by victorinable
Hi Aleksey,
Thanks for the response, very useful for my reports.
I have another question: How can I change the culture of the report from code? I tried that with no success
Code: Select all
report.LocalizeReport("en-GB")
report.Culture = "en"
Should this be done before compiling? after? there is something I missing? I also tried with te steps desribed on:
http://blog.stimulsoft.com/articles/erasing-boarders
But I'm not able to change reports culture.
Thanks in advance.
Re: Report culture
Posted: Wed Oct 07, 2015 9:06 am
by victorinable
Hi Aleksey,
I succeed on this doubt. I observed it was being applied only once I execute the report twice, so I deduced this should be applied before compiling the report. Now it's working perfectly!!!!
Just for curiosity, I do the following:
Code: Select all
report.Load(myDAL.getPaths("REPORT", id, "ES", myDAL.getPac(user), user))
Dim culture As String = Session("culture")
Select Case culture
Case "es"
report.Culture = "es-ES"
report.GlobalizationManager.Culture = New CultureInfo(report.Culture)
Case "en"
report.Culture = "en-GB"
report.GlobalizationManager.Culture = New CultureInfo(report.Culture)
Case "pt"
report.Culture = "pt-BR"
report.GlobalizationManager.Culture = New CultureInfo(report.Culture)
End Select
report.Compile()
If there is any other way to do this, I'll be glad to know how.
Many thanks in advance.
Re: Report culture
Posted: Wed Oct 07, 2015 12:34 pm
by HighAley
Hello, Victor.
What is wrong with your report?
Could you describe more detailed what did you do and what do you need to get?
Please, attach any sample.
Thank you.
Re: Report culture
Posted: Wed Oct 07, 2015 12:46 pm
by victorinable
Hi Aleksey,
The initial problem was solved, I was just asking if there's any other way to do this, but it's working now.
I guess there's something I did wrong, as I had problems on the "Localization Strings" because sometimes are being mixed.
To specify:
I add 3 languages: Spanish(Default), English and Portuguese. After some tests, some of the strings where mixed (Some of the englishes went to the portuguese and things like that). I'm doing all this again (Not a lot of strings to translate) and if I have problems with this I will attach you the report to cross-check that the configuration I setted is correct.
My objective is that, depending on the culture used in our MVC application the report could be localized (The viewer and designer are working perfect) on those 3 different languages. This I succeed on doing it, the problem is the one described above, some strings are being mixed (Strange behaviour, that's why I guess it's entirely MY fault, so I'll do it again to check)
I'll let you know if problem persists.
Thanks in advance for the support!
Re: Report culture
Posted: Wed Oct 07, 2015 12:51 pm
by HighAley
Hello.
There are two different methods for globalization of the reports.
One is to use Globalization Strings, the another is Globalization Manager.
The Globalization strings allow to localize reports in Designer.
The Globalization Manager takes localizations from resource files of the project.
Thank you.
Re: Report culture
Posted: Thu Oct 08, 2015 9:56 am
by victorinable
Hi Aleksey,
Ok, this one the methods I found. I use GlobalizationStrings and it works almost fine.
But, I may say there is something not working fine. As I said before, after I translated AGAIN all strings, they were being mixed. This is annoying because I had to translate twice the report. Please check this is a bug, I can provide samples. I'll create for third time the same report, translate it and capy it. I'll interact with one of the copies and you can see the strings changed (mixed between different languages/Cultures) by themselves.
If some extra information is needed don't hesitate asking it. I'm really interested this work fine.
Thanks in advance!
Re: Report culture
Posted: Thu Oct 08, 2015 12:15 pm
by HighAley
Hello, Victor.
Could you describe more detailed what is wrong with the Globalization Strings?
Could you send us a video or step-by-step instruction where we could see what is wrong?
Thank you.
Re: Report culture
Posted: Thu Oct 08, 2015 12:55 pm
by victorinable
Hi Aleksey,
Of course. I'm actually doing some reports in different steps to compare what's happening.
I'll also send you the instructions used to localize/translate the report. Both with report configration and instructions executed you can see where I'm "destroying" the globalization strings.
Thanks for the support.