Sometimes you may need to limit the functionality of the report, for example, remove unnecessary export formats from the list in the preview mode. This can be done in your application code. Let’s write a function to delete a report object:
As you can see, first you need to find the specified object in the collection of registered objects. Then delete the object.
Now let's see how to call this method:
That is, to remove the registered object, you just need to pass the object type.
Important note! You must delete objects after creating the Report object, otherwise, when you delete, you will search for objects in an empty collection.
Another way to disable objects is also possible:
In this case, you can both turn off and include objects by writing one more function:
In this way, you can organize the management of the display of objects in the report preview menu.
We considered deletion of objects using the example of exports, but this is also true for all other registered objects (functions, transports, etc.).