Cannot get the instance of a plugin while the designer is open

This code creates a report designer on a form while the form is being created:
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
      report.Designer = new Designer(report);
      report.Designer.ShowInPanel(this);
      report.Designer.MainMenuStrip.Visible = false;
      //ToolbarBase tb = (ToolbarBase)report.Designer.Plugins.FindType("StandardToolbar");
      //ToolbarBase tb = (ToolbarBase)report.Designer.Plugins.FindType(typeof(StandardToolbar));
    }
  }
cannot get the instance of StandardToolbar with these methods:
report.Designer.Plugins.FindType(typeof(StandardToolbar)) doesnt work because StandardToolbar is internal
report.Designer.Plugins.FindType("StandardToolbar") doesnt work because its obfuscated and its not guaranteed to have the same type name

Any idea how to get the instance?

Comments

  • edited 9:39PM
    Toolbars are internal classes, so it's impossible. What you need to do with toolbars?
  • edited 9:39PM
    We are currently using VCL fastreports in our .NET application. In order to do so we developed ActiveX classes etc..
    We provide our clients the ability to customize an inherited report and we display the designer inside our form.
    It's an ntier app so we get the base report and the inherited report via a service (both .net remoting and wcf is supported), open our .net form, load the report using LoadFromStream methods. We don't want them to do anything funny so open, new, save and preview buttons are hidden. Plus we hide the data tab so they don't see anything database related.
    They can do minor changes on the report pages and add new memos from available data fields and hide the ones they dont need.
    When they are done editing, they click on the save button and the inherited report gets updated on the database via another service call.
    Reports are prepared on the application server, so no database connection is opened from the client when a report is requested.

    We're using DevExpress .NET WinForms controls and I believe it will look better if we can get it done with FastReports .NET

  • edited 9:39PM
    You can enable/disable some designer operations by using the designer.Restrictions property. When you disable the operation, its button and/or menu item will hide.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.