D
D
Danil2018-12-17 22:18:21
1C-Enterprise
Danil, 2018-12-17 22:18:21

How to create a modular data entry window to generate a report on them?

Hello, I created a report based on the data of the InformationAboutStudents directory , which displays a list of all students of this class. That's just to set the class, you have to change the variable in the code every time NecessaryClass , and this is very, very bad. And so I was puzzled by the problem of creating a modal window with data entry of the class for which I want to generate a report, I tried to do this using the EnterLine command , but an error pops up that the procedure or function named EnterLine is not defined. Perhaps modular windows are not made on the server side at all and they somehow need to be tried to be implemented on the client, or maybe I'm using the wrong command. Please tell me how to resolve the issue.
Here is the code that I scribbled:

&НаСервере
Процедура ПриСозданииНаСервере(Отказ, СтандартнаяОбработка)
  // модальное окно с запросом ввода класса
  НужныйКласс = ""; //Перем НужныйКласс
  ВвестиСтроку(НужныйКласс, "Введите класс.", 2, Ложь); 
  
  Выборка = Справочники.ИнформацияОбУчениках.Выбрать(,,,"Наименование");
  
  Макет = Отчеты.УченикиВКлассе.ПолучитьМакет("Макет");
  ОбластьШапка = Макет.ПолучитьОбласть("Шапка");
  ОбластьНазвЭлементов = Макет.ПолучитьОбласть("НазвЭлементов");
  ОбластьЭлементы = Макет.ПолучитьОбласть("Элементы");
  
  ТабДок.Вывести(ОбластьШапка);
  ТабДок.Область("R1C1:R1C4").Текст = "Ученики в " + НужныйКласс + " классе";
  ТабДок.Вывести(ОбластьНазвЭлементов);
  
  Пока Выборка.Следующий() Цикл		
    Если Выборка.Класс.Наименование = НужныйКласс Тогда
      ОбластьЭлементы.Параметры.Заполнить(Выборка);
      ТабДок.Вывести(ОбластьЭлементы);
    КонецЕсли;
  КонецЦикла;
КонецПроцедуры

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Nagibovich, 2018-12-17
@OnlyGoRush

How do you imagine entering a string on the server? This should definitely be done on the client.
Get data about the class by request. Your brute-force option is not very optimal.

D
Dmitry Kinash, 2018-12-17
@Dementor

EnterString() - variant for interface on regular forms for thick client
You need to use ShowStringInput() - for client-server operation in managed application interface.
I read your code - horror. Why don't you want to make a form for your report? You can enter your class through the form attribute, and display the result in the spreadsheet document field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question