NOTE: This page has been translated automatically from Russian to English. Original page.
We investigated the mechanism Additional reports and processing in BSP
Recently, I faced with the need to apply this technology. Articles on the Internet a lot. But a full understanding, they do not give.
As a result, it managed to find out, having spent some time.
I will describe what I'd like to know about this mechanism to begin to use it.
Data on external processing
To connect an external report or processing in reference Дополнительные отчеты и обработки
necessary to describe the export function СведенияОВнешнейОбработке()
in the module. Here is a template function:
Функция СведенияОВнешнейОбработке() Экспорт ПараметрыРегистрации = ДополнительныеОтчетыИОбработки.СведенияОВнешнейОбработке(); // заполняем структуру ПараметрыРегистрации Возврат ПараметрыРегистрации; КонецФункции
Description of the fields of the returned structure can be found in the commentary to the function ДополнительныеОтчетыИОбработки.СведенияОВнешнейОбработке()
. There you can get the latest information for your version of the BSP.
Describe the basic structure of the field of the external processing information. This will be repeated at the minimum information referred to in the comments and I will try to complete it.
The "View"
Minimum conditions for the registration of an external report or process is to fill in the field "Type". That is, if you create an external treatment and prescribe it in the following code, then it will be enough to add it to the directory of Дополнительные отчеты и обработки
// Минимальное описание параметров регистрации Функция СведенияОВнешнейОбработке() Экспорт ПараметрыРегистрации = ДополнительныеОтчетыИОбработки.СведенияОВнешнейОбработке(); ПараметрыРегистрации.Вид = ДополнительныеОтчетыИОбработкиКлиентСервер.ВидОбработкиЗаполнениеОбъекта(); Возврат ПараметрыРегистрации; КонецФункции
This field determines where the team will be called from a menu item on a form or an object list.
Possible values for this field in the form of tables give
The field "Type" | team Location | Expansion file |
---|---|---|
PechatnayaForma | In the menu "Print" object or list | epf |
ZapolnenieObekta | In the "Fill" object or list | epf |
SozdanieSvyazannyhObektov | In the "Create on the basis of" - "The creation of related objects .." object or list | epf |
Report | In the "Reports" object or list | erf |
DopolnitelnayaObrabotka | The list of relevant subsystems in the "Tools" menu - the "Advanced Processing" | epf |
DopolnitelnyyOtchet | The list of relevant subsystems in the "Tools" menu - the "Advanced Reports" | erf |
This field can take one of the values returned by functions ДополнительныеОтчетыИОбработкиКлиентСервер.ВидОбработки<Вид>()
. For example, there is a function to form "PechatnayaForma" ВидОбработкиПечатнаяФорма()
.
// рекомендуется заполнять поле "Вид" таким способом ПараметрыРегистрации.Вид = ДополнительныеОтчетыИОбработкиКлиентСервер.ВидОбработкиПечатнаяФорма(); // а не вот таким ПараметрыРегистрации.Вид = "ПечатнаяФорма";
The "Purpose"
It contains an array of configuration objects in the format "<type>. <Type>", for which an external report / treatment will be appointed.
// для конкретных видов ПараметрыРегистрации.Назначение.Добавить("Документ.Счет"); // для всех документов ПараметрыРегистрации.Назначение.Добавить("Документ.*");
This parameter is ignored if the field "Type" is set to "DopolnitelnayaObrabotka" or "DopolnitelnyyOtchet".
The "Name"
This value is inserted into the guide element name Дополнительные отчеты и обработки
to create.
If not filled, it is used a synonym for external processing / report.
It can only be used for administration, and when added to the menu, such as print commands will be entered the name of the teams of the table, not the value of this field.
The "Team"
A table of values is loaded into a table of the same name of the directory element Дополнительные отчеты и обработки
the registration of external processing.
This tabular part can be filled manually.
Each line corresponds to one point in the relevant menu as described in the table above.
To command the external machining appeared in the right menu, be sure to add at least one row in this table.
НоваяКоманда = ПараметрыРегистрации.Команды.Добавить(); НоваяКоманда.Представление = "Заказ с характеристиками (сервер)"; НоваяКоманда.Идентификатор = "ЗаказСХарактеристикамиСервер"; НоваяКоманда.Использование = ДополнительныеОтчетыИОбработкиКлиентСервер.ТипКомандыВызовСерверногоМетода();
Table "Commands" column "Use"
In the column "Use" indicates the type called Team. By combining Вид-Тип команды
system determines what predefined procedure is called from the external processing / reporting, and where it will be announced - on the client or on the server.
The most commonly used treatments Печать()
and ВыполнитьКоманду()
, as well as the opening of the mold without resorting to the method.
This field can take one of the values returned by functions ДополнительныеОтчетыИОбработкиКлиентСервер.ТипКоманды<Тип>()
, for example, ТипКомандыВызовСерверногоМетода()
. In each of these functions has a detailed comment.
Also different composition and quantity parameters transmitted to the external processing / report. Briefly describe the possible uses of the table
team Type | The field "Type" | Called the export procedure |
---|---|---|
VyzovServernogoMetoda | PechatnayaForma | Print ( MassivObektov, KollektsiyaPechatnyhForm, ObektyPechati, ParametryVyvoda) |
DopolnitelnayaObrabotka DopolnitelnyyOtchet Report | RunCommand ( IdentifikatorKomandy, ParametryVypolneniya) | |
SozdanieSvyazannyhObektov | RunCommand ( IdentifikatorKomandy, ObektyNaznacheniya, SozdannyeObekty, ParametryVypolneniya) | |
ZapolnenieObekta | RunCommand ( IdentifikatorKomandy, ObektyNaznacheniya, ParametryVypolneniya) | |
VyzovKlientskogoMetoda | PechatnayaForma | & NaKliente Print ( IdentifikatorKomandy, ObektyNaznacheniyaMassiv) |
DopolnitelnayaObrabotka DopolnitelnyyOtchet | & NaKliente RunCommand ( IdentifikatorKomandy) | |
SozdanieSvyazannyhObektov | & NaKliente RunCommand ( IdentifikatorKomandy, ObektyNaznacheniyaMassiv, SozdannyeObekty) | |
ZapolnenieObekta Report | & NaKliente RunCommand ( IdentifikatorKomandy, ObektyNaznacheniyaMassiv) | |
For all kinds of | in the form of parameter is passed DopolnitelnayaObrabotkaSsylka | |
OtkrytieFormy | SozdanieSvyazannyhObektov ZapolnenieObekta Report | in the form of an additional parameter is passed ObektyNaznacheniya |
For all kinds of | in the form of transmitted parameters IdentifikatorKomandy DopolnitelnayaObrabotkaSsylka ImyaFormy | |
Report | Report layout with ACS can be shaped, then it will used for the overall shape of the default reports | |
ZapolnenieFormy | ZapolnenieObekta | RunCommand ( IdentifikatorKomandy, ObektyNaznacheniya, ParametryVypolneniya) |
StsenariyVBezopasnomRezhime | For all kinds of | cm. description in the comments to the function DopolnitelnyeOtchetyIObrabotkiKlientServer .TipKomandyStsenariyVBezopasnomRezhime () |
ZagruzkaDannyhIzFayla | DopolnitelnayaObrabotka | cm. description in the comments to the function DopolnitelnyeOtchetyIObrabotkiKlientServer .TipKomandyZagruzkaDannyhIzFayla () |
For commands such ВызовКлиентскогоМетода
need to create a form in the processing, assign it to the main and declare the export procedure
Useful procedures
I recommend to pay attention to the following procedures and functions:
ДополнительныеОтчетыИОбработки.ЗарегистрироватьОбработку(ОбъектСправочника, ПараметрыРегистрации) ДополнительныеОтчетыИОбработки.ПолучитьОбъектВнешнейОбработки(Ссылка) ДополнительныеОтчетыИОбработки.ВыполнитьКомандуИзФормыВнешнегоОбъекта(ИдентификаторКоманды, ПараметрыКоманды, ЭтаФорма)
It will also be useful to develop a demo configuration for the BSP. In it there are examples of external data processors and reports in the directory external treatments.
files
Attached is templates for the most popular in my opinion the use of options
Templates are tested on BSP 2.3.2.35 in compatibility mode 8.3.6. Version of the library in its configuration can be found in the register of information Версии подсистем
The templates present the minimum required code and removed all unnecessary.
If you find bugs or have any questions on the application - write in the comments, I will try to fix / answer possible.
This list of files suppose to expand as needed
The outer plate (template)
Implemented types of commands: VyzovServernogoMetoda, VyzovKlientskogoMetoda, OtkrytieFormy.
The pattern itself is recorded unaltered for all types of documents and issue a printed form containing the list of objects passed to him and the team ID.
That is, all methods used in its work, they will only have to fill in their data.
External processing Creation of related objects (template)
Implemented types of commands: VyzovServernogoMetoda, VyzovKlientskogoMetoda, OtkrytieFormy.
The pattern itself is recorded unaltered for all types of documents and outputs the transmitted data through the report.
External processing facility Filling (template)
Implemented types of commands: VyzovServernogoMetoda, VyzovKlientskogoMetoda, OtkrytieFormy, ZapolnenieFormy.
The pattern itself is recorded unaltered for all types of documents and increases by one day the date of selected document (or documents).
External Report SKD on the project (template)
Implemented type of commands: OtkrytieFormy
The pattern itself is recorded unaltered for the organization directory and displays the field Link, code name to the selection by the organization (or organizations), which called for a report