Задайте вопросЗадайте вопрос
 

ОтвеченоMultilingual - Translate the CrustalReportViewer...

Ответы

  • 22 ноября 2006 г. 12:13anders_sms Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено
    Found a solution to the whole thing at last:

    1. Create a working directory, e.g., C:\crystalresources, and copy the file "C:\Program Files\Common Files\Business Objects\2.7\Managed\CrystalDecisions.Windows.Forms.dll" (or wherever it is located) to the created directory
    2. Run Visual Studio .NET 2005 Command Prompt from the start menu, and change the current directory (I assume in all the following snippets that you are located in C:\crystalresources):

    cd C:\crystalresources

    3. Disassemble the assembly. Don't extract the code, we are interested only in the resources.

    ildasm CrystalDecisions.Windows.Forms.dll /OUT=CrystalDecisions.Windows.Forms.il /ITEM=

    4. Convert the resources to the XML format.

    resgen CrystalDecisions.Windows.Forms.CRViewerSys.resources CrystalDecisions.Windows.Forms.CRViewerSys.resx

    5. You may delete all files in C:\crystalresources except the .resx

    7. Run the resgen utility to compile the .txt files.

    resgen /compile CrystalDecisions.Windows.Forms.CRViewerSys.resx,CrystalDecisions.Windows.Forms.resources

    8. Run the al.exe utility to create a DLL form the resource file (.resources). Here it is important to define your Locale, in the example below I have no for norway. (/culture:no)

    al.exe /t:lib /embed:CrystalDecisions.Windows.Forms.resources /culture:no /out:CrystalDecisions.Windows.Forms.custom_resources.dll

    9. Place the language resource file (.dll) in a subdirectory where your application is located. For Norwegian it would be "no".

    10. Thats it.... Norwegian texts!


    Info gotten from these locations:
    http://marian.ideaz.sk/crystal/
    http://support.businessobjects.com/documentation/product_guides/cr_net/vs_2005/html/crtsktutorialsothermultilingualcompilingcustom.htm

Все ответы

  • 16 ноября 2006 г. 19:27Antón Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    If you work with the Crystal Reports version distributed with Visual Studio, you don't have the resource files.You can download them in this link.

    http://diamond.businessobjects.com/system/files/LanguageResourceFiles.zip
  • 17 ноября 2006 г. 7:30anders_sms Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Hi Anton, thanks for your reply.
    I have downloaded those resource files before, and it does not contain an English version... that's my problem... I don't know German etc...

    Need one in English that I can translate and compile.
  • 22 ноября 2006 г. 12:13anders_sms Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено
    Found a solution to the whole thing at last:

    1. Create a working directory, e.g., C:\crystalresources, and copy the file "C:\Program Files\Common Files\Business Objects\2.7\Managed\CrystalDecisions.Windows.Forms.dll" (or wherever it is located) to the created directory
    2. Run Visual Studio .NET 2005 Command Prompt from the start menu, and change the current directory (I assume in all the following snippets that you are located in C:\crystalresources):

    cd C:\crystalresources

    3. Disassemble the assembly. Don't extract the code, we are interested only in the resources.

    ildasm CrystalDecisions.Windows.Forms.dll /OUT=CrystalDecisions.Windows.Forms.il /ITEM=

    4. Convert the resources to the XML format.

    resgen CrystalDecisions.Windows.Forms.CRViewerSys.resources CrystalDecisions.Windows.Forms.CRViewerSys.resx

    5. You may delete all files in C:\crystalresources except the .resx

    7. Run the resgen utility to compile the .txt files.

    resgen /compile CrystalDecisions.Windows.Forms.CRViewerSys.resx,CrystalDecisions.Windows.Forms.resources

    8. Run the al.exe utility to create a DLL form the resource file (.resources). Here it is important to define your Locale, in the example below I have no for norway. (/culture:no)

    al.exe /t:lib /embed:CrystalDecisions.Windows.Forms.resources /culture:no /out:CrystalDecisions.Windows.Forms.custom_resources.dll

    9. Place the language resource file (.dll) in a subdirectory where your application is located. For Norwegian it would be "no".

    10. Thats it.... Norwegian texts!


    Info gotten from these locations:
    http://marian.ideaz.sk/crystal/
    http://support.businessobjects.com/documentation/product_guides/cr_net/vs_2005/html/crtsktutorialsothermultilingualcompilingcustom.htm

  • 7 декабря 2006 г. 16:09COMA1111 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    I generated the custom dll very well, but how can I integrate this dll to my project? How the viewer detect the change of language? Does the viewer will select his language according to the language of the form?

     

    Thanks

  • 8 декабря 2006 г. 8:06anders_sms Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Selecting the language in the Regional and Language Options in the control panel is supposed to be working. But that didn't really work for me. Only a few strings was translate, e.g. tooltips was still in english.

    Adding this code on the form load worked:

    CultureInfo ci = new CultureInfo("nb-NO");
    Thread.CurrentThread.CurrentCulture = ci;
    Thread.CurrentThread.CurrentUICulture = ci;

    This ensures that the current culture is norwegian, and all texts are in norwegian!  You have to change it to what ever you need of course.
  • 8 декабря 2006 г. 13:22COMA1111 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    Thanks anders.... It's working for me... I added "Application.CurrentCulture = new CultureInfo("FR-CA");" to the main...

    Now Trying to do the same thing in web... do you have an idea?

    thanks

  • 19 июня 2007 г. 14:57ib00042 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    Hi,


    I would like to know if you are speaking about the fields of a report or if you are speaking about the viewer, where the report can be seen filled?

    I'm trying to generate a resource file to the fields of the reports, that change based on the regional settings.

    If you could help me, please let me know.



    Thanks.



    R

  • 19 июня 2007 г. 17:01COMA1111 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    We are speaking about the tooltip et labels of the viewer.

     

    But if you want to change fields of your reports according to your regional settings, you need to access your report and change the value of your fields.

     

    ((TextObject)ReportDocument.ReportDefinition.Sections["YourSection"].ReportObjects["YourField"]).Text = yourResourceValue;

     

     

  • 2 июля 2007 г. 16:05ib00042 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    thanks, your help was great!

    Now I have other problem, if I have a subreport object in a section, how can I change the fields?

    I was trying to access them directly based on the section, but I can't, my goal was making a recursive function to translate reports, but the subreport is a ReportObject not a ReportDocument, and I can't cast, I need to create one, but it doesn't exist, only within the main report.


    Thanks for your help.


    R


  • 6 июля 2007 г. 12:12COMA1111 Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    Here's the way thaht i used to set sub report fileds.

     

    protected void SetSubReportTextField(string subReport, string field, string value)

    {

    ((TextObject)ReportDocument.Subreports[subReport].ReportDefinition.Sections[0].ReportObjects[field]).Text = value;

    }