There is much about localizing designer, but I couldn't find any info about SLViewer. Please help.
I did some code, but nothing worked:
StiLocalization.Language = "Polish";
StiLocalization.CultureName = "pl";
StiLocalization.Description = "Polski";
StiLocalization.DirectoryLocalization = "\\Resources\\Localization\\PrintLocals\\";
StiLocalization.Localization = "pl.xml";
viewer.Localize();
How to localize SLViewer?
-
- Posts: 135
- Joined: Tue Aug 11, 2009 9:38 am
How to localize SLViewer?
Hello,
Please use the following code:
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Stimulsoft.Report.StiConfig.LoadLocalization(asm, "SilverlightApplication1.Localization.pl.xml");
Stimulsoft.Base.Localization.StiLocalization.Load(Stimulsoft.Report.StiConfig.Localizations[0]);
Thank you.
Please use the following code:
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Stimulsoft.Report.StiConfig.LoadLocalization(asm, "SilverlightApplication1.Localization.pl.xml");
Stimulsoft.Base.Localization.StiLocalization.Load(Stimulsoft.Report.StiConfig.Localizations[0]);
Thank you.
How to localize SLViewer?
Hi,
I used your code and it seems I'm doing somthing wrong...
It throws an exception:
{System.ArgumentNullException: Value cannot be null.
Nazwa parametru: stream
w System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
w System.IO.StreamReader..ctor(Stream stream)
w Stimulsoft.Report.StiConfig.LoadLocalization(Assembly asm, String nameOfResource)
w THBZasoby.Views.Printing.PrintPreviewWindow..ctor(String repName, IPrintingService service)}
My code now is:
public PrintPreviewWindow(string repName, IPrintingService service)
:this()
{
Service = service;
Title = repName;
//StiLocalization.Language = "Polish";
//StiLocalization.CultureName = "pl";
//StiLocalization.Description = "Polski";
//StiLocalization.DirectoryLocalization = "\\Resources\\Localization\\PrintLocals\\";
//StiLocalization.Localization = "pl.xml";
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Stimulsoft.Report.StiConfig.LoadLocalization(asm, "THBZasoby.Localization.pl.xml"); < <<<< = = = = Here it throws an exception
Stimulsoft.Base.Localization.StiLocalization.Load(Stimulsoft.Report.StiConfig.Localizations[0]);
//StiLocalization.Localization = "pl";
viewer.Localize();
//viewer.Localization = "pl";
}
Thank you.
[Edit:] I'm using version: 2011.1 of Reports.Silverlight
I used your code and it seems I'm doing somthing wrong...
It throws an exception:
{System.ArgumentNullException: Value cannot be null.
Nazwa parametru: stream
w System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
w System.IO.StreamReader..ctor(Stream stream)
w Stimulsoft.Report.StiConfig.LoadLocalization(Assembly asm, String nameOfResource)
w THBZasoby.Views.Printing.PrintPreviewWindow..ctor(String repName, IPrintingService service)}
My code now is:
public PrintPreviewWindow(string repName, IPrintingService service)
:this()
{
Service = service;
Title = repName;
//StiLocalization.Language = "Polish";
//StiLocalization.CultureName = "pl";
//StiLocalization.Description = "Polski";
//StiLocalization.DirectoryLocalization = "\\Resources\\Localization\\PrintLocals\\";
//StiLocalization.Localization = "pl.xml";
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Stimulsoft.Report.StiConfig.LoadLocalization(asm, "THBZasoby.Localization.pl.xml"); < <<<< = = = = Here it throws an exception
Stimulsoft.Base.Localization.StiLocalization.Load(Stimulsoft.Report.StiConfig.Localizations[0]);
//StiLocalization.Localization = "pl";
viewer.Localize();
//viewer.Localization = "pl";
}
Thank you.
[Edit:] I'm using version: 2011.1 of Reports.Silverlight
How to localize SLViewer?
OK. I've managed that using your code 
The path was a bit different and the localize file needed to be compiled as embedded resource.
Thanks.

The path was a bit different and the localize file needed to be compiled as embedded resource.
Thanks.
-
- Posts: 135
- Joined: Tue Aug 11, 2009 9:38 am
How to localize SLViewer?
Hello,
Let us know if you need any additional help.
Thank you.
Let us know if you need any additional help.
Thank you.