
1C: reports on DCD, part 3: printed forms — layouts, BSP, and refinements through extension
🌐 Machine-translated from Russian. Show original
In this part:
Variants#
| Method | When |
|---|---|
| External print form via "Additional Reports and Processing" | quickly without changing the configuration of the |
| Print form in extension | continuous improvement, required in the print menu of the |
| Changing the default | almost never — breaks updates |
Table document layout#
- The layout is divided into named areas: Header, Row, Basement.
- The cells contain parameters (
[Номер],[Контрагент]), not text pasted into the code. - A separate layout for each language if the document is printed in Russian and Kazakh.
Formation code#
Функция СформироватьПечатнуюФорму(МассивОбъектов)
ТабДок = Новый ТабличныйДокумент;
Макет = ПолучитьМакет("Акт");
ОбластьШапка = Макет.ПолучитьОбласть("Шапка");
ОбластьСтрока = Макет.ПолучитьОбласть("Строка");
Для Каждого Ссылка Из МассивОбъектов Цикл
Если ТабДок.ВысотаТаблицы > 0 Тогда
ТабДок.ВывестиГоризонтальныйРазделительСтраниц();
КонецЕсли;
ОбластьШапка.Параметры.Заполнить(Ссылка);
ТабДок.Вывести(ОбластьШапка);
Для Каждого Строка Из Ссылка.Товары Цикл
ОбластьСтрока.Параметры.Заполнить(Строка);
ТабДок.Вывести(ОбластьСтрока);
КонецЦикла;
КонецЦикла;
Возврат ТабДок;
КонецФункции
Get print data with a single query across all documents, not by accessing details in the loop through a point — otherwise, printing a batch of documents will be slow (why).
Integration into BSP#
Connecting the print form to the print menu is done through the software interface of the "Print" subsystem (procedures for adding print commands and generating printing forms in the manager module or in processing). See the documentation for your BSP version and in examples of standard print forms of your configuration.
Checklist#
- The form is printed as a stack of documents with page separators
- Data is obtained with a single request
- Numbers and dates are formatted, sums in words using standard functions
- The form is placed on a sheet of the required format, verified by printing, and in PDF
- Modification — in external processing or extension, not in the standard
🎉 Series completed. Return to contents.
Comments · 0
No comments yet.Sign in to comment, rate and see all comments.