Search Results for

    Show / Hide Table of Contents

    Class EnvironmentSettings

    This class contains some global settings that used in the FastReport.Net.

    Inheritance
    System.Object
    System.MarshalByRefObject
    System.ComponentModel.Component
    EnvironmentSettings
    Namespace: FastReport
    Assembly: FastReport.dll
    Syntax
    [ToolboxBitmap(typeof(Report), "Resources.EnvironmentSettings.bmp")]
    public class EnvironmentSettings : Component, IComponent, IDisposable
    Remarks

    This component is intended for use in the Visual Studio IDE to quickly configure FastReport global settings. To use it, drop the component on your Form and set up its properties and events.

    Here are some common actions that can be performed with this object:

    • To define own open/save dialogs that will be used in the report designer, use the CustomOpenDialog, CustomSaveDialog, CustomOpenReport, CustomSaveReport events;
    • To pass connection string to the connection object defined in a report, or to define own database login dialog, use the DatabaseLogin event;
    • To adjust the connection object after it is opened, use the AfterDatabaseLogin event;
    • To define own progress window, use the StartProgress, FinishProgress and Progress events;
    • To setup some common properties of the report, designer and preview, use properties defined in this class;
    • To set UI style of the designer and preview window, use UIStyle property.

    This component actually uses the Config static class which contains ReportSettings, FastReport.Utils.Config.DesignerSettings and FastReport.Utils.Config.PreviewSettings properties. You can use Config class as well.

    Properties

    DesignerSettings

    Gets or sets the designer settings.

    Declaration
    public DesignerSettings DesignerSettings { get; set; }
    Property Value
    Type Description
    DesignerSettings

    EmailSettings

    Gets or sets the email settings.

    Declaration
    public EmailSettings EmailSettings { get; set; }
    Property Value
    Type Description
    EmailSettings

    PreviewSettings

    Gets or sets the preview settings.

    Declaration
    public PreviewSettings PreviewSettings { get; set; }
    Property Value
    Type Description
    PreviewSettings

    ReportSettings

    Gets or sets the report settings.

    Declaration
    public ReportSettings ReportSettings { get; set; }
    Property Value
    Type Description
    ReportSettings

    UIStyle

    Gets or sets the UI style of the designer and preview windows.

    Declaration
    [SRCategory("UI")]
    public UIStyle UIStyle { get; set; }
    Property Value
    Type Description
    UIStyle
    Remarks

    This property affects both designer and preview windows.

    UseRibbonUI

    Indicates whether the Ribbon-style window should be used.

    Declaration
    [SRCategory("UI")]
    public bool UseRibbonUI { get; set; }
    Property Value
    Type Description
    System.Boolean

    Events

    AfterDatabaseLogin

    Occurs after the database connection is established.

    Declaration
    [SRCategory("Report")]
    public event AfterDatabaseLoginEventHandler AfterDatabaseLogin
    Event Type
    Type Description
    AfterDatabaseLoginEventHandler

    CustomOpenDialog

    Declaration
    [SRCategory("Designer")]
    public event OpenSaveDialogEventHandler CustomOpenDialog
    Event Type
    Type Description
    OpenSaveDialogEventHandler

    CustomOpenReport

    Declaration
    [SRCategory("Designer")]
    public event OpenSaveReportEventHandler CustomOpenReport
    Event Type
    Type Description
    OpenSaveReportEventHandler

    CustomPreviewReport

    Occurs when previewing a report from the designer.

    Declaration
    [SRCategory("Designer")]
    public event EventHandler CustomPreviewReport
    Event Type
    Type Description
    System.EventHandler
    Remarks

    Use this event to show own preview window.

    Examples
    environmentSettings1.CustomPreviewReport += new EventHandler(MyPreviewHandler);
    
    private void MyPreviewHandler(object sender, EventArgs e)
    {
      Report report = sender as Report;
      using (MyPreviewForm form = new MyPreviewForm())
      {
        report.Preview = form.previewControl1;
        report.ShowPreparedReport();
        form.ShowDialog();
      }
    }

    CustomSaveDialog

    Declaration
    [SRCategory("Designer")]
    public event OpenSaveDialogEventHandler CustomSaveDialog
    Event Type
    Type Description
    OpenSaveDialogEventHandler

    CustomSaveReport

    Declaration
    [SRCategory("Designer")]
    public event OpenSaveReportEventHandler CustomSaveReport
    Event Type
    Type Description
    OpenSaveReportEventHandler

    DatabaseLogin

    Declaration
    [SRCategory("Report")]
    public event DatabaseLoginEventHandler DatabaseLogin
    Event Type
    Type Description
    DatabaseLoginEventHandler

    DesignerLoaded

    Occurs when the designer is loaded.

    Declaration
    public event EventHandler DesignerLoaded
    Event Type
    Type Description
    System.EventHandler
    Remarks

    Use this event if you want to customize some aspects of the designer, for example, to hide some menu items.

    Examples

    This example demonstrates how to hide the "File|Select Language..." menu item.

    environmentSettings1.DesignerLoaded += new EventHandler(DesignerSettings_DesignerLoaded);
    
    void DesignerSettings_DesignerLoaded(object sender, EventArgs e)
    {
      (sender as DesignerControl).MainMenu.miFileSelectLanguage.Visible = false;
    }

    FilterBusinessObjectProperties

    Occurs when discovering the business object's structure.

    Declaration
    [SRCategory("Report")]
    public event FilterPropertiesEventHandler FilterBusinessObjectProperties
    Event Type
    Type Description
    FilterPropertiesEventHandler

    FilterConnectionTables

    Occurs when getting available table names from the connection.

    Declaration
    [SRCategory("Designer")]
    public event FilterConnectionTablesEventHandler FilterConnectionTables
    Event Type
    Type Description
    FilterConnectionTablesEventHandler
    Remarks

    Use this handler to filter the list of tables returned by the connection object.

    Examples

    This example demonstrates how to hide the table with "Table 1" name from the Data Wizard.

    environmentSettings1.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
    
    private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
    {
      if (e.TableName == "Table 1")
        e.Skip = true;
    }

    FinishProgress

    Occurs after closing a progress window.

    Declaration
    [SRCategory("Report")]
    public event EventHandler FinishProgress
    Event Type
    Type Description
    System.EventHandler

    GetBusinessObjectPropertyKind

    Occurs when determining the kind of business object's property.

    Declaration
    [SRCategory("Report")]
    public event GetPropertyKindEventHandler GetBusinessObjectPropertyKind
    Event Type
    Type Description
    GetPropertyKindEventHandler

    ObjectInserted

    Occurs when object is inserted in the designer.

    Declaration
    [SRCategory("Designer")]
    public event ObjectInsertedEventHandler ObjectInserted
    Event Type
    Type Description
    ObjectInsertedEventHandler
    Remarks

    Use this event handler to set some object's properties when it is inserted.

    Progress

    Occurs when progress state is changed.

    Declaration
    [SRCategory("Report")]
    public event ProgressEventHandler Progress
    Event Type
    Type Description
    ProgressEventHandler

    ReportLoaded

    Occurs when report is loaded in the designer.

    Declaration
    [SRCategory("Designer")]
    public event ReportLoadedEventHandler ReportLoaded
    Event Type
    Type Description
    ReportLoadedEventHandler
    Remarks

    Use this event handler to register application data in a report.

    StartProgress

    Occurs before displaying a progress window.

    Declaration
    [SRCategory("Report")]
    public event EventHandler StartProgress
    Event Type
    Type Description
    System.EventHandler
    Back to top © 1998-2025 Copyright Fast Reports Inc.