Page 1 of 1

How to access data from resources files in a report template

Posted: Mon Jun 22, 2015 8:38 am
by shlinux
i have multiple stimulsoft reports and localization .resx files.
how to "programmatically" and (dynamically "thought") load these resources file into stimulsoft reports
thnx :D

Re: How to access data from resources files in a report temp

Posted: Mon Jun 22, 2015 11:07 am
by Alex K.
Hello,

Please check the sample project in the attachment.

Thank you.

Re: How to access data from resources files in a report temp

Posted: Mon Jun 22, 2015 11:29 am
by shlinux
Thank you for your reply, it was very helpful,
still i have little problem
the resources files are in a differenent project but within the same solution, so i created the GlobalizationManager in that project and then i referenced it in the main project

in the controller i made:

Code: Select all

report.GlobalizationManager = new GlobalizationManager("Culture.Resources", new CultureInfo("ar-JO"));
and finally i render

Code: Select all

return stiMvcViewer.getReportSnapshotResult(report) ;
but i still view the report in the default language

EDIT:
After some debugging i noticed that the globalizationManager of the object "report" is being set to "ar-JO" as wanted ! still the view is with the default language "fr-FR"

Re: How to access data from resources files in a report temp

Posted: Mon Jun 22, 2015 1:00 pm
by shlinux
I figured out the problem,
I didnt supplied the correct path of the resources to the resource manager
:mrgreen:

Re: How to access data from resources files in a report temp

Posted: Mon Jun 22, 2015 9:14 pm
by Jan
Fine!