using System.ComponentModel;
using FastReport.Data;
using FastReport.Utils;
namespace FastReport
{
///
/// Specifies the default paper size used when creating a new report.
///
public enum DefaultPaperSize
{
///
/// A4 paper (210 x 297 mm).
///
A4,
///
/// Letter paper (8.5 x 11 inches, 216 x 279 mm).
///
Letter
}
///
/// This class contains settings that will be applied to the Report component.
///
[TypeConverter(typeof(FastReport.TypeConverters.FRExpandableObjectConverter))]
public partial class ReportSettings
{
private Language defaultLanguage;
private DefaultPaperSize defaultPaperSize;
private bool usePropValuesToDiscoverBO;
private string imageLocationRoot;
///
public event DatabaseLoginEventHandler DatabaseLogin;
///
/// Occurs after the database connection is established.
///
public event AfterDatabaseLoginEventHandler AfterDatabaseLogin;
///
/// Occurs when discovering the business object's structure.
///
public event FilterPropertiesEventHandler FilterBusinessObjectProperties;
///
/// Occurs when determining the kind of business object's property.
///
public event GetPropertyKindEventHandler GetBusinessObjectPropertyKind;
///
/// Occurs when discovering the structure of business object of ICustomTypeDescriptor type
/// with no instance specified.
///
///
/// The event handler must return an instance of that type.
///
public event GetTypeInstanceEventHandler GetBusinessObjectTypeInstance;
///
/// Gets or sets the default script language.
///
[DefaultValue(Language.CSharp)]
public Language DefaultLanguage
{
get { return defaultLanguage; }
set { defaultLanguage = value; }
}
///
/// Gets or sets the default paper size used when creating a new report.
///
[DefaultValue(DefaultPaperSize.A4)]
public DefaultPaperSize DefaultPaperSize
{
get { return defaultPaperSize; }
set { defaultPaperSize = value; }
}
///
/// Gets or sets a value indicating that the business object engine will use property values
/// when possible to discover the BO structure.
///
[DefaultValue(true)]
public bool UsePropValuesToDiscoverBO
{
get { return usePropValuesToDiscoverBO; }
set { usePropValuesToDiscoverBO = value; }
}
///
/// Gets or sets the default path for root of PictureObject.ImageLocation path.
///
[DefaultValue("")]
public string ImageLocationRoot
{
get { return imageLocationRoot; }
set { imageLocationRoot = value; }
}
internal void OnAfterDatabaseLogin(DataConnectionBase sender, AfterDatabaseLoginEventArgs e)
{
if (AfterDatabaseLogin != null)
AfterDatabaseLogin(sender, e);
}
internal void OnFilterBusinessObjectProperties(object sender, FilterPropertiesEventArgs e)
{
if (FilterBusinessObjectProperties != null)
FilterBusinessObjectProperties(sender, e);
}
internal void OnGetBusinessObjectPropertyKind(object sender, GetPropertyKindEventArgs e)
{
if (GetBusinessObjectPropertyKind != null)
GetBusinessObjectPropertyKind(sender, e);
}
internal void OnGetBusinessObjectTypeInstance(object sender, GetTypeInstanceEventArgs e)
{
if (GetBusinessObjectTypeInstance != null)
GetBusinessObjectTypeInstance(sender, e);
}
///
/// Initializes a new instance of the class.
///
public ReportSettings()
{
usePropValuesToDiscoverBO = true;
}
}
}