using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace UniverseReport
{
public enum PrintPageDisplay { PRINT, PREVIEW };
public enum ReportType { GeneralList, CardList, Hierachy, FreeForm, MultipleTables, None };
public enum PrintHeading { No, OnFirstPage, OnAllPages };
public enum PrintReportDateLocation { None, LeftTop, RightTop, LeftBottom, RightBottom };
[Serializable()]
[TypeConverter(typeof(CellFormatConverter))]
public class ReportSettings
{
[NonSerializedAttribute]
Pen summaryLinePen = new Pen(Color.Black, 1);
//Used for all painting. They are created here so that I don't have to
//waste time creating them again in this procedure
[NonSerializedAttribute]
SolidBrush myBrush = null;
[NonSerializedAttribute]
Pen linePen = null;
private GraphicsUnit graphicsUnit = GraphicsUnit.Inch;
private Font headerFont = new Font("Tahoma", 15, FontStyle.Bold);
private Font subHeaderFont = new Font("Tahoma", 9.75f, FontStyle.Regular);
private Font subscriptFont = new Font("Tahoma", 8.25f, FontStyle.Regular);
private Font summaryLineFont = new Font("Tahoma", 8.25f, FontStyle.Bold);
private Font reportNameFont = new Font("Tahoma", 11.75f, FontStyle.Bold | FontStyle.Italic);
private PrintHeading printHeading = PrintHeading.OnFirstPage;
private PrintReportDateLocation printDateLocation = PrintReportDateLocation.RightTop;
private bool printTotalRecords = false;
private string totalText = String.Empty;
private bool outlineTable = true;
private bool printTableGrid = false;
private bool colorAlternateRows = false;
private Color alternateRowColor = Color.FromArgb(192, 192, 255);
private Color alternateRowTextColor = Color.Navy;
private Header header = new Header();
private bool printPageNumbers = true;
private string sumText = "Total:";
private string averageText = "Average:";
private string countText = "Count:";
private string maximumText = "Max:";
private string minimumText = "Min:";
private string nullValue = "";
private bool useTableInFreeForm = false;
private LineInfo rowSeparatorLine = new LineInfo();
private bool printRowSeparator = true;
private ReportType reportType = ReportType.GeneralList;
private int groupIndentSpace = 0;
private string calculatedField = String.Empty;
#region Properties
[DefaultValue("")]
public string CalculatedField
{
get { return calculatedField; }
set { calculatedField = value; }
}
[Category("Free Form Report"), DefaultValue(false)]
public bool UseTableInFreeForm
{
get { return useTableInFreeForm; }
set { useTableInFreeForm = value; }
}
public Pen SummaryLinePen
{
get { return summaryLinePen; }
set { summaryLinePen = value; }
}
internal SolidBrush MyBrush
{
get { return myBrush; }
set { myBrush = value; }
}
internal Pen LinePen
{
get { return linePen; }
set { linePen = value; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Category("Appearance")]
public LineInfo RowSeparatorLine
{
get { return rowSeparatorLine; }
set { rowSeparatorLine = value; }
}
[Category("General"), DefaultValue(PrintReportDateLocation.RightTop)]
public PrintReportDateLocation ReportDate
{
get { return printDateLocation; }
set { printDateLocation = value; }
}
[Category("Summary"), DefaultValue("Total:")]
public string SumText
{
get { return sumText; }
set { sumText = value; }
}
[Category("Summary"), DefaultValue("Average:")]
public string AverageText
{
get { return averageText; }
set { averageText = value; }
}
[Category("Summary"), DefaultValue("Count:")]
public string CountText
{
get { return countText; }
set { countText = value; }
}
[Category("Summary"), DefaultValue("Max:")]
public string MaximumText
{
get { return maximumText; }
set { maximumText = value; }
}
[Category("Summary"), DefaultValue("Min:")]
public string MinimumText
{
get { return minimumText; }
set { minimumText = value; }
}
[Category("Summary"), DefaultValue("Min:")]
public string TotalText
{
get { return totalText; }
set { totalText = value; }
}
[Category("Appearance"), DefaultValue(false)]
public bool PrintTotalRecords
{
get { return printTotalRecords; }
set { printTotalRecords = value; }
}
[Category("Appearance"), DefaultValue(false)]
public int GroupIndentSpace
{
get { return groupIndentSpace; }
set { groupIndentSpace = value; }
}
[Category("Appearance"), DefaultValue(false)]
public bool OutlineTable
{
get { return outlineTable; }
set { outlineTable = value; }
}
[Category("Appearance"), DefaultValue(typeof(Color), "White")]
public Color AlternateRowColor
{
get { return alternateRowColor; }
set { alternateRowColor = value; }
}
[Category("Appearance"), DefaultValue(typeof(Color), "White")]
public Color AlternateRowTextColor
{
get { return alternateRowTextColor; }
set { alternateRowTextColor = value; }
}
[Category("Appearance"), DefaultValue(false)]
public bool ColorAlternateRows
{
get { return colorAlternateRows; }
set { colorAlternateRows = value; }
}
[Category("Appearance"), DefaultValue(false)]
public bool PrintTableGrid
{
get { return printTableGrid; }
set { printTableGrid = value; }
}
[Category("Appearance"), DefaultValue(false)]
public bool PrintPageNumbers
{
get { return printPageNumbers; }
set { printPageNumbers = value; }
}
[Category("Data"), DefaultValue("")]
public string NullValue
{
get { return nullValue; }
set { nullValue = value; }
}
[Category("Appearance"), DefaultValue(false)]
public bool PrintRowSeparator
{
get { return printRowSeparator; }
set { printRowSeparator = value; }
}
[Category("General"), DefaultValue("")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Header Header
{
get { return header; }
set { header = value; }
}
[Category("Appearance"), DefaultValue(typeof(Font), "Tahoma,9.75f")]
public Font SubscriptFont
{
get { return subscriptFont; }
set { subscriptFont = value; }
}
[Category("Appearance"), DefaultValue(typeof(Font), "Tahoma,8.25f")]
public Font SummaryLineFont
{
get { return summaryLineFont; }
set { summaryLineFont = value; }
}
[Category("Appearance"), DefaultValue(typeof(Font), "Tahoma,12")]
public Font ReportNameFont
{
get { return reportNameFont; }
set { reportNameFont = value; }
}
[Category("Appearance"), DefaultValue(typeof(Font), "Tahoma,15")]
public Font HeaderFont
{
get { return headerFont; }
set { headerFont = value; }
}
[Category("Appearance"), DefaultValue(typeof(Font), "Tahoma,10")]
public Font SubHeaderFont
{
get { return subHeaderFont; }
set { subHeaderFont = value; }
}
[Category("Appearance"), DefaultValue(PrintHeading.OnFirstPage)]
public PrintHeading PrintHeading
{
get { return printHeading; }
set { printHeading = value; }
}
[Category("General"), DefaultValue(ReportType.GeneralList)]
public ReportType ReportType
{
get { return reportType; }
set { reportType = value; }
}
[Browsable(false)]
public GraphicsUnit GraphicsUnit
{
get { return graphicsUnit; }
set { graphicsUnit = value; }
}
#endregion
}
}