Desktop version

Main > Forum > 1C:Enterprise Platform > Bugs and functionality requests to 1C:Enterprise platform > Another language in Data Composition System

Forum

Search UsersRules
Another language in Data Composition System
#1
Just came
Points:: 0
Joined:: Sep 19, 2014

Hello!
The configuration uses multiple languages. You need to add the ability for the user to generate reports in the DCS in the selected language. In this case, the report generation language will differ from the current configuration and user language.

Using the LanguageCode property for a SpreadsheetDocument does not produce the desired results.
Is it technically possible for the platform to implement this requirement?
Platform version 8.3.17

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

Hello Igor,

in this case, you can make several DataCompositionSchemas (DCS) in one report, each language has its own DCS. And already when generating a report, depending on the language chosen by the user, generate the necessary data.

Please see screenshots and source code below. I also attached a sample of the simplest report with a choice of languages.


Code
Procedure OnComposeResult(ResultDocument, DetailsData, StandardProcessing)
   
   StandardProcessing = False;

   If language Then 
        SchemeDataComposition = GetTemplate("DataCompositionSchema_en");
    Else 
        SchemeDataComposition = GetTemplate("DataCompositionSchema_ru");
    EndIf;

    Settings = SettingsComposer.GetSettings();
    
    TemplateComposer       = New DataCompositionTemplateComposer;
    TemplateComposition    = TemplateComposer.Execute(SchemeDataComposition, Settings, DetailsData);
    CompositionProcessor   = New DataCompositionProcessor;
   
   CompositionProcessor.Initialize(TemplateComposition, , DetailsData);
   
   OutputProcessor = New DataCompositionResultSpreadsheetDocumentOutputProcessor;
   
   OutputProcessor.SetDocument(ResultDocument);
    OutputProcessor.Output(CompositionProcessor);   
   
EndProcedure

Profile
#3
Administrator
Points:: 0
Joined:: Oct 3, 2019

Hello Igor,

no such problem was found on the 8.3.17.1549 platform. Please clarify in what configuration you're working? Also please email a sample source code where the error occurs.

Best regards,
Aleksandr

Profile
#4
Just came
Points:: 0
Joined:: Sep 19, 2014

I create new configuration at platform 8.3.17.1549
Add objects:
- two languages
- one catalog
- one report

I add this code in object module in report

Code
Procedure OnComposeResult(ResultDocument, DetailsData, StandardProcessing)
   ResultDocument.LanguageCode = "ru";
EndProcedure


As a result, I don't get russian headers under english user.
What am I doing wrong?

Profile
#5
Just came
Points:: 0
Joined:: Sep 19, 2014

If I add this code, I don't get result

Code
Procedure OnComposeResult(ResultDocument, DetailsData, StandardProcessing)
   
   ResultDocument.LanguageCode = "ru";
   
   StandardProcessing = False;
   
   Settings = ThisObject.SettingsComposer.GetSettings();
   UserSettings = ThisObject.SettingsComposer.UserSettings;
   
   TemplateComposer = New DataCompositionTemplateComposer;
   CompositionTemplate = TemplateComposer.Execute(ThisObject.DataCompositionSchema, Settings, DetailsData);
   
   CompositionProcessor = New DataCompositionProcessor;
   CompositionProcessor.Initialize(CompositionTemplate,, DetailsData, True);
   
   OutputProcessor = New DataCompositionResultSpreadsheetDocumentOutputProcessor;
   OutputProcessor.SetDocument(ResultDocument);
   
   OutputProcessor.BeginOutput();
   
   ResultItem = CompositionProcessor.Next();
   While ResultItem <> Undefined Do
      OutputProcessor.OutputItem(ResultItem);
      ResultItem = CompositionProcessor.Next();
   EndDo;

   OutputProcessor.EndOutput();
   
   ResultDocument.LanguageCode = "ru";
   
EndProcedure


Under the English user, I still get English headers
And only russian user, I get russian headers

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.