How to remove unnecessary objects from the preview window toolbar

2018-05-19

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:  

1
2
3
4
5
 private void RemoveRegistered(Type type)
 {
 ObjectInfo obj = RegisteredObjects.FindObject(type);
 RegisteredObjects.Objects.Items.Remove(obj);
 }

 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:      

1
2
3
4
 RemoveRegistered(typeof(FastReport.Export.LaTeX.LaTeXExport));
 RemoveRegistered(typeof(FastReport.Export.Zpl.ZplExport));
 RemoveRegistered(typeof(FastReport.Export.Svg.SVGExport));
 RemoveRegistered(typeof(FastReport.Export.Dbf.DBFExport));

 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:

1
2
3
4
5
 private void DisableRegistered(Type type)
 {
 ObjectInfo obj = RegisteredObjects.FindObject(type);
 obj.Enabled = false;
 }

 In this case, you can both turn off and include objects by writing one more function:

1
2
3
4
5
 private void EnableRegistered(Type type)
 {
 ObjectInfo obj = RegisteredObjects.FindObject(type);
 obj.Enabled = true;
 }

 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.).

.NET .NET FastReport FastReport Preview Preview Toolbar Toolbar
26. Oktober 2026

Fortschrittsbalken in Delphi: Die Komponenten „TfrProgressBar“ und „TfrxProgressBar“ aus FastReport VCL

Schauen wir uns die Komponenten TfrProgressBar und TfrxProgressBar aus FastReport VCL einmal genauer an: Konfiguration der Fortschrittsskala, Schwellenwerte und Markierungen, Datenbindung sowie ein Delphi-Beispiel.
26. Oktober 2026

TfrImageComboBox: Eine Dropdown-Liste mit Bildern und Textbeschriftungen in FastReport VCL

TfrImageComboBox aus der FastEditors VCL: eine Dropdown-Liste mit Symbolen und Beschriftungen für die FastReport VCL. Eigenschaften, Ereignisse und Anwendungsbeispiele in Delphi.
23. Oktober 2026

FastGrid von innen: Das View-Objekt, Spalten und Ereignisse der Delphi-Grid-Komponente

Interner Aufbau von FastGrid: das View-Objekt, die Eigenschaft „Appearance“, Spalten, Ereignisse sowie die Datenverarbeitungsmodi „DB“ und „Unbound“ in Delphi. Erläuterung am Beispiel des Demo-Projekts „GridDemo.dpr“.

© 1998-2026 Fast Reports Inc.