Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2005 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
205 changed files with 7 additions and 26728 deletions
@ -1,100 +0,0 @@
@@ -1,100 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00 |
||||
# SharpDevelop 2.1.0.1997 |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportCore", "SharpReportCore\SharpReportCore.csproj", "{4B2239FF-8FD6-431D-9D22-1B8049BA6917}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReport", "SharpReport\SharpReport.csproj", "{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportAddin", "SharpReportAddin\SharpReportAddin.csproj", "{35D002D7-C78B-44FB-92AA-104BEB431678}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportGenerator", "SharpReportWizard\ReportGenerator.csproj", "{0F784A65-33B4-43EB-A49A-50A15EEF9829}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpQuery", "..\SharpQuery\SharpQuery.csproj", "{BDD03ECD-42AE-4B50-9805-9C19090A264F}" |
||||
EndProject |
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Referenced Projects", "Referenced Projects", "{F19360E1-EDF0-44E4-AA2A-742BC91FF230}" |
||||
ProjectSection(SolutionItems) = postProject |
||||
EndProjectSection |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\..\Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}" |
||||
EndProject |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Widgets", "..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj", "{8035765F-D51F-4A0C-A746-2FD100E19419}" |
||||
EndProject |
||||
Global |
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||
Debug|Any CPU = Debug|Any CPU |
||||
Release|Any CPU = Release|Any CPU |
||||
EndGlobalSection |
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||
{32DAA444-1A60-4D28-8DFB-249A4375888B}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{32DAA444-1A60-4D28-8DFB-249A4375888B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{32DAA444-1A60-4D28-8DFB-249A4375888B}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{32DAA444-1A60-4D28-8DFB-249A4375888B}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{4B2239FF-8FD6-431D-9D22-1B8049BA6917}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{35D002D7-C78B-44FB-92AA-104BEB431678}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{35D002D7-C78B-44FB-92AA-104BEB431678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{35D002D7-C78B-44FB-92AA-104BEB431678}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{35D002D7-C78B-44FB-92AA-104BEB431678}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{0F784A65-33B4-43EB-A49A-50A15EEF9829}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{0F784A65-33B4-43EB-A49A-50A15EEF9829}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{0F784A65-33B4-43EB-A49A-50A15EEF9829}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{0F784A65-33B4-43EB-A49A-50A15EEF9829}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{E2FEB73B-9F82-49C8-A040-E5F5539D585D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{E2FEB73B-9F82-49C8-A040-E5F5539D585D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{E2FEB73B-9F82-49C8-A040-E5F5539D585D}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{E2FEB73B-9F82-49C8-A040-E5F5539D585D}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{CBE6D1DD-7485-4A77-BF6B-E05858CA6315}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{CBE6D1DD-7485-4A77-BF6B-E05858CA6315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{CBE6D1DD-7485-4A77-BF6B-E05858CA6315}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{CBE6D1DD-7485-4A77-BF6B-E05858CA6315}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{BDD03ECD-42AE-4B50-9805-9C19090A264F}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|Any CPU.Build.0 = Release|Any CPU |
||||
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||
EndGlobalSection |
||||
GlobalSection(NestedProjects) = preSolution |
||||
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} = {F19360E1-EDF0-44E4-AA2A-742BC91FF230} |
||||
{2748AD25-9C63-4E12-877B-4DCE96FBED54} = {F19360E1-EDF0-44E4-AA2A-742BC91FF230} |
||||
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} = {F19360E1-EDF0-44E4-AA2A-742BC91FF230} |
||||
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195} = {F19360E1-EDF0-44E4-AA2A-742BC91FF230} |
||||
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} = {F19360E1-EDF0-44E4-AA2A-742BC91FF230} |
||||
EndGlobalSection |
||||
EndGlobal |
@ -1,266 +0,0 @@
@@ -1,266 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Drawing; |
||||
|
||||
using ICSharpCode.Core; |
||||
using SharpReport.ReportItems; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This Class creates a Report based on the DataSource selected in the Wizard
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.12.2004 13:56:07
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReport { |
||||
public class AutoReport : object,IDisposable { |
||||
|
||||
SharpReport.Designer.IDesignableFactory iDesignableFactory; |
||||
|
||||
public AutoReport() { |
||||
iDesignableFactory = new SharpReport.Designer.IDesignableFactory(); |
||||
} |
||||
|
||||
|
||||
#region Build ReportItemsCollection
|
||||
|
||||
/// <summary>
|
||||
/// Build BaseDataItems from a schemaDataTable
|
||||
/// </summary>
|
||||
/// <param name="model">a valid ReportModel</param>
|
||||
/// <param name="schemaTable">SchemaDefinition Datatable</param>
|
||||
/// <returns>Collection of BaseDataItems</returns>
|
||||
|
||||
public ReportItemCollection DataItemsFromTable (ReportModel model,DataTable schemaTable) { |
||||
ReportItemCollection itemCol = new ReportItemCollection(); |
||||
|
||||
for (int i = 0;i < schemaTable.Rows.Count;i++){ |
||||
DataRow r = schemaTable.Rows[i]; |
||||
ReportDataItem rItem = new ReportDataItem(); |
||||
rItem.ColumnName = r["ColumnName"].ToString(); |
||||
rItem.BaseTableName = r["BaseTableName"].ToString(); |
||||
rItem.Text = rItem.ColumnName; |
||||
rItem.DataType = r["DataType"].ToString(); |
||||
rItem.Location = new Point (i * 30,5); |
||||
itemCol.Add (rItem); |
||||
} |
||||
return itemCol; |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Build BaseDataItems from a *.xsd (Schema) File
|
||||
/// </summary>
|
||||
/// <param name="model">a valid ReportModel</param>
|
||||
/// <param name="dataSet">DataSet from *.xsd File</param>
|
||||
/// <returns> Collection of BaseDataItems</returns>
|
||||
|
||||
public ReportItemCollection DataItemsFromSchema (ReportModel model,DataSet dataSet) { |
||||
if (dataSet.Tables.Count > 1) { |
||||
MessageService.ShowError ("AutoBuildFromDataSet : at this time no more than one table is allowed " + dataSet.Tables.Count.ToString()); |
||||
throw new ArgumentException ("Too much Tables in DataSet"); |
||||
} |
||||
|
||||
ReportItemCollection itemCol = new ReportItemCollection(); |
||||
foreach (DataTable tbl in dataSet.Tables) { |
||||
DataColumn col; |
||||
for (int i = 0;i < tbl.Columns.Count ;i++ ) { |
||||
col = tbl.Columns[i]; |
||||
ReportDataItem rItem = new ReportDataItem(); |
||||
rItem.ColumnName = col.ColumnName; |
||||
rItem.DbValue = col.ColumnName; |
||||
rItem.BaseTableName = tbl.TableName; |
||||
rItem.DataType = col.DataType.ToString(); |
||||
rItem.Location = new Point (i * 30,5); |
||||
itemCol.Add (rItem); |
||||
} |
||||
} |
||||
return itemCol; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Build report's
|
||||
|
||||
///<summary>
|
||||
/// Build a <see cref="ColumnCollection"></see> this collection holds all the fields
|
||||
/// comming from the DataSource
|
||||
///</summary>
|
||||
|
||||
public ColumnCollection AbstractColumnsFromDataSet(DataSet dataSet) { |
||||
if (dataSet.Tables.Count > 1) { |
||||
MessageService.ShowError ("AutoBuildFromDataSet : at this time no more than one table is allowed " + dataSet.Tables.Count.ToString()); |
||||
throw new ArgumentException ("Too much Tables in DataSet"); |
||||
} |
||||
|
||||
ColumnCollection collection = new ColumnCollection(); |
||||
foreach (DataTable tbl in dataSet.Tables) { |
||||
DataColumn col; |
||||
for (int i = 0;i < tbl.Columns.Count ;i++ ) { |
||||
col = tbl.Columns[i]; |
||||
AbstractColumn abstrColumn = new AbstractColumn(); |
||||
abstrColumn.ColumnName = col.ColumnName; |
||||
abstrColumn.DataType = col.DataType; |
||||
collection.Add (abstrColumn); |
||||
} |
||||
} |
||||
return collection; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
public ReportItemCollection AutoDataColumns(ReportItemCollection col) { |
||||
if (col != null) { |
||||
ReportItemCollection itemCol = new ReportItemCollection(); |
||||
ReportDataItem sourceItem = null; |
||||
for (int i = 0;i < col.Count ;i++ ){ |
||||
ReportDataItem destItem = new ReportDataItem(); |
||||
sourceItem = (ReportDataItem)col[i]; |
||||
|
||||
destItem.VisualControl.Text = sourceItem.ColumnName; |
||||
destItem.ColumnName = sourceItem.ColumnName; |
||||
destItem.DbValue = sourceItem.DbValue; |
||||
destItem.BaseTableName = sourceItem.BaseTableName; |
||||
destItem.DataType = sourceItem.DataType; |
||||
destItem.Location = new Point (i * 30,5); |
||||
itemCol.Add(destItem); |
||||
} |
||||
return itemCol; |
||||
} else { |
||||
throw new ArgumentNullException ("AutoReport:ReportItemCollection"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region HeaderColumns
|
||||
/// <summary>
|
||||
/// Build Headerline from a schemaDataTable
|
||||
/// </summary>
|
||||
/// <param name="model">the ReportModel</param>
|
||||
/// <param name="section">location of the Headerlines</param>
|
||||
/// <param name="schemaTable">the Schematable with ColumnInrofmations</param>
|
||||
/// <param name="setOnTop">Locate the Columns of Top or an Bottom of the Section</param>
|
||||
/// <returns>a Collection of BaseTextItems</returns>
|
||||
|
||||
public ReportItemCollection HeaderColumnsFromTable (BaseSection section,DataTable schemaTable,bool setOnTop) { |
||||
ReportItemCollection itemCol = new ReportItemCollection(); |
||||
for (int i = 0;i < schemaTable.Rows.Count;i++){ |
||||
DataRow r = schemaTable.Rows[i]; |
||||
BaseTextItem rItem = (BaseTextItem)iDesignableFactory.Create("ReportTextItem"); |
||||
if (rItem != null) { |
||||
rItem.Text = r["ColumnName"].ToString(); |
||||
if (setOnTop) { |
||||
rItem.Location = new Point (i * 30,1); |
||||
} else { |
||||
int y = section.Size.Height - rItem.Size.Height - 5; |
||||
rItem.Location = new Point (i * 30,y); |
||||
} |
||||
itemCol.Add (rItem); |
||||
} else { |
||||
throw new ArgumentException("AutoHeaderfromTable : Unable to create ReporttextItem"); |
||||
} |
||||
} |
||||
return itemCol; |
||||
} |
||||
|
||||
|
||||
public ReportItemCollection HeaderColumnsFromReportItems(ReportItemCollection reportItemCollection,BaseSection section,bool setOnTop) { |
||||
if (reportItemCollection == null) { |
||||
throw new ArgumentNullException ("reportItemCollection"); |
||||
} |
||||
if (section == null) { |
||||
throw new ArgumentNullException ("section"); |
||||
} |
||||
|
||||
ReportItemCollection itemCol = new ReportItemCollection(); |
||||
ReportDataItem sourceItem = null; |
||||
for (int i = 0;i < reportItemCollection.Count ;i++ ){ |
||||
BaseTextItem rItem = (BaseTextItem)iDesignableFactory.Create("ReportTextItem"); |
||||
if (rItem != null) { |
||||
sourceItem = (ReportDataItem)reportItemCollection[i]; |
||||
|
||||
rItem.Text = sourceItem.ColumnName; |
||||
rItem.Text = sourceItem.ColumnName; |
||||
if (setOnTop) { |
||||
rItem.Location = new Point (i * 30,1); |
||||
} else { |
||||
int y = section.Size.Height - rItem.Size.Height - 5; |
||||
rItem.Location = new Point (i * 30,y); |
||||
} |
||||
itemCol.Add(rItem); |
||||
} |
||||
} |
||||
return itemCol; |
||||
} |
||||
|
||||
#endregion
|
||||
/* |
||||
#region Standarts for all reports (Headlines etc)
|
||||
|
||||
/// <summary>
|
||||
/// Insert a <see cref="ReportTextItem"></see> in the PageHeader with
|
||||
/// the <see cref="ReportModel.ReportSettings.ReportName"></see> as
|
||||
/// text
|
||||
/// </summary>
|
||||
/// <param name="model">ReportModel</param>
|
||||
public void CreatePageHeader (ReportModel model) { |
||||
BaseSection section = model.PageHeader; |
||||
section.SuspendLayout(); |
||||
SharpReport.Designer.IDesignableFactory gf = new SharpReport.Designer.IDesignableFactory(); |
||||
BaseTextItem item = (BaseTextItem)gf.Create ("ReportTextItem"); |
||||
item.SuspendLayout(); |
||||
item.Text = model.ReportSettings.ReportName; |
||||
item.Font = CopyFont(model.ReportSettings.DefaultFont); |
||||
item.Location = new Point (0,0); |
||||
item.Size = new Size (item.Size.Width,item.Font.Height + SharpReportCore.GlobalValues.EnlargeControl); |
||||
section.Items.Add (item); |
||||
item.ResumeLayout(); |
||||
section.ResumeLayout(); |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Insert Function 'PageNumber' in Section PageFooter
|
||||
/// </summary>
|
||||
/// <param name="model">ReportModel</param>
|
||||
|
||||
public void CreatePageNumber (ReportModel model) { |
||||
BaseSection section = model.PageFooter; |
||||
section.SuspendLayout(); |
||||
FunctionFactory gf = new FunctionFactory(); |
||||
PageNumber pageNumber = (PageNumber)gf.Create ("PageNumber"); |
||||
pageNumber.SuspendLayout(); |
||||
|
||||
pageNumber.Text = ResourceService.GetString("SharpReport.Toolbar.Functions.PageNumber"); |
||||
pageNumber.Location = new Point (0,0); |
||||
section.Items.Add(pageNumber); |
||||
pageNumber.ResumeLayout(); |
||||
section.ResumeLayout(); |
||||
} |
||||
|
||||
#endregion
|
||||
*/ |
||||
|
||||
|
||||
|
||||
#region System.IDisposable interface implementation
|
||||
public void Dispose() { |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
||||
|
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
using System.Reflection; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
@ -1,57 +0,0 @@
@@ -1,57 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// Factories used by the Designer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 18.07.2005 23:12:24
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReport.Designer { |
||||
|
||||
public class FunctionFactory : SharpReportCore.GenericFactory { |
||||
|
||||
public FunctionFactory () :base(Assembly.GetExecutingAssembly(),typeof(BaseFunction)){ |
||||
|
||||
} |
||||
|
||||
public new BaseFunction Create(string name) { |
||||
return (BaseFunction) base.Create(name); |
||||
} |
||||
} |
||||
|
||||
public class IDesignableFactory : SharpReportCore.GenericFactory { |
||||
|
||||
public IDesignableFactory() :base(Assembly.GetExecutingAssembly(), |
||||
typeof(IDesignable)){ |
||||
} |
||||
|
||||
public new BaseReportItem Create(string name) { |
||||
if (String.IsNullOrEmpty(name)) { |
||||
throw new ArgumentNullException("name"); |
||||
} |
||||
if (name.LastIndexOf('.') > 0) { |
||||
StringBuilder b = new StringBuilder (name); |
||||
b.Remove (0,name.LastIndexOf('.') +1); |
||||
name = b.ToString(); |
||||
} |
||||
return (BaseReportItem) base.Create (name); |
||||
} |
||||
} |
||||
} |
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 22.08.2005 |
||||
* Time: 23:19 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Drawing; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Section Interface
|
||||
/// </summary>
|
||||
public interface IDesignable { |
||||
object Parent{ |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
Point Location { |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
string Name { |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
Size Size { |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
|
||||
ReportObjectControlBase VisualControl { |
||||
get; |
||||
} |
||||
|
||||
event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; |
||||
event EventHandler <EventArgs> Selected; |
||||
} |
||||
} |
@ -1,88 +0,0 @@
@@ -1,88 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// Build a proper (unique) Names for all added Item's
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 27.08.2005 16:21:50
|
||||
/// </remarks>
|
||||
namespace SharpReport { |
||||
public class NameService : System.ComponentModel.Design.Serialization.INameCreationService { |
||||
|
||||
/// <summary>
|
||||
/// Default constructor - initializes all fields to default values
|
||||
/// </summary>
|
||||
public NameService() { |
||||
} |
||||
|
||||
#region Customs implementation
|
||||
|
||||
public string CreateName (ReportItemCollection collection, |
||||
string typeName) { |
||||
|
||||
if (String.IsNullOrEmpty(typeName)) { |
||||
throw new ArgumentNullException("typeName"); |
||||
} |
||||
|
||||
string name = Char.ToLower(typeName[0], |
||||
CultureInfo.InvariantCulture) + typeName.Substring(1); |
||||
int number = 1; |
||||
|
||||
while (collection.Find(name + number.ToString(CultureInfo.InvariantCulture)) != null) { |
||||
++number; |
||||
} |
||||
return name + number.ToString(); |
||||
} |
||||
|
||||
|
||||
public bool IsValidName(ReportItemCollection collection, |
||||
string name) { |
||||
if (name == null || name.Length == 0 || !(Char.IsLetter(name[0]) || name[0] == '_')) { |
||||
return false; |
||||
} |
||||
IItemRenderer ii= collection.Find(name); |
||||
if (ii != null) { |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
public void ValidateName(ReportItemCollection collection, |
||||
string name) { |
||||
if (!IsValidName(collection,name)) { |
||||
throw new SharpReportException("Invalid name " + name); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region System.ComponentModel.Design.Serialization.INameCreationService interface implementation
|
||||
public void ValidateName(string name) { |
||||
throw new NotImplementedException("Name Service No Designersupport"); |
||||
} |
||||
|
||||
public bool IsValidName(string name) { |
||||
throw new NotImplementedException("Name Service No Designersupport"); |
||||
} |
||||
|
||||
|
||||
|
||||
public string CreateName(System.ComponentModel.IContainer container, System.Type dataType) { |
||||
throw new NotImplementedException("Name Service No Designersupport"); |
||||
} |
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,479 +0,0 @@
@@ -1,479 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* Date: 09/10/2004 |
||||
* Time: 9.12 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of Report1.
|
||||
/// </summary>
|
||||
public class Report : System.Windows.Forms.UserControl |
||||
{ |
||||
private SharpReport.Designer.ReportHeader visualReportHeader; |
||||
private SharpReport.Designer.ReportPageHeader visualPageHeader; |
||||
private SharpReport.Designer.ReportFooter visualFooter; |
||||
private SharpReport.Designer.ReportPageFooter visualPageFooter; |
||||
private SharpReport.Designer.ReportDetail visualDetail; |
||||
|
||||
|
||||
|
||||
// Generic selected object in report
|
||||
private IBaseRenderer selectedObject; |
||||
|
||||
// Section selected in report
|
||||
private ReportSection selectedSection; |
||||
|
||||
private ReportSection header; |
||||
private ReportSection pageHeader; |
||||
private ReportSection detail; |
||||
private ReportSection footer; |
||||
private ReportSection pageFooter; |
||||
|
||||
private ReportSectionCollection sectionCollection; |
||||
|
||||
private ReportSettings reportSettings; |
||||
|
||||
private NameService nameService; |
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Always), Browsable(true)] |
||||
|
||||
|
||||
public event EventHandler <EventArgs> ObjectSelected; |
||||
public event EventHandler <SectionChangedEventArgs> SectionChanged; |
||||
public event ItemDragDropEventHandler DesignViewChanged; |
||||
|
||||
public Report(){ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
InitSectionCollection(); |
||||
Localise(); |
||||
this.nameService = new NameService(); |
||||
} |
||||
|
||||
public void Localise() { |
||||
this.visualReportHeader.Caption = ResourceService.GetString("SharpReport.Designer.ReportHeader"); |
||||
this.visualPageHeader.Caption = ResourceService.GetString("SharpReport.Designer.PageHeader"); |
||||
this.visualDetail.Caption = ResourceService.GetString("SharpReport.Designer.DetailSection"); |
||||
this.visualPageFooter.Caption = ResourceService.GetString("SharpReport.Designer.PageFooter"); |
||||
this.visualFooter.Caption = ResourceService.GetString("SharpReport.Designer.ReportFooter"); |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing) { |
||||
if( disposing ){ |
||||
|
||||
} |
||||
this.visualReportHeader.Dispose(); |
||||
this.visualPageHeader.Dispose(); |
||||
this.visualDetail.Dispose(); |
||||
this.visualPageFooter.Dispose(); |
||||
this.visualFooter.Dispose(); |
||||
|
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
private void SetDefaultValues() { |
||||
foreach (BaseSection sec in this.sectionCollection) { |
||||
sec.SectionMargin = this.reportSettings.DefaultMargins.Left; |
||||
sec.Parent = null; |
||||
} |
||||
} |
||||
|
||||
private void InitSectionCollection () { |
||||
sectionCollection = new ReportSectionCollection(); |
||||
header = new ReportSection( visualReportHeader); |
||||
pageHeader = new ReportSection(visualPageHeader); |
||||
detail = new ReportSection(visualDetail); |
||||
pageFooter = new ReportSection(visualPageFooter); |
||||
footer = new ReportSection(visualFooter); |
||||
|
||||
header.Name = header.VisualControl.GetType().Name; |
||||
pageHeader.Name = pageHeader.VisualControl.GetType().Name; |
||||
detail.Name = detail.VisualControl.GetType().Name; |
||||
footer.Name = footer.VisualControl.GetType().Name; |
||||
pageFooter.Name = pageFooter.VisualControl.GetType().Name; |
||||
|
||||
sectionCollection.Add(header); |
||||
sectionCollection.Add(pageHeader); |
||||
sectionCollection.Add(detail); |
||||
sectionCollection.Add(pageFooter); |
||||
sectionCollection.Add(footer); |
||||
|
||||
header.Selected += new EventHandler <EventArgs>(this.SectionSelected); |
||||
pageHeader.Selected += new EventHandler <EventArgs>(this.SectionSelected); |
||||
detail.Selected += new EventHandler <EventArgs>(this.SectionSelected); |
||||
footer.Selected += new EventHandler <EventArgs>(this.SectionSelected); |
||||
pageFooter.Selected += new EventHandler <EventArgs>(this.SectionSelected); |
||||
|
||||
header.ItemSelected += new EventHandler <EventArgs>(this.ItemSelected); |
||||
pageHeader.ItemSelected += new EventHandler <EventArgs>(this.ItemSelected); |
||||
detail.ItemSelected += new EventHandler <EventArgs>(this.ItemSelected); |
||||
footer.ItemSelected += new EventHandler <EventArgs>(this.ItemSelected); |
||||
pageFooter.ItemSelected += new EventHandler <EventArgs>(this.ItemSelected); |
||||
|
||||
//This events are from DragDropp
|
||||
visualReportHeader.ReportItemsHandling += new ItemDragDropEventHandler (OnAddReportItem); |
||||
visualPageHeader.ReportItemsHandling += new ItemDragDropEventHandler (OnAddReportItem); |
||||
visualDetail.ReportItemsHandling += new ItemDragDropEventHandler (OnAddReportItem); |
||||
visualPageFooter.ReportItemsHandling += new ItemDragDropEventHandler (OnAddReportItem); |
||||
visualFooter.ReportItemsHandling += new ItemDragDropEventHandler (OnAddReportItem); |
||||
} |
||||
|
||||
private Rectangle SectionClientArea (SharpReport.Designer.ReportSectionControlBase ctrl) { |
||||
Rectangle rect = new Rectangle(); |
||||
rect.X = ctrl.Location.X; |
||||
rect.Y = ctrl.Location.Y + ctrl.Head.Height; |
||||
rect.Width = ctrl.Width; |
||||
rect.Height = ctrl.Body.Height; |
||||
return rect; |
||||
} |
||||
|
||||
private void SetParent(BaseReportItem child,Point pointOf) { |
||||
foreach (BaseReportItem i in this.SelectedSection.Items) { |
||||
Rectangle r = new Rectangle (i.Location,i.Size); |
||||
if (r.Contains(pointOf)) { |
||||
child.Parent = i as IContainerItem; |
||||
return; |
||||
} |
||||
} |
||||
child.Parent = this.SelectedSection; |
||||
} |
||||
|
||||
|
||||
private IContainerItem FindParent(ItemDragDropEventArgs iddea) { |
||||
foreach (BaseReportItem i in this.SelectedSection.Items) { |
||||
Rectangle r = new Rectangle (i.Location,i.Size); |
||||
if (r.Contains(iddea.ItemAtPoint)) { |
||||
return i as IContainerItem; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
private BaseReportItem BuildDraggedItem (ItemDragDropEventArgs iddea) { |
||||
GlobalEnums.ReportItemType rptType = (GlobalEnums.ReportItemType) |
||||
GlobalEnums.StringToEnum(typeof(GlobalEnums.ReportItemType),iddea.ItemName); |
||||
|
||||
SharpReport.Designer.IDesignableFactory gf = new SharpReport.Designer.IDesignableFactory(); |
||||
return gf.Create (rptType.ToString()); |
||||
} |
||||
|
||||
private void CustomizeItem ( ItemDragDropEventArgs iddea, |
||||
ReportItemCollection itemCollection, |
||||
BaseReportItem baseReportItem) { |
||||
System.Console.WriteLine("Report:CustomizeItem"); |
||||
// GlobalEnums.ReportItemType rptType = (GlobalEnums.ReportItemType)
|
||||
// GlobalEnums.StringToEnum(typeof(GlobalEnums.ReportItemType),iddea.ItemName);
|
||||
|
||||
baseReportItem.Name = nameService.CreateName(itemCollection, |
||||
baseReportItem.Name); |
||||
|
||||
baseReportItem.Font = this.reportSettings.DefaultFont; |
||||
|
||||
IContainerItem ic = baseReportItem as IContainerItem; |
||||
|
||||
if (ic != null) { |
||||
ic.Padding = this.reportSettings.Padding; |
||||
System.Console.WriteLine("CustomizeItem: Padding set to {0}",ic.Padding); |
||||
// System.Console.WriteLine("1)item size = {0}",baseReportItem.Size);
|
||||
// baseReportItem.Size = new Size(baseReportItem.Size.Width,
|
||||
// ic.Padding.Top + ic.Padding.Bottom + baseReportItem.Font.Height + 2);
|
||||
//
|
||||
// System.Console.WriteLine("2)item size = {0}",baseReportItem.Size);
|
||||
} |
||||
|
||||
if (baseReportItem.Parent == this.selectedSection) { |
||||
baseReportItem.Location = new Point(iddea.ItemAtPoint.X,iddea.ItemAtPoint.Y); |
||||
} else { |
||||
BaseReportItem br = (BaseReportItem)this.FindParent(iddea); |
||||
baseReportItem.Location = new Point(iddea.ItemAtPoint.X - br.Location.X,10); |
||||
} |
||||
baseReportItem.ResumeLayout(); |
||||
} |
||||
|
||||
|
||||
private void AdjustDesignable (BaseReportItem item) { |
||||
IDesignable designable = item as IDesignable; |
||||
designable.VisualControl.Name = item.Name; |
||||
} |
||||
|
||||
|
||||
private void SetVisualControl (BaseReportItem item){ |
||||
Control ctrl = null; |
||||
if (item.Parent == null) { |
||||
ctrl = this.selectedSection.VisualControl.Body; |
||||
} else { |
||||
if (item.Parent is ReportControlBase) { |
||||
ReportControlBase rb = item.Parent as ReportControlBase; |
||||
ctrl = rb.Body; |
||||
} |
||||
} |
||||
|
||||
if (ctrl != null) { |
||||
IDesignable designable = item as IDesignable; |
||||
if (designable != null) { |
||||
ctrl.Controls.Add(designable.VisualControl); |
||||
this.AdjustControl(designable); |
||||
ctrl.Invalidate(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private ReportSection SectionByName ( ReportSectionControlBase item) { |
||||
if (item != null) { |
||||
return (ReportSection)sectionCollection.Find(item.GetType().Name); |
||||
} |
||||
throw new NullReferenceException("No Section in Report.OnAddReportItem"); |
||||
} |
||||
|
||||
private void AdjustControl (IDesignable ctrl) { |
||||
ctrl.VisualControl.BringToFront(); |
||||
ctrl.VisualControl.Focus(); |
||||
} |
||||
|
||||
|
||||
private void OnAddReportItem (object sender,ItemDragDropEventArgs iddea) { |
||||
|
||||
if (iddea.Action != ItemDragDropEventArgs.enmAction.Add) { |
||||
throw new NotSupportedException (); |
||||
} |
||||
|
||||
selectedSection = SectionByName ((ReportSectionControlBase)sender); |
||||
|
||||
BaseReportItem baseReportItem = BuildDraggedItem(iddea); |
||||
|
||||
if (baseReportItem != null) { |
||||
|
||||
SetParent (baseReportItem,iddea.ItemAtPoint); |
||||
IItemRenderer itemRenderer = baseReportItem as IItemRenderer; |
||||
|
||||
|
||||
if (itemRenderer != null) { |
||||
SetVisualControl (baseReportItem); |
||||
if (baseReportItem.Parent != null) { |
||||
if (baseReportItem.Parent == this.selectedSection) { |
||||
// we have a 'TopLevel' Control
|
||||
baseReportItem.Parent = selectedSection; |
||||
this.selectedSection.Items.Added += OnItemCollectionAdd; |
||||
this.selectedSection.Items.Add(itemRenderer); |
||||
CustomizeItem (iddea,selectedSection.Items,baseReportItem); |
||||
} else { |
||||
IContainerItem parent = baseReportItem.Parent as IContainerItem; |
||||
if (parent != null) { |
||||
parent.Items.Added += OnItemCollectionAdd; |
||||
parent.Items.Add (itemRenderer); |
||||
CustomizeItem (iddea,parent.Items,baseReportItem); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} else { |
||||
throw new NullReferenceException("Report:OnAddReportItem "); |
||||
} |
||||
AdjustDesignable(baseReportItem); |
||||
}else { |
||||
string str = String.Format("Unable to create <0> ",iddea.ItemName); |
||||
MessageService.ShowError(str); |
||||
} |
||||
selectedObject = (IBaseRenderer)baseReportItem; |
||||
if (DesignViewChanged != null) { |
||||
DesignViewChanged (this,iddea); |
||||
} |
||||
} |
||||
|
||||
private void OnItemCollectionAdd(object sender, CollectionItemEventArgs<IItemRenderer> e){ |
||||
SharpReport.Designer.IDesignable iDesignable = e.Item as SharpReport.Designer.IDesignable; |
||||
iDesignable.Selected += new EventHandler <EventArgs>(this.ItemSelected); |
||||
} |
||||
|
||||
#region property's
|
||||
|
||||
public ReportSectionCollection SectionCollection |
||||
{ |
||||
get { |
||||
return sectionCollection; |
||||
} |
||||
set { |
||||
sectionCollection = value; |
||||
} |
||||
} |
||||
|
||||
public BaseReportObject SelectedObject |
||||
{ |
||||
get {return (BaseReportObject)selectedObject; } |
||||
} |
||||
|
||||
public ReportSection SelectedSection |
||||
{ |
||||
get { return selectedSection; } |
||||
} |
||||
|
||||
private void OnObjectSelected(EventArgs e) |
||||
{ |
||||
if (ObjectSelected != null) |
||||
ObjectSelected(this, e); |
||||
} |
||||
|
||||
|
||||
public ReportSettings ReportSettings { |
||||
get { |
||||
return reportSettings; |
||||
} |
||||
set { |
||||
reportSettings = value; |
||||
SetDefaultValues(); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region events
|
||||
|
||||
void SectionSelected(object sender, System.EventArgs e){ |
||||
ReportSection section = (ReportSection)sender; |
||||
|
||||
if (this.selectedSection != null) { |
||||
if (this.selectedSection != section) { |
||||
ITracker tracker = selectedSection.VisualControl as ITracker; |
||||
if (tracker != null) { |
||||
tracker.ClearSelections(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
selectedSection = section; |
||||
selectedObject = (IBaseRenderer)section; |
||||
OnObjectSelected(e); |
||||
} |
||||
|
||||
|
||||
void ItemSelected(object sender, System.EventArgs e){ |
||||
selectedObject = (IBaseRenderer)sender; |
||||
OnObjectSelected(e); |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Fire if Size of Section changes
|
||||
/// </summary>
|
||||
/// <param name="sender">this</param>
|
||||
/// <param name="e">SharpReport.Designer.SectionChangedEventArgs</param>
|
||||
void SectionSizeChanged(object sender, SharpReport.Designer.SectionChangedEventArgs e){ |
||||
if (SectionChanged != null) { |
||||
Rectangle [] rects = new Rectangle[5]; |
||||
rects[0] = SectionClientArea (this.visualReportHeader); |
||||
rects[1] = SectionClientArea (this.visualPageHeader); |
||||
rects[2] = SectionClientArea(this.visualDetail); |
||||
rects[3] = SectionClientArea(this.visualPageFooter); |
||||
rects[4] = SectionClientArea(this.visualFooter); |
||||
SectionChanged (this,new SectionChangedEventArgs (selectedSection,rects)); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.visualDetail = new SharpReport.Designer.ReportDetail(); |
||||
this.visualPageFooter = new SharpReport.Designer.ReportPageFooter(); |
||||
this.visualFooter = new SharpReport.Designer.ReportFooter(); |
||||
this.visualPageHeader = new SharpReport.Designer.ReportPageHeader(); |
||||
this.visualReportHeader = new SharpReport.Designer.ReportHeader(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// visualDetail
|
||||
//
|
||||
this.visualDetail.AllowDrop = true; |
||||
this.visualDetail.BackColor = System.Drawing.SystemColors.Control; |
||||
this.visualDetail.Caption = "ReportSectionControlBase"; |
||||
this.visualDetail.Dock = System.Windows.Forms.DockStyle.Top; |
||||
this.visualDetail.Location = new System.Drawing.Point(0, 140); |
||||
this.visualDetail.Name = "visualDetail"; |
||||
this.visualDetail.Size = new System.Drawing.Size(400, 72); |
||||
this.visualDetail.TabIndex = 3; |
||||
this.visualDetail.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged); |
||||
//
|
||||
// visualPageFooter
|
||||
//
|
||||
this.visualPageFooter.BackColor = System.Drawing.SystemColors.Control; |
||||
this.visualPageFooter.Caption = "ReportSectionControlBase"; |
||||
this.visualPageFooter.Dock = System.Windows.Forms.DockStyle.Top; |
||||
this.visualPageFooter.Location = new System.Drawing.Point(0, 212); |
||||
this.visualPageFooter.Name = "visualPageFooter"; |
||||
this.visualPageFooter.Size = new System.Drawing.Size(400, 68); |
||||
this.visualPageFooter.TabIndex = 6; |
||||
this.visualPageFooter.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged); |
||||
//
|
||||
// visualFooter
|
||||
//
|
||||
this.visualFooter.BackColor = System.Drawing.SystemColors.Control; |
||||
this.visualFooter.Caption = "ReportSectionControlBase"; |
||||
this.visualFooter.Dock = System.Windows.Forms.DockStyle.Top; |
||||
this.visualFooter.Location = new System.Drawing.Point(0, 280); |
||||
this.visualFooter.Name = "visualFooter"; |
||||
this.visualFooter.Size = new System.Drawing.Size(400, 76); |
||||
this.visualFooter.TabIndex = 7; |
||||
this.visualFooter.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged); |
||||
//
|
||||
// visualPageHeader
|
||||
//
|
||||
this.visualPageHeader.BackColor = System.Drawing.SystemColors.Control; |
||||
this.visualPageHeader.Caption = "ReportSectionControlBase"; |
||||
this.visualPageHeader.Dock = System.Windows.Forms.DockStyle.Top; |
||||
this.visualPageHeader.Location = new System.Drawing.Point(0, 56); |
||||
this.visualPageHeader.Name = "visualPageHeader"; |
||||
this.visualPageHeader.Size = new System.Drawing.Size(400, 84); |
||||
this.visualPageHeader.TabIndex = 1; |
||||
this.visualPageHeader.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged); |
||||
//
|
||||
// visualReportHeader
|
||||
//
|
||||
this.visualReportHeader.BackColor = System.Drawing.SystemColors.Control; |
||||
this.visualReportHeader.Caption = "ReportSectionControlBase"; |
||||
this.visualReportHeader.Dock = System.Windows.Forms.DockStyle.Top; |
||||
this.visualReportHeader.Location = new System.Drawing.Point(0, 0); |
||||
this.visualReportHeader.Name = "visualReportHeader"; |
||||
this.visualReportHeader.Size = new System.Drawing.Size(400, 56); |
||||
this.visualReportHeader.TabIndex = 0; |
||||
this.visualReportHeader.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.SectionSizeChanged); |
||||
//
|
||||
// Report
|
||||
//
|
||||
this.AllowDrop = true; |
||||
this.Controls.Add(this.visualFooter); |
||||
this.Controls.Add(this.visualPageFooter); |
||||
this.Controls.Add(this.visualDetail); |
||||
this.Controls.Add(this.visualPageHeader); |
||||
this.Controls.Add(this.visualReportHeader); |
||||
this.Name = "Report"; |
||||
this.Size = new System.Drawing.Size(400, 392); |
||||
this.ResumeLayout(false); |
||||
} |
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,57 +0,0 @@
@@ -1,57 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 20.10.2004 |
||||
* Time: 22:39 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
|
||||
namespace Ruler |
||||
{ |
||||
/// <summary>
|
||||
/// Description of GdiHelper.
|
||||
/// </summary>
|
||||
public class GdiHelper |
||||
{ |
||||
public GdiHelper() |
||||
{ |
||||
} |
||||
|
||||
public static SizeF CalcReciprocals(Graphics g) |
||||
{ |
||||
switch(g.PageUnit) |
||||
{ |
||||
case GraphicsUnit.World: |
||||
case GraphicsUnit.Pixel: |
||||
|
||||
return new SizeF(1f,1f); |
||||
|
||||
case GraphicsUnit.Inch: |
||||
|
||||
return new SizeF(1f/g.DpiX,1f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Millimeter: |
||||
|
||||
return new SizeF(25.4f/g.DpiX,25.4f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Point: |
||||
|
||||
return new SizeF(72f/g.DpiX,72f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Display: |
||||
|
||||
return new SizeF(75f/g.DpiX,75f/g.DpiY); |
||||
|
||||
case GraphicsUnit.Document: |
||||
|
||||
return new SizeF(300f/g.DpiX,300f/g.DpiY); |
||||
|
||||
} |
||||
return new SizeF(10,10);//never gets here...
|
||||
} |
||||
} |
||||
} |
@ -1,342 +0,0 @@
@@ -1,342 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 27.10.2004 |
||||
* Time: 14:04 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace Ruler |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ctrlRuler.
|
||||
/// </summary>
|
||||
public class ctrlRuler : System.Windows.Forms.UserControl |
||||
{ |
||||
public enum enmDirection { |
||||
enmHorizontal, |
||||
enmVertikal |
||||
} |
||||
|
||||
int leftMargin; |
||||
int rightMargin; |
||||
int startValue; |
||||
int endValue; |
||||
int bigStep = 0; |
||||
int smallStep = 0; |
||||
bool drawFrame; |
||||
|
||||
Size paperSize; |
||||
System.Drawing.GraphicsUnit scaleUnit; |
||||
enmDirection direction; |
||||
|
||||
System.Drawing.Color marginColor; |
||||
|
||||
public event EventHandler StartValueChange; |
||||
public event EventHandler EndValueChange; |
||||
|
||||
public ctrlRuler() |
||||
{ |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
InitializeComponent(); |
||||
|
||||
// this.ResizeRedraw = true;
|
||||
scaleUnit = GraphicsUnit.Millimeter; |
||||
} |
||||
|
||||
#region privates
|
||||
|
||||
private void Line(Graphics g, int x1, int y1, int x2, int y2) |
||||
{ |
||||
g.DrawLine(new Pen(new SolidBrush(this.ForeColor)), x1, y1, x2, y2); |
||||
} |
||||
|
||||
private void Line(Graphics g, Pen pen,int x1, int y1, int x2, int y2) |
||||
{ |
||||
g.DrawLine(pen, x1, y1, x2, y2); |
||||
} |
||||
|
||||
private void SetSize (GraphicsUnit unit) { |
||||
if (unit == GraphicsUnit.Millimeter) { |
||||
bigStep = 10; |
||||
smallStep = 5; |
||||
paperSize = new Size (210,297); |
||||
} else { |
||||
throw new System.NotImplementedException ("SetStepSize"); |
||||
} |
||||
} |
||||
|
||||
void PaintVertical (Graphics g){ |
||||
|
||||
int bigStep = 0; |
||||
Pen pen = new System.Drawing.Pen (System.Drawing.Color.Black,0.25f); |
||||
Brush brush = new SolidBrush(System.Drawing.Color.Black); |
||||
|
||||
switch (scaleUnit) { |
||||
case GraphicsUnit.Millimeter: |
||||
g.PageUnit = GraphicsUnit.Millimeter; |
||||
g.PageScale = 1; |
||||
SetSize (scaleUnit); |
||||
bigStep = 10; |
||||
smallStep = 5; |
||||
break; |
||||
case GraphicsUnit.Inch: |
||||
break; |
||||
|
||||
} |
||||
SizeF size = GdiHelper.CalcReciprocals (g); |
||||
int bLine,sLine; |
||||
sLine = (int)(this.Width / 3 * size.Width); |
||||
bLine = sLine * 2; |
||||
|
||||
int start = 0; |
||||
if (startValue > 0) { |
||||
start = (int)(startValue / 10); |
||||
} |
||||
int ende =0; |
||||
if (endValue > 0) { |
||||
ende = paperSize.Height; |
||||
} else { |
||||
endValue = paperSize.Height; |
||||
} |
||||
|
||||
|
||||
int i = 0; |
||||
int drawPos = 0; |
||||
while (i < this.Height) { |
||||
drawPos = i * bigStep; |
||||
g.DrawString ((i + start).ToString(),this.Font,brush,3,drawPos); |
||||
Line (g,pen,0,drawPos,bLine,drawPos); |
||||
Line (g,pen, |
||||
0,drawPos - smallStep, |
||||
sLine,drawPos - smallStep); |
||||
i ++; |
||||
} |
||||
pen.Dispose(); |
||||
brush.Dispose(); |
||||
} |
||||
|
||||
void PaintHorizontal (Graphics g){ |
||||
|
||||
Pen pen = new System.Drawing.Pen (System.Drawing.Color.Black,0.25f); |
||||
Brush brush = new SolidBrush(System.Drawing.Color.Black); |
||||
|
||||
switch (scaleUnit) { |
||||
case GraphicsUnit.Millimeter: |
||||
g.PageUnit = GraphicsUnit.Millimeter; |
||||
g.PageScale = 1; |
||||
SetSize (scaleUnit); |
||||
break; |
||||
case GraphicsUnit.Inch: |
||||
break; |
||||
|
||||
} |
||||
SizeF size = GdiHelper.CalcReciprocals (g); |
||||
int bLine,sLine; |
||||
sLine = (int)(this.Height / 3 * size.Height); |
||||
bLine = sLine * 2; |
||||
|
||||
int start = 0; |
||||
if (startValue > 0) { |
||||
start = (int)(startValue / 10); |
||||
} |
||||
int ende =0; |
||||
if (endValue > 0) { |
||||
ende = paperSize.Width; |
||||
} else { |
||||
endValue = paperSize.Width; |
||||
} |
||||
if (drawFrame == true) { |
||||
g.DrawRectangle (pen,0,0,(this.Width - 1) * size.Width,(this.Height - 1) * size.Width); |
||||
} |
||||
|
||||
|
||||
int i = 0; |
||||
int drawPos = 0; |
||||
|
||||
while (i < (int)((endValue / 10) + 1)) { |
||||
drawPos = i * bigStep; |
||||
g.DrawString ((i + start).ToString(),this.Font,brush,drawPos,sLine); |
||||
Line (g,pen,drawPos,0,i * bigStep,bLine); |
||||
Line (g,pen,drawPos - smallStep,0,drawPos - smallStep,sLine); |
||||
i ++; |
||||
} |
||||
// MarginMarker
|
||||
if (leftMargin > 0) { |
||||
// g.DrawString ("L",this.Font,brush,leftMargin * size.Width,sLine);
|
||||
// Line (g,
|
||||
// (int)(leftMargin * size.Width),0,
|
||||
// (int)(leftMargin * size.Width),bLine);
|
||||
Line (g, |
||||
(int)(leftMargin),0, |
||||
(int)(leftMargin),bLine); |
||||
} |
||||
pen.Dispose(); |
||||
brush.Dispose(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { |
||||
base.OnPaint (e); |
||||
e.Graphics.Clear (this.BackColor); |
||||
if (this.direction == enmDirection.enmHorizontal) { |
||||
PaintHorizontal (e.Graphics); |
||||
} else { |
||||
PaintVertical (e.Graphics); |
||||
} |
||||
|
||||
} |
||||
|
||||
protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) |
||||
{ |
||||
e.Graphics.FillRectangle(Brushes.White, |
||||
new Rectangle(0, |
||||
0, |
||||
Width, |
||||
Height)); |
||||
|
||||
} |
||||
|
||||
|
||||
protected override void OnResize(System.EventArgs e) { |
||||
base.OnResize (e); |
||||
if (this.Width < this.Height) { |
||||
direction = enmDirection.enmVertikal; |
||||
} else { |
||||
direction = enmDirection.enmHorizontal; |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Getter/Setter
|
||||
[Description("Left Margin")] |
||||
[Category("Ruler")] |
||||
public int LeftMargin { |
||||
get { |
||||
return leftMargin; |
||||
} |
||||
set { |
||||
leftMargin = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("RightMargin")] |
||||
[Category("Ruler")] |
||||
public int RightMargin { |
||||
get { |
||||
return rightMargin; |
||||
} |
||||
set { |
||||
rightMargin = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("A value from which the ruler marking should be shown. Default is zero.")] |
||||
[Category("Ruler")] |
||||
public int StartValue { |
||||
get { |
||||
return startValue; |
||||
} |
||||
set { |
||||
startValue = value; |
||||
if (StartValueChange != null) { |
||||
StartValueChange (this,new System.EventArgs()); |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("A value to which the ruler marking should be shown. Default is zero.")] |
||||
[Category("Ruler")] |
||||
public int EndValue { |
||||
get { |
||||
return endValue; |
||||
} |
||||
set { |
||||
endValue = value; |
||||
if (EndValueChange != null) { |
||||
EndValueChange (this,new System.EventArgs()); |
||||
} |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("The scale to use")] |
||||
[Category("Ruler")] |
||||
public System.Drawing.GraphicsUnit ScaleUnit { |
||||
get { |
||||
return scaleUnit; |
||||
} |
||||
set { |
||||
scaleUnit = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("Horizontal or vertical layout")] |
||||
[Category("Ruler")] |
||||
public enmDirection Direction { |
||||
get { |
||||
return direction; |
||||
} |
||||
set { |
||||
direction = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("Frame around the Ruler")] |
||||
[Category("Ruler")] |
||||
public bool DrawFrame { |
||||
get { |
||||
return drawFrame; |
||||
} |
||||
set { |
||||
drawFrame = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
[Description("Not used now Color with withch the left and right Margins are painted")] |
||||
[Category("Ruler")] |
||||
public System.Drawing.Color MarginColor { |
||||
get { |
||||
return marginColor; |
||||
} |
||||
set { |
||||
marginColor = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ctrlRuler
|
||||
//
|
||||
this.DockPadding.All = 0; |
||||
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); |
||||
this.Name = "ctrlRuler"; |
||||
this.Size = new System.Drawing.Size(40, 32); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,236 +0,0 @@
@@ -1,236 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 10.01.2005 |
||||
* Time: 22:06 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of BaseDesignerControl.
|
||||
/// </summary>
|
||||
public class BaseDesignerControl : UserControl,SharpReportCore.IVisitor |
||||
{ |
||||
private SharpReport.Designer.Report reportControl; |
||||
private Ruler.ctrlRuler ctrlRuler1; |
||||
private System.Drawing.GraphicsUnit graphicsUnit; |
||||
private ReportModel reportModel; |
||||
|
||||
public event PropertyChangedEventHandler DesignerDirty; |
||||
|
||||
public BaseDesignerControl(){ |
||||
InitializeComponent(); |
||||
|
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
|
||||
this.graphicsUnit = System.Drawing.GraphicsUnit.Millimeter; |
||||
reportModel = new ReportModel (graphicsUnit); |
||||
this.ReportControl.ReportSettings = reportModel.ReportSettings; |
||||
} |
||||
#region public'c
|
||||
|
||||
public void Localise() { |
||||
reportControl.Localise(); |
||||
} |
||||
|
||||
public void RegisterEvents () { |
||||
this.reportControl.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.ReportControlSectionChanged); |
||||
this.reportControl.SizeChanged += new System.EventHandler(this.ReportControlSizeChanged); |
||||
this.reportControl.DesignViewChanged += new SharpReport.Designer.ItemDragDropEventHandler(this.ReportControlDesignViewChanged); |
||||
} |
||||
|
||||
public void RemoveSelectedItem () { |
||||
if (this.SelectedObject == null) { |
||||
return; |
||||
} |
||||
BaseReportItem item = this.SelectedObject as BaseReportItem; |
||||
|
||||
if ((item.Parent == this.SelectedSection)|| (item.Parent == null)){ |
||||
this.SelectedSection.Items.Remove (item); |
||||
} else { |
||||
IContainerItem con = item.Parent as IContainerItem; |
||||
if (con != null) { |
||||
con.Items.Remove (item); |
||||
} |
||||
} |
||||
this.NotifyPropertyChanged("RemoveSelectedItem"); |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
|
||||
protected override void Dispose(bool disposing ) { |
||||
if( disposing ){ |
||||
this.reportControl = null; |
||||
this.ctrlRuler1 = null; |
||||
} |
||||
base.Dispose( disposing ); |
||||
} |
||||
|
||||
protected override void OnResize(System.EventArgs e) { |
||||
this.ctrlRuler1.Width = reportControl.Width; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region events
|
||||
void ReportControlSizeChanged(object sender, System.EventArgs e){ |
||||
this.ctrlRuler1.Width = reportControl.Width; |
||||
this.ctrlRuler1.Invalidate(); |
||||
// NotifyPropertyChanged(this.Name + "ReportControlSizeChanged");
|
||||
} |
||||
|
||||
void ReportControlSectionChanged (object sender,SectionChangedEventArgs e) { |
||||
NotifyPropertyChanged(this.Name + "ReportControlSectionChanged"); |
||||
} |
||||
|
||||
void ReportControlDesignViewChanged(object sender, SharpReport.Designer.ItemDragDropEventArgs e){ |
||||
NotifyPropertyChanged(this.Name + "ReportControlDesignViewChanged"); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region privates
|
||||
void NotifyPropertyChanged(string info) { |
||||
if (DesignerDirty != null) { |
||||
DesignerDirty (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region SharpReport.DelegatesInterfaces.IVisitor interface implementation
|
||||
|
||||
public void Accept(IModelVisitor visitor){ |
||||
SharpReportCore.IModelVisitor v = visitor as SharpReportCore.IModelVisitor; |
||||
v.Visit(this); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region property's
|
||||
|
||||
public ReportModel ReportModel { |
||||
get { |
||||
|
||||
reportModel.ReportSettings = reportControl.ReportSettings; |
||||
reportModel.SectionCollection.Clear(); |
||||
foreach (ReportSection section in reportControl.SectionCollection) { |
||||
reportModel.SectionCollection.Add (section); |
||||
} |
||||
return reportModel; |
||||
} |
||||
set { |
||||
this.reportModel = value; |
||||
reportControl.ReportSettings = this.reportModel.ReportSettings; |
||||
reportControl.SectionCollection = this.ReportModel.SectionCollection; |
||||
} |
||||
} |
||||
|
||||
|
||||
public SharpReport.Designer.Report ReportControl { |
||||
get { |
||||
return reportControl; |
||||
} |
||||
} |
||||
public BaseReportObject SelectedObject |
||||
{ |
||||
get { return this.reportControl.SelectedObject; } |
||||
} |
||||
|
||||
|
||||
public ReportSection SelectedSection { |
||||
get { |
||||
return this.reportControl.SelectedSection; |
||||
} |
||||
} |
||||
|
||||
|
||||
public ReportSectionCollection SectionsCollection { |
||||
get { |
||||
return this.reportControl.SectionCollection; |
||||
} |
||||
set { |
||||
this.reportControl.SectionCollection = value; |
||||
} |
||||
} |
||||
|
||||
public System.Drawing.GraphicsUnit GraphicsUnit { |
||||
get { |
||||
return graphicsUnit; |
||||
} |
||||
set { |
||||
graphicsUnit = value; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.ctrlRuler1 = new Ruler.ctrlRuler(); |
||||
this.reportControl = new SharpReport.Designer.Report(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// ctrlRuler1
|
||||
//
|
||||
this.ctrlRuler1.BackColor = System.Drawing.SystemColors.Window; |
||||
this.ctrlRuler1.Direction = Ruler.ctrlRuler.enmDirection.enmHorizontal; |
||||
this.ctrlRuler1.DrawFrame = false; |
||||
this.ctrlRuler1.EndValue = 210; |
||||
this.ctrlRuler1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); |
||||
this.ctrlRuler1.LeftMargin = 0; |
||||
this.ctrlRuler1.Location = new System.Drawing.Point(32, 8); |
||||
this.ctrlRuler1.MarginColor = System.Drawing.Color.Empty; |
||||
this.ctrlRuler1.Name = "ctrlRuler1"; |
||||
this.ctrlRuler1.RightMargin = 0; |
||||
this.ctrlRuler1.ScaleUnit = System.Drawing.GraphicsUnit.Millimeter; |
||||
this.ctrlRuler1.Size = new System.Drawing.Size(568, 24); |
||||
this.ctrlRuler1.StartValue = 0; |
||||
this.ctrlRuler1.TabIndex = 0; |
||||
//
|
||||
// reportControl
|
||||
//
|
||||
this.reportControl.AllowDrop = true; |
||||
this.reportControl.Location = new System.Drawing.Point(8, 40); |
||||
this.reportControl.Name = "reportControl"; |
||||
this.reportControl.Size = new System.Drawing.Size(592, 400); |
||||
this.reportControl.TabIndex = 1; |
||||
// this.reportControl.SectionChanged += new EventHandler<SectionChangedEventArgs> (this.ReportControlSectionChanged);
|
||||
// this.reportControl.SizeChanged += new System.EventHandler(this.ReportControlSizeChanged);
|
||||
// this.reportControl.DesignViewChanged += new SharpReport.Designer.ItemDragDropEventHandler(this.ReportControlDesignViewChanged);
|
||||
//
|
||||
// BaseDesignerControl
|
||||
//
|
||||
this.AutoScroll = true; |
||||
this.BackColor = System.Drawing.SystemColors.ControlDark; |
||||
this.Controls.Add(this.reportControl); |
||||
this.Controls.Add(this.ctrlRuler1); |
||||
this.Name = "BaseDesignerControl"; |
||||
this.Size = new System.Drawing.Size(608, 440); |
||||
this.ResumeLayout(false); |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
} |
||||
} |
@ -1,59 +0,0 @@
@@ -1,59 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SharpReport.Designer { |
||||
using System; |
||||
using System.Drawing; |
||||
|
||||
|
||||
/// <summary>
|
||||
/// This Class handles manipulation of reportitems, called from DragDrop or from Commands
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 20.01.2005 16:41:53
|
||||
/// </remarks>
|
||||
|
||||
public delegate void ItemDragDropEventHandler (object sender, ItemDragDropEventArgs e); |
||||
|
||||
public class ItemDragDropEventArgs : System.EventArgs { |
||||
|
||||
public enum enmAction { |
||||
Add, |
||||
Remove |
||||
} |
||||
|
||||
string itemName; |
||||
enmAction action; |
||||
Point itemAtPoint; |
||||
|
||||
public ItemDragDropEventArgs(enmAction action, Point itemAtPoint, string itemName){ |
||||
this.action = action; |
||||
this.itemAtPoint = itemAtPoint; |
||||
this.itemName = itemName; |
||||
} |
||||
|
||||
public enmAction Action { |
||||
get { |
||||
return action; |
||||
} |
||||
} |
||||
public Point ItemAtPoint { |
||||
get { |
||||
return itemAtPoint; |
||||
} |
||||
} |
||||
public string ItemName { |
||||
get { |
||||
return itemName; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,60 +0,0 @@
@@ -1,60 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 09/10/2004 |
||||
* Time: 9.52 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of ReportDetail.
|
||||
/// </summary>
|
||||
internal class ReportDetail : ReportSectionControlBase |
||||
{ |
||||
|
||||
|
||||
public event ItemDragDropEventHandler ReportItemsHandling; |
||||
|
||||
public ReportDetail():base() |
||||
{ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
base.ItemDragDrop += new ItemDragDropEventHandler (ItemsChanging); |
||||
} |
||||
|
||||
|
||||
protected void ItemsChanging (object sender,ItemDragDropEventArgs e) { |
||||
if (ReportItemsHandling != null) { |
||||
ReportItemsHandling (this,e); |
||||
} |
||||
} |
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportDetail
|
||||
//
|
||||
this.AllowDrop = true; |
||||
this.BackColor = System.Drawing.SystemColors.Window; |
||||
this.Name = "ReportDetail"; |
||||
this.Size = new System.Drawing.Size(292, 60); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,63 +0,0 @@
@@ -1,63 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 9.52 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of ReportFooter.
|
||||
/// </summary>
|
||||
internal class ReportFooter : ReportSectionControlBase |
||||
{ |
||||
public event ItemDragDropEventHandler ReportItemsHandling; |
||||
|
||||
public ReportFooter() |
||||
{ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
base.ItemDragDrop += new ItemDragDropEventHandler (ItemsChanging); |
||||
} |
||||
|
||||
|
||||
protected void ItemsChanging (object sender,ItemDragDropEventArgs e) { |
||||
if (ReportItemsHandling != null) { |
||||
ReportItemsHandling (this,e); |
||||
} |
||||
} |
||||
|
||||
#region overrides
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { |
||||
base.OnPaint (e); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
//
|
||||
// ReportFooter
|
||||
//
|
||||
this.Name = "ReportFooter"; |
||||
this.Size = new System.Drawing.Size(292, 266); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,60 +0,0 @@
@@ -1,60 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 9.51 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of ReportHeader.
|
||||
/// </summary>
|
||||
internal class ReportHeader : ReportSectionControlBase |
||||
{ |
||||
|
||||
public event ItemDragDropEventHandler ReportItemsHandling; |
||||
|
||||
public ReportHeader() |
||||
{ |
||||
|
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
base.ItemDragDrop += new ItemDragDropEventHandler (ItemsChanging); |
||||
} |
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { |
||||
base.OnPaint (e); |
||||
} |
||||
|
||||
protected void ItemsChanging (object sender,ItemDragDropEventArgs e) { |
||||
if (ReportItemsHandling != null) { |
||||
ReportItemsHandling (this,e); |
||||
} |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportHeader
|
||||
//
|
||||
this.Name = "ReportHeader"; |
||||
this.Size = new System.Drawing.Size(292, 266); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,61 +0,0 @@
@@ -1,61 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 9.52 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of ReportPageFooter.
|
||||
/// </summary>
|
||||
internal class ReportPageFooter : ReportSectionControlBase |
||||
{ |
||||
|
||||
public event ItemDragDropEventHandler ReportItemsHandling; |
||||
|
||||
public ReportPageFooter() |
||||
{ |
||||
|
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
base.ItemDragDrop += new ItemDragDropEventHandler (ItemsChanging); |
||||
} |
||||
|
||||
protected void ItemsChanging (object sender,ItemDragDropEventArgs e) { |
||||
if (ReportItemsHandling != null) { |
||||
ReportItemsHandling (this,e); |
||||
} |
||||
} |
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { |
||||
base.OnPaint (e); |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
//
|
||||
// ReportPageFooter
|
||||
//
|
||||
this.Name = "ReportPageFooter"; |
||||
this.Size = new System.Drawing.Size(292, 266); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,63 +0,0 @@
@@ -1,63 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 9.51 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportPageHeader.
|
||||
/// </summary>
|
||||
internal class ReportPageHeader : ReportSectionControlBase |
||||
{ |
||||
public event ItemDragDropEventHandler ReportItemsHandling; |
||||
|
||||
public ReportPageHeader() |
||||
{ |
||||
|
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
base.ItemDragDrop += new ItemDragDropEventHandler (ItemsChanging); |
||||
} |
||||
|
||||
|
||||
protected void ItemsChanging (object sender,ItemDragDropEventArgs e) { |
||||
if (ReportItemsHandling != null) { |
||||
ReportItemsHandling (this,e); |
||||
} |
||||
} |
||||
|
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { |
||||
base.OnPaint (e); |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
//
|
||||
// ReportPageHeader
|
||||
//
|
||||
this.Name = "ReportPageHeader"; |
||||
this.Size = new System.Drawing.Size(292, 266); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,326 +0,0 @@
@@ -1,326 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 13.11.2004 |
||||
* Time: 22:18 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Globalization; |
||||
using System.Reflection; |
||||
using System.Windows.Forms; |
||||
using System.Xml; |
||||
using System.Xml.Serialization; |
||||
|
||||
using ICSharpCode.Core; |
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport{ |
||||
/// <summary>
|
||||
/// This class builds a Section
|
||||
/// </summary>
|
||||
|
||||
public class ReportSection : BaseSection,SharpReportCore.IStoreable{ |
||||
|
||||
const string contextMenuPath = "/SharpReport/ContextMenu/Section"; |
||||
private ReportSectionControlBase visualControl; |
||||
|
||||
public event EventHandler <EventArgs> ItemSelected; |
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#region Constructors
|
||||
|
||||
internal ReportSection() : base(){ |
||||
this.Initialize(); |
||||
} |
||||
|
||||
internal ReportSection (string sectionName):base (){ |
||||
base.Name = sectionName; |
||||
this.Initialize(); |
||||
} |
||||
|
||||
internal ReportSection(SharpReport.Designer.ReportSectionControlBase visualControl) : base(){ |
||||
this.Initialize(); |
||||
this.VisualControl = visualControl; |
||||
base.SectionOffset = 0; |
||||
|
||||
} |
||||
#endregion
|
||||
|
||||
private void Initialize(){ |
||||
base.Items.Added += OnItemAddeded; |
||||
base.Items.Removed += OnRemoveTopLevelItem; |
||||
} |
||||
|
||||
internal ReportSectionControlBase VisualControl{ |
||||
get { |
||||
return this.visualControl; |
||||
} |
||||
set { this.visualControl = value; |
||||
this.visualControl.Click += new EventHandler(VisualControlClick); |
||||
this.visualControl.Body.MouseDown += new MouseEventHandler (VisualControlMouseUp); |
||||
} |
||||
} |
||||
|
||||
|
||||
#region XmlStuff for Load and Save reports
|
||||
|
||||
private XmlIgnoreAttribute CheckForXmlIgnore(PropertyInfo prop) { |
||||
if (prop != null) { |
||||
AttributeCollection attributes = TypeDescriptor.GetProperties(this)[prop.Name].Attributes; |
||||
XmlIgnoreAttribute attribute = (XmlIgnoreAttribute)attributes[typeof(XmlIgnoreAttribute)]; |
||||
return attribute; |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
|
||||
void SerializeItemProperties (XmlElement xmlControl, |
||||
BaseReportItem item,PropertyInfo [] prop) { |
||||
|
||||
XmlElement xmlProperty; |
||||
XmlAttribute attPropValue; |
||||
|
||||
foreach (PropertyInfo p in prop) { |
||||
AttributeCollection attributes = TypeDescriptor.GetProperties(item)[p.Name].Attributes; |
||||
XmlIgnoreAttribute xmlIgnoreAttribute = (XmlIgnoreAttribute)attributes[typeof(XmlIgnoreAttribute)]; |
||||
if (xmlIgnoreAttribute == null){ |
||||
|
||||
xmlProperty = xmlControl.OwnerDocument.CreateElement (p.Name); |
||||
if (p.PropertyType == typeof(Font)) { |
||||
XmlFormReader.BuildFontElement (item.Font,xmlProperty); |
||||
} |
||||
else { |
||||
attPropValue = xmlControl.OwnerDocument.CreateAttribute ("value"); |
||||
attPropValue.InnerText = Convert.ToString(p.GetValue(item,null), |
||||
CultureInfo.InvariantCulture); |
||||
xmlProperty.Attributes.Append(attPropValue); |
||||
} |
||||
xmlControl.AppendChild(xmlProperty); |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
private XmlElement SerializeControl (XmlDocument doc,BaseReportItem item) { |
||||
Type type = item.GetType(); |
||||
PropertyInfo [] prop = type.GetProperties(); |
||||
XmlElement xmlControl = doc.CreateElement ("control"); |
||||
XmlAttribute typeAttr = doc.CreateAttribute ("type"); |
||||
typeAttr.InnerText = type.FullName; |
||||
|
||||
xmlControl.Attributes.Append(typeAttr); |
||||
|
||||
XmlAttribute baseAttr = doc.CreateAttribute ("basetype"); |
||||
baseAttr.InnerText = type.BaseType.ToString(); |
||||
xmlControl.Attributes.Append(baseAttr); |
||||
SerializeItemProperties (xmlControl,item,prop); |
||||
return xmlControl; |
||||
|
||||
} |
||||
/// <summary>
|
||||
/// Read all ReportItenms of Section
|
||||
/// </summary>
|
||||
/// <param name="doc"></param>
|
||||
private XmlElement ReportItemsToXml (XmlDocument doc,ReportItemCollection items) { |
||||
XmlElement xmlControls = doc.CreateElement ("controls"); |
||||
|
||||
foreach (BaseReportItem item in items) { |
||||
XmlElement xmlControl = SerializeControl (doc,item); |
||||
|
||||
IContainerItem iContainer = item as IContainerItem; |
||||
|
||||
if (iContainer != null) { |
||||
xmlControl.AppendChild ( ReportItemsToXml(doc,iContainer.Items)); |
||||
} |
||||
xmlControls.AppendChild(xmlControl); |
||||
} |
||||
return xmlControls; |
||||
} |
||||
|
||||
|
||||
private void SerializeSectionProperties (XmlDocument doc, |
||||
XmlElement section, |
||||
PropertyInfo [] prop) { |
||||
|
||||
XmlElement xmlProperty; |
||||
XmlAttribute attPropValue; |
||||
|
||||
foreach (PropertyInfo p in prop) { |
||||
if (this.CheckForXmlIgnore(p) == null ) { |
||||
if (p.CanWrite) { |
||||
xmlProperty = doc.CreateElement (p.Name); |
||||
attPropValue = doc.CreateAttribute ("value"); |
||||
attPropValue.InnerText = Convert.ToString(p.GetValue(this,null), |
||||
CultureInfo.InvariantCulture); |
||||
xmlProperty.Attributes.Append(attPropValue); |
||||
section.AppendChild(xmlProperty); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
private XmlElement SectionItemToXml (XmlDocument doc) { |
||||
XmlElement section = doc.CreateElement ("section"); |
||||
|
||||
Type type = this.GetType(); |
||||
PropertyInfo [] prop = type.GetProperties(); |
||||
|
||||
XmlAttribute att = section.OwnerDocument.CreateAttribute ("name"); |
||||
|
||||
att.InnerText = this.VisualControl.GetType().Name; |
||||
section.Attributes.Append(att); |
||||
this.SerializeSectionProperties (doc,section,prop); |
||||
|
||||
return section; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region iStoreable Interface
|
||||
public XmlDocument GetXmlData(){ |
||||
//Only a temp DocumentObject
|
||||
XmlDocument xmlDocument = SharpReportCore.XmlHelper.BuildXmlDocument (); |
||||
XmlElement xmlRoot = xmlDocument.CreateElement ("Sections"); |
||||
|
||||
xmlDocument.AppendChild(xmlRoot); |
||||
|
||||
XmlElement xmlSection = SectionItemToXml (xmlDocument); |
||||
//Then read all ReportItems of this Section
|
||||
|
||||
XmlElement xmlControls = ReportItemsToXml (xmlDocument,base.Items); |
||||
xmlSection.AppendChild(xmlControls); |
||||
|
||||
xmlRoot.AppendChild(xmlSection); |
||||
xmlDocument.AppendChild(xmlRoot); |
||||
|
||||
return xmlDocument; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public void OnItemSelect(object sender, EventArgs e){ |
||||
if (ItemSelected != null) |
||||
ItemSelected(sender, e); |
||||
|
||||
} |
||||
|
||||
public void VisualControlClick(object sender, EventArgs e){ |
||||
this.OnSelect(); |
||||
} |
||||
|
||||
public void ReportItemSelected(object sender, EventArgs e){ |
||||
this.OnSelect (); |
||||
this.OnItemSelect(sender, e); |
||||
} |
||||
|
||||
|
||||
public void OnPropertyChanged (object sender ,EventArgs e) { |
||||
if (!base.Suspend) { |
||||
base.NotifyPropertyChanged("Section"); |
||||
} |
||||
} |
||||
|
||||
|
||||
void VisualControlMouseUp (object sender,MouseEventArgs e) { |
||||
if (e.Button == MouseButtons.Right) { |
||||
ContextMenuStrip ctMen = MenuService.CreateContextMenu (this,contextMenuPath); |
||||
ctMen.Show (this.VisualControl,new Point (e.X,e.Y)); |
||||
} |
||||
} |
||||
|
||||
public void OnSelect(){ |
||||
if (Selected != null) |
||||
Selected(this,EventArgs.Empty); |
||||
} |
||||
|
||||
private void OnItemAddeded(object sender, CollectionItemEventArgs<IItemRenderer> e){ |
||||
|
||||
SharpReport.Designer.IDesignable iDesignable = e.Item as SharpReport.Designer.IDesignable; |
||||
|
||||
if (iDesignable != null) { |
||||
if (this.VisualControl != null) { |
||||
iDesignable.Selected += new EventHandler <EventArgs>(this.ReportItemSelected); |
||||
this.VisualControl.Body.Controls.Add(iDesignable.VisualControl); |
||||
iDesignable.VisualControl.BringToFront(); |
||||
iDesignable.VisualControl.Focus(); |
||||
iDesignable.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
} |
||||
} |
||||
} |
||||
|
||||
private void OnRemoveTopLevelItem(object sender, CollectionItemEventArgs<IItemRenderer> e){ |
||||
//We have to Convert to IDesignable to
|
||||
//get the VisualControl
|
||||
|
||||
SharpReport.Designer.IDesignable iDes = e.Item as SharpReport.Designer.IDesignable; |
||||
if (iDes != null) { |
||||
this.VisualControl.Body.Controls.Remove (iDes.VisualControl); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public void Render (ReportSettings settings, |
||||
SharpReportCore.ReportPageEventArgs e) { |
||||
base.Render (e); |
||||
} |
||||
|
||||
#region property's
|
||||
|
||||
|
||||
|
||||
public override Color BackColor{ |
||||
get { |
||||
if (this.VisualControl != null) { |
||||
return VisualControl.Body.BackColor; |
||||
} else { |
||||
return System.Drawing.Color.White; |
||||
} |
||||
} |
||||
set { |
||||
base.BackColor = value; |
||||
if (this.VisualControl != null){ |
||||
VisualControl.Body.BackColor = value; |
||||
} |
||||
} |
||||
} |
||||
|
||||
public override Size Size { |
||||
get { |
||||
if (this.visualControl != null) { |
||||
return visualControl.Body.Size; |
||||
} else { |
||||
return base.Size; |
||||
} |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Body.Size = value; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
[Browsable(false)] |
||||
[XmlIgnoreAttribute] |
||||
public override bool Visible { |
||||
get { |
||||
return (this.Size.Height > 5); |
||||
} |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,522 +0,0 @@
@@ -1,522 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 20.12.2004 |
||||
* Time: 23:09 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Globalization; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// BaseControl for <see cref="ReportSection"></see>
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
namespace SharpReport.Designer{ |
||||
public abstract class ReportSectionControlBase :ReportObjectControlBase, |
||||
ITracker{ |
||||
|
||||
private System.Windows.Forms.Panel titlePanel; |
||||
private System.Windows.Forms.Panel splitPanel; |
||||
private Ruler.ctrlRuler ctrlRuler1; |
||||
private System.Windows.Forms.Panel bodyPanel; |
||||
|
||||
private string caption; |
||||
|
||||
private bool mouseDown; |
||||
private bool dragAllowed; |
||||
|
||||
private int currentY; |
||||
private IDesignableFactory designableFactory; |
||||
private ControlHelper controlHelper; |
||||
private BaseReportItem draggedItem; |
||||
|
||||
public event EventHandler <EventArgs> ItemSelected; |
||||
public event ItemDragDropEventHandler ItemDragDrop; |
||||
public event EventHandler <SectionChangedEventArgs> SectionChanged; |
||||
|
||||
private ReportControlBase selectedControl; |
||||
private RectTracker rectTracker = new RectTracker(); |
||||
|
||||
internal ReportSectionControlBase(){ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
caption = this.Name; |
||||
this.designableFactory = new IDesignableFactory(); |
||||
this.controlHelper = new ControlHelper(this); |
||||
} |
||||
|
||||
void BodyPanelSizeChanged(object sender, System.EventArgs e){ |
||||
this.Size = new Size (this.Size.Width,this.bodyPanel.Height + this.titlePanel.Height + this.splitPanel.Height); |
||||
} |
||||
|
||||
#region overrides
|
||||
|
||||
protected override CreateParams CreateParams{ |
||||
get { |
||||
CreateParams cp=base.CreateParams; |
||||
cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT
|
||||
return cp; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region ITracker implementation
|
||||
|
||||
public void ClearSelections() { |
||||
this.controlHelper.Clear(this.bodyPanel); |
||||
this.selectedControl = null; |
||||
this.InvalidateEx(); |
||||
} |
||||
|
||||
public void InvalidateEx() { |
||||
|
||||
this.Invalidate(); |
||||
|
||||
if (this.Parent == null) { |
||||
return; |
||||
} |
||||
Rectangle rc = new Rectangle (this.bodyPanel.Location,this.bodyPanel.Size); |
||||
this.Invalidate(rc,true); |
||||
|
||||
if(this.selectedControl != null){ |
||||
rc = this.rectTracker.m_rect; |
||||
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height); |
||||
this.selectedControl.Invalidate(); |
||||
} |
||||
|
||||
} |
||||
|
||||
public ReportControlBase SelectedControl { |
||||
set { |
||||
selectedControl = value; |
||||
} |
||||
} |
||||
|
||||
public RectTracker RectTracker { |
||||
get { |
||||
return this.rectTracker; |
||||
} |
||||
} |
||||
|
||||
public Control DesignSurface { |
||||
get{ |
||||
return this.bodyPanel; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region tracker
|
||||
|
||||
|
||||
private Rectangle GetParentRectangle(){ |
||||
return new Rectangle(new Point(0,0),this.bodyPanel.Size); |
||||
} |
||||
|
||||
|
||||
private void OnMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){ |
||||
|
||||
if (this.rectTracker == null) { |
||||
return; |
||||
} |
||||
if(e.Button != MouseButtons .Left){ |
||||
return; |
||||
} |
||||
Point pt = this.bodyPanel.PointToClient(Cursor.Position); |
||||
|
||||
Rectangle rcForm = GetParentRectangle(); |
||||
|
||||
if(rcForm.Contains(pt)){ |
||||
Rectangle rcObject; |
||||
if (this.rectTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing) { |
||||
|
||||
this.selectedControl = null; |
||||
this.rectTracker.m_rect = new Rectangle(0,0,0,0); |
||||
// just to demonstrate RectTracker::TrackRubberBand
|
||||
RectTracker tracker=new RectTracker(); |
||||
if (tracker.TrackRubberBand(this.bodyPanel, pt, false)){ |
||||
// see if rubber band intersects with the doc's tracker
|
||||
// System.Console.WriteLine("3");
|
||||
tracker.NormalizeRect(ref tracker.m_rect); |
||||
Rectangle rectIntersect = tracker.m_rect; |
||||
foreach (Control ctrl in this.bodyPanel.Controls){ |
||||
rcObject = ctrl.Bounds; |
||||
//
|
||||
if(tracker.m_rect.Contains(rcObject)){ |
||||
|
||||
this.rectTracker.m_rect = rcObject; |
||||
this.selectedControl = (ReportControlBase)ctrl; |
||||
this.selectedControl.Selected = true; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
else{ |
||||
|
||||
// No rubber band, see if the point selects an object.
|
||||
|
||||
foreach (Control ctrl in this.bodyPanel.Controls){ |
||||
rcObject = ctrl.Bounds ; |
||||
if(rcObject.Contains(pt)){ |
||||
this.rectTracker.m_rect = rcObject; |
||||
this.selectedControl = (ReportControlBase)ctrl; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
if(this.selectedControl == null){ |
||||
NotifySectionClick(); |
||||
} |
||||
else{ |
||||
// System.Console.WriteLine("6");
|
||||
// m_FormTracker.Clear();
|
||||
|
||||
} |
||||
} |
||||
else if(this.selectedControl != null){// normal tracking action, when tracker is hit
|
||||
if (this.rectTracker.Track(this.bodyPanel, pt, false,null)) { |
||||
Rectangle rc = this.rectTracker.m_rect; |
||||
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height); |
||||
this.selectedControl.NotifyPropertyChanged("Tracker"); |
||||
} |
||||
} |
||||
|
||||
} |
||||
else{ |
||||
if(this.selectedControl == null){//select the container form
|
||||
System.Console.WriteLine("9"); |
||||
// MainForm.m_propertyWindow.SetSelectedObject(m_Form);
|
||||
/* |
||||
if(m_FormTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing) |
||||
{ |
||||
m_FormTracker.m_rect = rcForm; |
||||
} |
||||
else if(!m_FormTracker.IsEmpty()) |
||||
{ |
||||
m_FormTracker.Track(this, pt, false,null); |
||||
} |
||||
*/ |
||||
} |
||||
else{ |
||||
// System.Console.WriteLine("10");
|
||||
// m_FormTracker.Clear();
|
||||
} |
||||
} |
||||
this.InvalidateEx(); |
||||
|
||||
} |
||||
|
||||
|
||||
private void OnMouseMove(object sender, System.Windows.Forms.MouseEventArgs e){ |
||||
if (this.rectTracker != null) { |
||||
Point mousept=new Point(e.X,e.Y); |
||||
|
||||
if(this.selectedControl != null){ |
||||
if(!rectTracker.SetCursor(this,0,mousept)) |
||||
this.Cursor=Cursors.Arrow; |
||||
} |
||||
|
||||
// else{
|
||||
// if(!m_FormTracker.SetCursor(this,0,mousept))
|
||||
// this.Cursor=Cursors.Arrow;
|
||||
// }
|
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region painting
|
||||
|
||||
private void BodyPanelPaint(object sender, PaintEventArgs pea) { |
||||
pea.Graphics.Clear(this.Body.BackColor); |
||||
ControlPaint.DrawGrid (pea.Graphics, |
||||
this.Body.ClientRectangle, |
||||
GlobalValues.GridSize, |
||||
Color.Gray); |
||||
} |
||||
|
||||
|
||||
private void OnPaintTitel(object sender, PaintEventArgs pea) { |
||||
pea.Graphics.Clear (this.BackColor); |
||||
using (Brush brush = new SolidBrush(Color.Black)) { |
||||
pea.Graphics.DrawString (caption, |
||||
this.Font, |
||||
brush, |
||||
new PointF(this.bodyPanel.Location.X,0)); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region splitter
|
||||
void SplitPanelMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){ |
||||
mouseDown = true; |
||||
currentY = e.Y; |
||||
} |
||||
|
||||
|
||||
void SplitPanelMouseUp(object sender, System.Windows.Forms.MouseEventArgs mea){ |
||||
if (mouseDown){ |
||||
this.Height = this.Height + (mea.Y - currentY); |
||||
if (SectionChanged != null) { |
||||
SectionChanged (this,new SectionChangedEventArgs (null,null)); |
||||
} |
||||
mouseDown = false; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region propertys
|
||||
|
||||
public override Control Body{ |
||||
get { return bodyPanel; } |
||||
} |
||||
|
||||
public Control Head{ |
||||
get { |
||||
return this.titlePanel; |
||||
} |
||||
} |
||||
|
||||
public string Caption { |
||||
set { |
||||
caption = value; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region events
|
||||
|
||||
void NotifySectionClick () { |
||||
ClearSelections(); |
||||
this.OnClick(EventArgs.Empty); |
||||
} |
||||
|
||||
void FiredDragDropItem (string item,Point pointAt) { |
||||
if (ItemSelected != null) { |
||||
ItemSelected (this,new EventArgs()); |
||||
} |
||||
|
||||
if (ItemDragDrop != null) { |
||||
ItemDragDropEventArgs ea = new ItemDragDropEventArgs (ItemDragDropEventArgs.enmAction.Add, |
||||
pointAt, |
||||
item); |
||||
ItemDragDrop (this,ea); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region DragDrop
|
||||
|
||||
private string DragObjectToString (DragEventArgs dea) { |
||||
if (dea.Data.GetDataPresent(typeof(System.String))){ |
||||
return Convert.ToString (dea.Data.GetData(typeof(System.String)), |
||||
CultureInfo.InvariantCulture); |
||||
} else { |
||||
return String.Empty; |
||||
} |
||||
} |
||||
|
||||
private bool CheckDraggedControl (DragEventArgs dea) { |
||||
string str = this.DragObjectToString (dea); |
||||
return this.designableFactory.Contains(str); |
||||
} |
||||
|
||||
private bool CheckDragElement (System.Windows.Forms.DragEventArgs dea) { |
||||
bool drag; |
||||
if (CheckDraggedControl(dea)) { |
||||
dea.Effect = DragDropEffects.Copy; |
||||
drag = true; |
||||
} else { |
||||
dea.Effect = DragDropEffects.None; |
||||
drag = false; |
||||
} |
||||
return drag; |
||||
} |
||||
|
||||
|
||||
|
||||
void BodyPanelDragDrop(object sender, System.Windows.Forms.DragEventArgs dea){ |
||||
if (dea.Data.GetDataPresent(typeof(System.String))){ |
||||
Object item = (object)dea.Data.GetData(typeof(System.String)); |
||||
|
||||
FiredDragDropItem (Convert.ToString(item), |
||||
this.Body.PointToClient (Cursor.Position)); |
||||
} |
||||
|
||||
} |
||||
|
||||
void BodyPanelDragEnter(object sender, System.Windows.Forms.DragEventArgs dea){ |
||||
dragAllowed = CheckDragElement(dea); |
||||
string s = DragObjectToString (dea); |
||||
|
||||
this.draggedItem = this.designableFactory.Create(s); |
||||
|
||||
} |
||||
|
||||
void BodyPanelDragLeave(object sender, System.EventArgs e){ |
||||
dragAllowed = false; |
||||
this.Body.Invalidate(); |
||||
} |
||||
|
||||
private void BodyPanelDragOver(object sender, System.Windows.Forms.DragEventArgs dea){ |
||||
IContainerItem parentControl = this.IsValidContainer(dea); |
||||
if (parentControl != null) { |
||||
if (parentControl.IsValidChild(this.draggedItem)) { |
||||
dea.Effect = DragDropEffects.Copy; |
||||
} else { |
||||
dea.Effect = DragDropEffects.None; |
||||
} |
||||
|
||||
} else { |
||||
if (dragAllowed) { |
||||
dea.Effect = DragDropEffects.Copy; |
||||
} else { |
||||
dea.Effect = DragDropEffects.None; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
private IContainerItem IsValidContainer(DragEventArgs dea) { |
||||
Point point = new Point(dea.X,dea.Y); |
||||
// System.Console.WriteLine("ReportSectionControlBase:IsValidContainer");
|
||||
for (int i = 0; i < this.bodyPanel.Controls.Count; i++) { |
||||
Control c = this.bodyPanel.Controls[i]; |
||||
Rectangle r = c.ClientRectangle; |
||||
|
||||
if (r.Contains(c.PointToClient(point))) { |
||||
// System.Console.WriteLine("\tfound Control {0} ",c.Name);
|
||||
IContainerItem ia = c as IContainerItem; |
||||
ContainerControl cc = c as ContainerControl; |
||||
if (cc != null) { |
||||
System.Console.WriteLine("\tContainerControl {0}",cc.Name); |
||||
} else { |
||||
// System.Console.WriteLine("\tNo ContainerControl");
|
||||
} |
||||
// if (ia != null) {
|
||||
// System.Console.WriteLine("\t\tContainer is {0}",c.Name);
|
||||
// } else {
|
||||
// System.Console.WriteLine("\t\tNo COntainer{0}",c.Name);
|
||||
// }
|
||||
return ia; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.bodyPanel = new System.Windows.Forms.Panel(); |
||||
this.ctrlRuler1 = new Ruler.ctrlRuler(); |
||||
this.splitPanel = new System.Windows.Forms.Panel(); |
||||
this.titlePanel = new System.Windows.Forms.Panel(); |
||||
this.titlePanel.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// bodyPanel
|
||||
//
|
||||
this.bodyPanel.AllowDrop = true; |
||||
this.bodyPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left) |
||||
| System.Windows.Forms.AnchorStyles.Right))); |
||||
this.bodyPanel.BackColor = System.Drawing.SystemColors.Window; |
||||
this.bodyPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; |
||||
this.bodyPanel.Location = new System.Drawing.Point(24, 20); |
||||
this.bodyPanel.Name = "bodyPanel"; |
||||
this.bodyPanel.Size = new System.Drawing.Size(408, 131); |
||||
this.bodyPanel.TabIndex = 6; |
||||
this.bodyPanel.DragOver += new System.Windows.Forms.DragEventHandler(this.BodyPanelDragOver); |
||||
this.bodyPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.BodyPanelDragDrop); |
||||
this.bodyPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.BodyPanelDragEnter); |
||||
this.bodyPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.BodyPanelPaint); |
||||
this.bodyPanel.SizeChanged += new System.EventHandler(this.BodyPanelSizeChanged); |
||||
this.bodyPanel.DragLeave += new System.EventHandler(this.BodyPanelDragLeave); |
||||
this.bodyPanel.MouseMove += new MouseEventHandler(this.OnMouseMove); |
||||
this.bodyPanel.MouseDown += new MouseEventHandler(this.OnMouseDown); |
||||
//
|
||||
// ctrlRuler1
|
||||
//
|
||||
this.ctrlRuler1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
||||
| System.Windows.Forms.AnchorStyles.Left))); |
||||
this.ctrlRuler1.BackColor = System.Drawing.SystemColors.Window; |
||||
this.ctrlRuler1.Direction = Ruler.ctrlRuler.enmDirection.enmVertikal; |
||||
this.ctrlRuler1.DrawFrame = true; |
||||
this.ctrlRuler1.EndValue = 210; |
||||
this.ctrlRuler1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); |
||||
this.ctrlRuler1.LeftMargin = 0; |
||||
this.ctrlRuler1.Location = new System.Drawing.Point(0, 20); |
||||
this.ctrlRuler1.MarginColor = System.Drawing.Color.Empty; |
||||
this.ctrlRuler1.Name = "ctrlRuler1"; |
||||
this.ctrlRuler1.RightMargin = 0; |
||||
this.ctrlRuler1.ScaleUnit = System.Drawing.GraphicsUnit.Millimeter; |
||||
this.ctrlRuler1.Size = new System.Drawing.Size(24, 131); |
||||
this.ctrlRuler1.StartValue = 0; |
||||
this.ctrlRuler1.TabIndex = 1; |
||||
//
|
||||
// splitPanel
|
||||
//
|
||||
this.splitPanel.BackColor = System.Drawing.SystemColors.ControlDarkDark; |
||||
this.splitPanel.Cursor = System.Windows.Forms.Cursors.HSplit; |
||||
this.splitPanel.Dock = System.Windows.Forms.DockStyle.Bottom; |
||||
this.splitPanel.Location = new System.Drawing.Point(0, 150); |
||||
this.splitPanel.Name = "splitPanel"; |
||||
this.splitPanel.Size = new System.Drawing.Size(432, 4); |
||||
this.splitPanel.TabIndex = 7; |
||||
this.splitPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SplitPanelMouseDown); |
||||
this.splitPanel.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SplitPanelMouseUp); |
||||
//
|
||||
// titlePanel
|
||||
//
|
||||
this.titlePanel.BackColor = System.Drawing.SystemColors.Control; |
||||
this.titlePanel.Dock = System.Windows.Forms.DockStyle.Top; |
||||
this.titlePanel.Location = new System.Drawing.Point(0, 0); |
||||
this.titlePanel.Name = "titlePanel"; |
||||
this.titlePanel.Size = new System.Drawing.Size(432, 20); |
||||
this.titlePanel.TabIndex = 5; |
||||
this.titlePanel.Paint += new System.Windows.Forms.PaintEventHandler(this.OnPaintTitel); |
||||
//
|
||||
// UserControl1
|
||||
//
|
||||
this.BackColor = System.Drawing.SystemColors.Control; |
||||
this.Controls.Add(this.bodyPanel); |
||||
this.Controls.Add(this.titlePanel); |
||||
this.Controls.Add(this.splitPanel); |
||||
this.Controls.Add(this.ctrlRuler1); |
||||
|
||||
this.Name = "UserControl1"; |
||||
this.Size = new System.Drawing.Size(432, 154); |
||||
this.titlePanel.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
} |
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using System.Drawing; |
||||
|
||||
namespace SharpReport.Designer { |
||||
|
||||
/// <summary>
|
||||
/// SectionChanged notify witch section was changed in Size
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 20.12.2004 22:06:09
|
||||
/// </remarks>
|
||||
|
||||
public class SectionChangedEventArgs : System.EventArgs { |
||||
|
||||
ReportSection section; |
||||
Rectangle [] sectionRectangles; |
||||
|
||||
public SectionChangedEventArgs(ReportSection section , Rectangle[] sectionRectangles) { |
||||
this.section = section; |
||||
this.sectionRectangles = sectionRectangles; |
||||
} |
||||
|
||||
public ReportSection Section { |
||||
get { |
||||
return section; |
||||
} |
||||
} |
||||
public Rectangle[] SectionRectangles { |
||||
get { |
||||
return sectionRectangles; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
/* |
||||
* Erstellt mit SharpDevelop. |
||||
* Benutzer: Forstmeier Helmut |
||||
* Datum: 24.10.2006 |
||||
* Zeit: 22:50 |
||||
* |
||||
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BuildTabControl.
|
||||
/// </summary>
|
||||
public class BuildDesignerTab |
||||
{ |
||||
public static TabControl BuildTabControl () { |
||||
TabControl tabControl = new TabControl(); |
||||
// Designer Tap
|
||||
TabPage designerPage = new TabPage(); |
||||
|
||||
//Standart Preview page
|
||||
//create only the TabPage, no Controls are added
|
||||
TabPage previewPage = new TabPage(); |
||||
|
||||
// ReportViewer
|
||||
TabPage reportViewerPage = new TabPage(); |
||||
|
||||
tabControl.TabPages.Add (designerPage); |
||||
tabControl.TabPages.Add (previewPage); |
||||
tabControl.TabPages.Add(reportViewerPage); |
||||
|
||||
tabControl.Alignment = TabAlignment.Bottom; |
||||
tabControl.Dock = DockStyle.Fill; |
||||
return tabControl; |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,139 +0,0 @@
@@ -1,139 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 06.01.2006 |
||||
* Time: 23:29 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
using ICSharpCode.SharpDevelop.Widgets.SideBar; |
||||
|
||||
namespace SharpReport |
||||
{ |
||||
/// <summary>
|
||||
/// Description of BuildSideTab.
|
||||
/// </summary>
|
||||
public class BuildSideTab{ |
||||
SharpDevelopSideBar sideBar; |
||||
SideTab sideTab; |
||||
SideTab sideTabFunctions; |
||||
|
||||
public BuildSideTab(SharpDevelopSideBar sideBar){ |
||||
this.sideBar = sideBar; |
||||
} |
||||
|
||||
public void CreateSidetabs() { |
||||
|
||||
sideBar.DoAddTab = true; |
||||
|
||||
sideTab = sideBar.SideTabFactory.CreateSideTab (sideBar, |
||||
ResourceService.GetString("SharpReport.Toolbar.Controls")); |
||||
CusomizeSideTab (sideTab); |
||||
sideTab.Items.Add(this.BuildPointer()); |
||||
AddReportElements(this.sideTab); |
||||
|
||||
sideBar.ActiveTab = sideTab; |
||||
sideBar.Tabs.Add (sideTab); |
||||
sideTabFunctions = sideBar.SideTabFactory.CreateSideTab (sideBar, |
||||
ResourceService.GetString("SharpReport.Toolbar.Functions")); |
||||
CusomizeSideTab (this.sideTabFunctions); |
||||
this.sideTabFunctions.Items.Add(this.BuildPointer()); |
||||
|
||||
this.AddFunctionElements(this.sideTabFunctions); |
||||
sideBar.Tabs.Add (this.sideTabFunctions); |
||||
} |
||||
|
||||
private SideTabItem BuildPointer () { |
||||
return sideTab.SideTabItemFactory.CreateSideTabItem(ResourceService.GetString("SharpReport.Toolbar.Pointer"), |
||||
"pointer", |
||||
ResourceService.GetBitmap("Icons.16x16.FormsDesigner.PointerIcon")); |
||||
} |
||||
|
||||
private void CusomizeSideTab (SideTab tab) { |
||||
tab.CanDragDrop = true; |
||||
tab.CanSaved = false; |
||||
} |
||||
|
||||
private void AddReportElements (SideTab tab) { |
||||
|
||||
Bitmap bitmap = ResourceService.GetIcon("Icons.16.16.SharpReport.Textbox").ToBitmap(); |
||||
|
||||
SideTabItem t = sideTab.SideTabItemFactory.CreateSideTabItem(ResourceService.GetString("SharpReport.Toolbar.TextBox"), |
||||
GlobalEnums.ReportItemType.ReportTextItem.ToString(), |
||||
bitmap); |
||||
tab.Items.Add (t); |
||||
|
||||
t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.DataRow"), |
||||
GlobalEnums.ReportItemType.ReportRowItem.ToString(), |
||||
ResourceService.GetBitmap("Icons.16x16.SharpQuery.Table")); |
||||
tab.Items.Add (t); |
||||
|
||||
t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.DataField"), |
||||
GlobalEnums.ReportItemType.ReportDataItem.ToString(), |
||||
ResourceService.GetBitmap("Icons.16x16.SharpQuery.Column")); |
||||
tab.Items.Add (t); |
||||
|
||||
bitmap = ResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp").ToBitmap(); |
||||
|
||||
t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.Image"), |
||||
GlobalEnums.ReportItemType.ReportImageItem.ToString(), |
||||
bitmap); |
||||
tab.Items.Add (t); |
||||
// t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.Rectangle"),
|
||||
// GlobalEnums.ReportItemType.ReportRectangleItem.ToString(),
|
||||
// ResourceService.GetBitmap("Icons.16x16.SharpReport.Rectangle"));
|
||||
t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.Rectangle"), |
||||
GlobalEnums.ReportItemType.ReportRectangleItem.ToString(), |
||||
GlobalValues.RectangleBitmap()); |
||||
tab.Items.Add (t); |
||||
|
||||
|
||||
//
|
||||
bitmap = ResourceService.GetIcon("Icons.16.16.SharpReport.Line").ToBitmap(); |
||||
t = sideTab.SideTabItemFactory.CreateSideTabItem( ResourceService.GetString("SharpReport.Toolbar.Line"), |
||||
GlobalEnums.ReportItemType.ReportLineItem.ToString(), |
||||
bitmap); |
||||
tab.Items.Add (t); |
||||
t = sideTab.SideTabItemFactory.CreateSideTabItem(ResourceService.GetString("SharpReport.Toolbar.Circle"), |
||||
GlobalEnums.ReportItemType.ReportCircleItem.ToString(), |
||||
GlobalValues.CircleBitmap()); |
||||
tab.Items.Add (t); |
||||
|
||||
//Test
|
||||
//
|
||||
// t = sideTab.SideTabItemFactory.CreateSideTabItem( "Table",
|
||||
// GlobalEnums.ReportItemType.ReportTableItem.ToString(),
|
||||
// ResourceService.GetBitmap("Icons.16x16.SharpQuery.Table"));
|
||||
// tab.Items.Add (t);
|
||||
|
||||
//
|
||||
} |
||||
|
||||
private void AddFunctionElements (SideTab tab) { |
||||
|
||||
FunctionFactory ff = new FunctionFactory(); |
||||
string localise = "SharpReport.Toolbar.Functions."; |
||||
Bitmap functionBitmap = ResourceService.GetIcon("Icons.16x16.SharpReport.Function").ToBitmap(); |
||||
|
||||
SideTabItem t = sideTab.SideTabItemFactory.CreateSideTabItem(ResourceService.GetString(localise + ff.AvailableTypes[0]) , |
||||
ff.AvailableTypes[0].ToString(), |
||||
functionBitmap); |
||||
|
||||
tab.Items.Add (t); |
||||
|
||||
t = sideTab.SideTabItemFactory.CreateSideTabItem (ResourceService.GetString(localise + ff.AvailableTypes[1]), |
||||
ff.AvailableTypes[1], |
||||
functionBitmap); |
||||
|
||||
tab.Items.Add (t); |
||||
|
||||
} |
||||
} |
||||
} |
@ -1,75 +0,0 @@
@@ -1,75 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 18.04.2005 |
||||
* Time: 17:24 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing.Drawing2D; |
||||
|
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Base Class for Graphic Contriols like Circle,Rectangle etc
|
||||
/// </summary>
|
||||
public class AbstractGraphicControl : ReportControlBase { |
||||
int thickness = 1; |
||||
DashStyle dashStyle = DashStyle.Solid; |
||||
|
||||
public AbstractGraphicControl(){ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
|
||||
|
||||
#region property's
|
||||
|
||||
/// <summary>
|
||||
/// DasshStyle used in drawing
|
||||
/// </summary>
|
||||
public DashStyle DashStyle { |
||||
get { |
||||
return dashStyle; |
||||
} |
||||
set { |
||||
dashStyle = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Thickness of Linme used
|
||||
/// </summary>
|
||||
public int Thickness { |
||||
get { |
||||
return thickness; |
||||
} |
||||
set { |
||||
thickness = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
//
|
||||
// AbstractGraphicControl
|
||||
//
|
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "AbstractGraphicControl"; |
||||
this.Size = new System.Drawing.Size(292, 266); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,208 +0,0 @@
@@ -1,208 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 25.05.2006 |
||||
* Time: 09:19 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
|
||||
/// <summary>
|
||||
/// Description of ContainerControl.
|
||||
/// </summary>
|
||||
public class ContainerControl:ReportControlBase,ITracker{ |
||||
private RectTracker rectTracker = new RectTracker(); |
||||
private ReportControlBase selectedControl; |
||||
|
||||
public ContainerControl():base(){ |
||||
this.Body.MouseMove += new MouseEventHandler( OnMouseMove); |
||||
this.Body.MouseDown += new MouseEventHandler(OnMouseDown); |
||||
} |
||||
|
||||
private Rectangle GetParentRectangle () { |
||||
return this.Body.ClientRectangle; |
||||
} |
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){ |
||||
base.OnPaint(e); |
||||
} |
||||
|
||||
|
||||
#region overrides
|
||||
/* |
||||
protected override CreateParams CreateParams{ |
||||
get { |
||||
CreateParams cp=base.CreateParams; |
||||
cp.ExStyle|=0x00000020; //WS_EX_TRANSPARENT
|
||||
return cp; |
||||
} |
||||
} |
||||
*/ |
||||
#endregion
|
||||
|
||||
private void OnMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){ |
||||
|
||||
if (this.rectTracker == null) { |
||||
return; |
||||
} |
||||
if(e.Button != MouseButtons .Left){ |
||||
return; |
||||
} |
||||
Point pt = this.Body.PointToClient(Cursor.Position); |
||||
|
||||
Rectangle rcForm = GetParentRectangle(); |
||||
|
||||
if(rcForm.Contains(pt)){ |
||||
Rectangle rcObject; |
||||
if (this.rectTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing) { |
||||
// System.Console.WriteLine("2");
|
||||
this.selectedControl = null; |
||||
this.rectTracker.m_rect = new Rectangle(0,0,0,0); |
||||
// just to demonstrate RectTracker::TrackRubberBand
|
||||
RectTracker tracker=new RectTracker(); |
||||
if (tracker.TrackRubberBand(this.Body, pt, false)){ |
||||
// see if rubber band intersects with the doc's tracker
|
||||
|
||||
tracker.NormalizeRect(ref tracker.m_rect); |
||||
Rectangle rectIntersect = tracker.m_rect; |
||||
foreach (Control ctrl in this.Body.Controls){ |
||||
rcObject = ctrl.Bounds; |
||||
if(tracker.m_rect.Contains(rcObject)){ |
||||
|
||||
this.rectTracker.m_rect = rcObject; |
||||
this.selectedControl = (ReportControlBase)ctrl; |
||||
this.selectedControl.Selected = true; |
||||
// MainForm.m_propertyWindow.SetSelectedObject(m_seletedCtrl);
|
||||
break; |
||||
} |
||||
} |
||||
} |
||||
else{ |
||||
|
||||
// No rubber band, see if the point selects an object.
|
||||
|
||||
foreach (Control ctrl in this.Body.Controls){ |
||||
rcObject = ctrl.Bounds ; |
||||
if(rcObject.Contains(pt)){ |
||||
|
||||
this.rectTracker.m_rect = rcObject; |
||||
this.selectedControl = (ReportControlBase)ctrl; |
||||
this.selectedControl.Selected = true; |
||||
// MainForm.m_propertyWindow.SetSelectedObject(ctrl);
|
||||
break; |
||||
} |
||||
} |
||||
} |
||||
if(this.selectedControl == null){ |
||||
// NotifySectionClick();
|
||||
|
||||
// MainForm.m_propertyWindow.SetSelectedObject(m_Form);
|
||||
// m_FormTracker.m_rect = rcForm;
|
||||
} |
||||
else{ |
||||
// System.Console.WriteLine("6");
|
||||
// m_FormTracker.Clear();
|
||||
|
||||
} |
||||
} |
||||
else if(this.selectedControl != null){// normal tracking action, when tracker is hit
|
||||
// System.Console.WriteLine("7");
|
||||
if (this.rectTracker.Track(this.Body, pt, false,null)) { |
||||
Rectangle rc = this.rectTracker.m_rect; |
||||
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height); |
||||
} |
||||
} |
||||
} |
||||
else{ |
||||
if(this.selectedControl == null){//select the container form
|
||||
// System.Console.WriteLine("9");
|
||||
// MainForm.m_propertyWindow.SetSelectedObject(m_Form);
|
||||
/* |
||||
if(m_FormTracker.HitTest(pt) == RectTracker.TrackerHit.hitNothing) |
||||
{ |
||||
m_FormTracker.m_rect = rcForm; |
||||
} |
||||
else if(!m_FormTracker.IsEmpty()) |
||||
{ |
||||
m_FormTracker.Track(this, pt, false,null); |
||||
} |
||||
*/ |
||||
} |
||||
else{ |
||||
// System.Console.WriteLine("10");
|
||||
// m_FormTracker.Clear();
|
||||
} |
||||
} |
||||
this.InvalidateEx(); |
||||
|
||||
} |
||||
|
||||
private void OnMouseMove (object sender, MouseEventArgs e) { |
||||
|
||||
if (this.rectTracker != null) { |
||||
Point mousept=new Point(e.X,e.Y); |
||||
|
||||
if(this.selectedControl != null){ |
||||
if(!rectTracker.SetCursor(this,0,mousept)) |
||||
this.Cursor=Cursors.Arrow; |
||||
} |
||||
|
||||
// else{
|
||||
// if(!m_FormTracker.SetCursor(this,0,mousept))
|
||||
// this.Cursor=Cursors.Arrow;
|
||||
// }
|
||||
} |
||||
} |
||||
|
||||
#region ITracker implementation
|
||||
|
||||
public virtual void ClearSelections() { |
||||
base.ControlHelper.Clear(this); |
||||
this.selectedControl = null; |
||||
this.InvalidateEx(); |
||||
} |
||||
|
||||
public ReportControlBase SelectedControl { |
||||
set { |
||||
this.selectedControl = value; |
||||
} |
||||
} |
||||
|
||||
public RectTracker RectTracker { |
||||
get { |
||||
return this.rectTracker; |
||||
} |
||||
} |
||||
|
||||
public System.Windows.Forms.Control DesignSurface { |
||||
get { |
||||
return this.Body; |
||||
} |
||||
} |
||||
|
||||
public void InvalidateEx(){ |
||||
this.Invalidate(); |
||||
|
||||
if (this.Parent == null) { |
||||
return; |
||||
} |
||||
Rectangle rc = new Rectangle (this.Body.Location,this.Body.Size); |
||||
this.Invalidate(rc,true); |
||||
|
||||
if(this.selectedControl != null){ |
||||
rc = this.rectTracker.m_rect; |
||||
|
||||
this.selectedControl.SetBounds(rc.Left, rc.Top, rc.Width, rc.Height); |
||||
this.selectedControl.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,108 +0,0 @@
@@ -1,108 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 03.03.2006 |
||||
* Time: 08:28 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ControlHelper.
|
||||
/// </summary>
|
||||
public class ControlHelper{ |
||||
Control control; |
||||
|
||||
public ControlHelper(Control control){ |
||||
if (control == null) { |
||||
throw new ArgumentNullException("control"); |
||||
} |
||||
this.control = control; |
||||
} |
||||
|
||||
public Rectangle BuildFocusRectangle { |
||||
get { |
||||
return new Rectangle(this.control.ClientRectangle.Left, |
||||
this.control.ClientRectangle.Top, |
||||
this.control.ClientRectangle.Width -1, |
||||
this.control.ClientRectangle.Height -1); |
||||
} |
||||
} |
||||
|
||||
|
||||
public void DrawEdges (PaintEventArgs e) { |
||||
this.DrawEdges (e,this.BuildFocusRectangle); |
||||
} |
||||
|
||||
public void DrawEdges (PaintEventArgs e,Rectangle rectangle) { |
||||
|
||||
int arc = 5; |
||||
using (Pen p = new Pen (Color.Black)) { |
||||
e.Graphics.DrawRectangle (p,rectangle); |
||||
} |
||||
|
||||
using (Pen pb = new Pen(this.control.BackColor)){ |
||||
//top
|
||||
|
||||
int leftLine = rectangle.Left + arc; |
||||
int rightLine = rectangle.Left + rectangle.Width - arc; |
||||
int botLine = rectangle.Top + rectangle.Height; |
||||
//top
|
||||
e.Graphics.DrawLine (pb, |
||||
leftLine,rectangle.Top, |
||||
rightLine, rectangle.Top); |
||||
|
||||
//bottom
|
||||
e.Graphics.DrawLine (pb, |
||||
leftLine,botLine, |
||||
rightLine,botLine); |
||||
//left
|
||||
|
||||
int top = rectangle.Top + arc; |
||||
int down = rectangle.Top + rectangle.Height - arc; |
||||
e.Graphics.DrawLine(pb, |
||||
rectangle.Left,top, |
||||
rectangle.Left,down); |
||||
//right
|
||||
e.Graphics.DrawLine(pb, |
||||
rectangle.Left + rectangle.Width,top, |
||||
rectangle.Left + rectangle.Width,down); |
||||
|
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
public static void DrawHeadLine (Control ctrl, PaintEventArgs pea) { |
||||
|
||||
StringFormat fmt = SharpReportCore.GlobalValues.StandartStringFormat(); |
||||
fmt.LineAlignment = StringAlignment.Near; |
||||
pea.Graphics.DrawString(ctrl.Name, |
||||
ctrl.Font, |
||||
new SolidBrush(ctrl.ForeColor), |
||||
new Rectangle(7,0,pea.ClipRectangle.Width,(int)ctrl.Font.GetHeight(pea.Graphics) + 2), |
||||
fmt); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Set the Controls to selected = false, so the Focusrectangle is
|
||||
/// not draw
|
||||
/// </summary>
|
||||
/// <param name="control"></param>
|
||||
public void Clear (Control control) { |
||||
foreach (Control c in control.Controls) { |
||||
ReportControlBase rcb = c as ReportControlBase; |
||||
if (rcb != null) { |
||||
rcb.Selected = false; |
||||
Clear (c); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,97 +0,0 @@
@@ -1,97 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 19.04.2005 |
||||
* Time: 22:34 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of PageNumber.
|
||||
/// </summary>
|
||||
internal class FunctionControl : ReportControlBase { |
||||
string functionValue; |
||||
StringFormat stringFormat; |
||||
public FunctionControl() |
||||
{ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
} |
||||
|
||||
#region Overrides
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea) |
||||
{ |
||||
base.OnPaint(pea); |
||||
base.DrawEdges (pea); |
||||
|
||||
// StringFormat f = base.StringFormat;
|
||||
// f.Alignment = base.StringAlignment;
|
||||
// f.LineAlignment = StringAlignment.Center;
|
||||
|
||||
pea.Graphics.DrawString(this.Text + functionValue, |
||||
this.Font, |
||||
new SolidBrush(this.ForeColor), |
||||
new Rectangle(0, 0, this.Width - 1, this.Height - 1), |
||||
this.stringFormat); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// text is the TitlePart of an function like 'PageNr : '
|
||||
/// </summary>
|
||||
public override string Text{ |
||||
get { return base.Text; } |
||||
set { base.Text = value; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// FunctionValues give's the flexible part of the Function
|
||||
/// </summary>
|
||||
public string FunctionValue { |
||||
get { |
||||
return functionValue; |
||||
} |
||||
set { |
||||
functionValue = value; |
||||
} |
||||
} |
||||
|
||||
public StringFormat StringFormat{ |
||||
set { |
||||
if (this.stringFormat != value) { |
||||
this.stringFormat = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
//
|
||||
// PageNumber
|
||||
//
|
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "PageNumber"; |
||||
this.Size = new System.Drawing.Size(120, 20); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,50 +0,0 @@
@@ -1,50 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 25.05.2006 |
||||
* Time: 09:54 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
|
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ITracker.
|
||||
/// </summary>
|
||||
public interface ITracker{ |
||||
|
||||
/// <summary>
|
||||
/// Clear all selections
|
||||
/// </summary>
|
||||
|
||||
void ClearSelections(); |
||||
/// <summary>
|
||||
/// Invalidate the DesignSurface and draw the Tracking rectangle
|
||||
/// </summary>
|
||||
void InvalidateEx(); |
||||
|
||||
/// <summary>
|
||||
/// The selected Control
|
||||
/// </summary>
|
||||
ReportControlBase SelectedControl |
||||
{set;} |
||||
|
||||
/// <summary>
|
||||
/// The <see cref="RectTracker"></see>
|
||||
/// </summary>
|
||||
RectTracker RectTracker |
||||
{get;} |
||||
|
||||
///<summary>
|
||||
/// The Body Conrol to draw the Treckung Rectangle on
|
||||
/// </summary>
|
||||
|
||||
Control DesignSurface |
||||
{get;} |
||||
} |
||||
} |
@ -1,800 +0,0 @@
@@ -1,800 +0,0 @@
|
||||
using System; |
||||
using System.Diagnostics; |
||||
using System.Drawing; |
||||
using System.Drawing.Drawing2D; |
||||
using System.Runtime.InteropServices; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Draw a Focus and DragRectangle
|
||||
/// http://www.codeproject.com/csharp/SharpFormEditorDemo.asp
|
||||
/// <seealso cref="http://www.codeproject.com/csharp/SharpFormEditorDemo.asp">
|
||||
/// </seealso>
|
||||
/// </summary>
|
||||
public class RectTracker |
||||
{ |
||||
#region Win32API
|
||||
protected struct POINT |
||||
{ |
||||
public Int32 x; |
||||
public Int32 y; |
||||
}; |
||||
|
||||
protected struct MSG |
||||
{ |
||||
public Int32 hwnd; |
||||
public Int32 message; |
||||
public Int32 wParam; |
||||
public Int32 lParam; |
||||
public Int32 time; |
||||
public POINT pt; |
||||
}; |
||||
|
||||
[DllImport("user32.dll", SetLastError=true )] |
||||
protected static extern Int32 GetMessage (ref MSG lpMsg,Int32 hwnd,Int32 wMsgFilterMin,Int32 wMsgFilterMax); |
||||
|
||||
[DllImport("user32.dll", SetLastError=true )] |
||||
protected static extern Int32 DispatchMessage (ref MSG lpMsg); |
||||
|
||||
[DllImport("user32.dll", SetLastError=true )] |
||||
private static extern Int32 TranslateMessage (ref MSG lpMsg); |
||||
|
||||
private const int CX_BORDER=1; |
||||
private const int CY_BORDER=1; |
||||
protected const int WM_MOUSEFIRST = 0x0200; |
||||
protected const int WM_MOUSEMOVE = 0x0200; |
||||
protected const int WM_LBUTTONDOWN = 0x0201; |
||||
protected const int WM_LBUTTONUP = 0x0202; |
||||
protected const int WM_LBUTTONDBLCLK = 0x0203; |
||||
protected const int WM_RBUTTONDOWN = 0x0204; |
||||
protected const int WM_RBUTTONUP = 0x0205; |
||||
protected const int WM_RBUTTONDBLCLK = 0x0206; |
||||
protected const int WM_MBUTTONDOWN = 0x0207; |
||||
protected const int WM_MBUTTONUP = 0x0208; |
||||
protected const int WM_MBUTTONDBLCLK = 0x0209; |
||||
protected const int WM_KEYDOWN = 0x100; |
||||
protected const int WM_KEYUP = 0x101; |
||||
private static Cursor[] Cursors =new Cursor[10]; |
||||
private static HatchBrush HatchBrush = null; |
||||
private static Pen BlackDottedPen = null; |
||||
private static int HandleSize = 4; |
||||
private static Pen DotedPen=null; |
||||
|
||||
#endregion
|
||||
|
||||
//
|
||||
// Style Flags
|
||||
public enum StyleFlags |
||||
{ |
||||
solidLine = 1, dottedLine = 2, hatchedBorder = 4, |
||||
resizeInside = 8, resizeOutside = 16, hatchInside = 32, |
||||
}; |
||||
|
||||
// Hit-Test codes
|
||||
public enum TrackerHit |
||||
{ |
||||
hitNothing = -1, |
||||
hitTopLeft = 0, hitTopRight = 1, hitBottomRight = 2, hitBottomLeft = 3, |
||||
hitTop = 4, hitRight = 5, hitBottom = 6, hitLeft = 7, hitMiddle = 8 |
||||
}; |
||||
public enum backMode |
||||
{ |
||||
TRANSPARENT= 1, |
||||
OPAQUE= 2 |
||||
}; |
||||
public enum rectPos |
||||
{ |
||||
Left =0, |
||||
Right, |
||||
Top, |
||||
Bottom |
||||
}; |
||||
struct HANDLEINFO |
||||
{ |
||||
public HANDLEINFO(rectPos X,rectPos Y,int CX,int CY,int HX,int HY,int IX,int IY) |
||||
{ |
||||
nOffsetX=X; |
||||
nOffsetY=Y; |
||||
nCenterX=CX; |
||||
nCenterY=CY; |
||||
nHandleX=HX; |
||||
nHandleY=HY; |
||||
nInvertX=IX; |
||||
nInvertY=IY; |
||||
} |
||||
public rectPos nOffsetX; // offset within RECT for X coordinate
|
||||
public rectPos nOffsetY; // offset within RECT for Y coordinate
|
||||
public int nCenterX; // adjust X by Width()/2 * this number
|
||||
public int nCenterY; // adjust Y by Height()/2 * this number
|
||||
public int nHandleX; // adjust X by handle size * this number
|
||||
public int nHandleY; // adjust Y by handle size * this number
|
||||
public int nInvertX; // handle converts to this when X inverted
|
||||
public int nInvertY; // handle converts to this when Y inverted
|
||||
}; |
||||
struct RECTINFO |
||||
{ |
||||
public RECTINFO(rectPos offset,int nsign) |
||||
{ |
||||
nOffsetAcross=offset; |
||||
nSignAcross=nsign; |
||||
} |
||||
public rectPos nOffsetAcross; // offset of opposite point (ie. left->right)
|
||||
public int nSignAcross; // sign relative to that point (ie. add/subtract)
|
||||
} |
||||
|
||||
static HANDLEINFO[] HandleInfo=new HANDLEINFO[]{ |
||||
// corner handles (top-left, top-right, bottom-right, bottom-left
|
||||
new HANDLEINFO(rectPos.Left, rectPos.Top,0, 0, 0, 0, 1, 3 ), |
||||
new HANDLEINFO(rectPos.Right,rectPos.Top,0, 0, -1, 0, 0, 2), |
||||
new HANDLEINFO(rectPos.Right,rectPos.Bottom,0, 0, -1, -1, 3, 1), |
||||
new HANDLEINFO(rectPos.Left, rectPos.Bottom, 0, 0, 0, -1, 2, 0 ), |
||||
// side handles (top, right, bottom, left)
|
||||
new HANDLEINFO(rectPos.Left, rectPos.Top,1, 0, 0, 0, 4, 6), |
||||
new HANDLEINFO(rectPos.Right,rectPos.Top,0, 1, -1, 0, 7, 5), |
||||
new HANDLEINFO(rectPos.Left, rectPos.Bottom, 1, 0, 0, -1, 6, 4 ), |
||||
new HANDLEINFO(rectPos.Left, rectPos.Top,0, 1, 0, 0, 5, 7) |
||||
}; |
||||
static RECTINFO[] RectInfo=new RECTINFO[]{ |
||||
new RECTINFO(rectPos.Right, +1), |
||||
new RECTINFO(rectPos.Bottom, +1), |
||||
new RECTINFO(rectPos.Left,-1), |
||||
new RECTINFO(rectPos.Top, -1 ) |
||||
}; |
||||
// Attributes
|
||||
public StyleFlags m_nStyle; // current state
|
||||
public Rectangle m_rect; // current position (always in pixels)
|
||||
public Size m_sizeMin; // minimum X and Y size during track operation
|
||||
public int m_nHandleSize=0; // size of resize handles (default from WIN.INI)
|
||||
protected bool m_bAllowInvert=false; // flag passed to Track or TrackRubberBand
|
||||
protected Rectangle m_rectLast; |
||||
protected Size m_sizeLast; |
||||
protected bool m_bErase=false; // TRUE if DrawTrackerRect is called for erasing
|
||||
protected bool m_bFinalErase=false; // TRUE if DragTrackerRect called for final erase
|
||||
protected static bool bInitialized=false; |
||||
|
||||
public RectTracker() |
||||
{ |
||||
Construct(); |
||||
m_nHandleSize = 6; |
||||
m_nStyle = StyleFlags.resizeOutside; |
||||
} |
||||
public RectTracker(Rectangle rect, StyleFlags nStyle) |
||||
{ |
||||
Construct(); |
||||
m_rect=rect; |
||||
m_nStyle = nStyle; |
||||
} |
||||
protected void Construct() |
||||
{ |
||||
if(false==bInitialized) |
||||
{ |
||||
// initialize the cursor array
|
||||
Cursors[0] = System.Windows.Forms.Cursors.SizeNWSE; |
||||
Cursors[1] = System.Windows.Forms.Cursors.SizeNESW; |
||||
Cursors[2] = Cursors[0]; |
||||
Cursors[3] = Cursors[1]; |
||||
Cursors[4] = System.Windows.Forms.Cursors.SizeNS; |
||||
Cursors[5] = System.Windows.Forms.Cursors.SizeWE; |
||||
Cursors[6] = Cursors[4]; |
||||
Cursors[7] = Cursors[5]; |
||||
Cursors[8] = System.Windows.Forms.Cursors.SizeAll; |
||||
Cursors[9] = System.Windows.Forms.Cursors.PanSW; |
||||
bInitialized = true; |
||||
BlackDottedPen=new Pen(System.Drawing.Color.Black,1); |
||||
HatchBrush=new HatchBrush(HatchStyle.Percent20,Color.Black,Color.FromArgb(0)); |
||||
DotedPen=new Pen(Color.Black,1); |
||||
DotedPen.DashStyle=DashStyle.Dot; |
||||
} |
||||
m_nStyle = 0; |
||||
m_nHandleSize = HandleSize; |
||||
m_sizeMin.Height = m_sizeMin.Width = m_nHandleSize*2; |
||||
|
||||
m_rectLast=new Rectangle(0,0,0,0); |
||||
m_sizeLast.Width = m_sizeLast.Height = 0; |
||||
m_bErase = false; |
||||
m_bFinalErase = false; |
||||
} |
||||
|
||||
|
||||
// Operations
|
||||
public virtual void Draw(Graphics gs) |
||||
{ |
||||
System.Drawing.Drawing2D.GraphicsState OldState=gs.Save(); |
||||
|
||||
// IntPtr hdc = new IntPtr();
|
||||
// get normalized rectangle
|
||||
Rectangle rect = m_rect; |
||||
NormalizeRect(ref rect); |
||||
|
||||
// draw lines
|
||||
if ((m_nStyle & (StyleFlags.dottedLine|StyleFlags.solidLine)) != 0) |
||||
{ |
||||
if((m_nStyle&StyleFlags.dottedLine)!=0) |
||||
BlackDottedPen.DashStyle=DashStyle.Dot; |
||||
else |
||||
BlackDottedPen.DashStyle=DashStyle.Solid; |
||||
rect.Inflate(new Size(+1, +1)); // borders are one pixel outside
|
||||
gs.DrawRectangle(BlackDottedPen,rect); |
||||
} |
||||
|
||||
|
||||
// hatch inside
|
||||
if ((m_nStyle & StyleFlags.hatchInside) != 0) |
||||
{ |
||||
gs.FillRectangle(HatchBrush,rect.Left+1, rect.Top+1, rect.Width-1, rect.Height-1); |
||||
} |
||||
|
||||
// draw hatched border
|
||||
if (true)//(m_nStyle & StyleFlags.hatchedBorder) != 0)
|
||||
{ |
||||
Rectangle rectTrue=new Rectangle(0,0,0,0); |
||||
GetTrueRect(ref rectTrue); |
||||
gs.FillRectangle(HatchBrush,rectTrue.Left, rectTrue.Top, rectTrue.Width,rect.Top-rectTrue.Top); |
||||
gs.FillRectangle(HatchBrush,rectTrue.Left, rect.Bottom,rectTrue.Width,rectTrue.Bottom-rect.Bottom); |
||||
gs.FillRectangle(HatchBrush,rectTrue.Left, rect.Top, rect.Left-rectTrue.Left,rect.Height); |
||||
gs.FillRectangle(HatchBrush,rect.Right, rect.Top, rectTrue.Right-rect.Right,rect.Height); |
||||
} |
||||
|
||||
// draw resize handles
|
||||
if ((m_nStyle & (StyleFlags.resizeInside|StyleFlags.resizeOutside)) != 0) |
||||
{ |
||||
uint mask = GetHandleMask(); |
||||
for (int i = 0; i < 8; ++i) |
||||
{ |
||||
if ((mask&(1<<i))!=0) |
||||
{ |
||||
GetHandleRect(i, ref rect); |
||||
SolidBrush brush=new SolidBrush(Color.Black); |
||||
Pen pen = new Pen(brush,1); |
||||
SolidBrush brushWhite = new SolidBrush(Color.White); |
||||
gs.FillRectangle(brushWhite,rect); |
||||
gs.DrawRectangle(pen,rect); |
||||
} |
||||
} |
||||
} |
||||
gs.Restore(OldState); |
||||
} |
||||
public void GetTrueRect(ref Rectangle TrueRect) |
||||
{ |
||||
// get normalized rectangle
|
||||
Rectangle rect = m_rect; |
||||
NormalizeRect(ref rect); |
||||
int nInflateBy = 0; |
||||
if ((m_nStyle & (StyleFlags.resizeOutside|StyleFlags.hatchedBorder)) != 0) |
||||
nInflateBy += GetHandleSize(new Rectangle(0,0,0,0)) - 1; |
||||
if ((m_nStyle & (StyleFlags.solidLine|StyleFlags.dottedLine)) != 0) |
||||
++nInflateBy; |
||||
rect.Inflate(new Size(nInflateBy, nInflateBy)); |
||||
TrueRect = rect; |
||||
} |
||||
|
||||
public virtual bool SetCursor(Control frm, uint nHitTest,Point MousePoint) |
||||
{ |
||||
// trackers should only be in client area
|
||||
frm.PointToClient(MousePoint); |
||||
if (!frm.ClientRectangle.Contains(MousePoint)) |
||||
return false; |
||||
|
||||
// convert cursor position to client co-ordinates
|
||||
// do hittest and normalize hit
|
||||
int nHandle = (int)HitTestHandles(MousePoint); |
||||
System.Console.WriteLine("RectTracker SetCursor {0}",nHandle); |
||||
if (nHandle < 0) |
||||
return false; |
||||
|
||||
// need to normalize the hittest such that we get proper cursors
|
||||
nHandle = NormalizeHit(nHandle); |
||||
|
||||
// handle special case of hitting area between handles
|
||||
// (logically the same -- handled as a move -- but different cursor)
|
||||
if (nHandle == (int)TrackerHit.hitMiddle && !m_rect.Contains(MousePoint)) |
||||
{ |
||||
// only for trackers with hatchedBorder (ie. in-place resizing)
|
||||
if ((m_nStyle & StyleFlags.hatchedBorder)!=0) |
||||
nHandle = 9; |
||||
} |
||||
|
||||
Debug.Assert(nHandle < 10); |
||||
frm.Cursor=Cursors[nHandle]; |
||||
return true; |
||||
} |
||||
public virtual bool Track(Control frm, Point point, bool bAllowInvert,Form frmClipTo) |
||||
{ |
||||
// perform hit testing on the handles
|
||||
int nHandle = (int)HitTestHandles(point); |
||||
if (nHandle < 0) |
||||
{ |
||||
// didn't hit a handle, so just return FALSE
|
||||
return false; |
||||
} |
||||
|
||||
// otherwise, call helper function to do the tracking
|
||||
m_bAllowInvert = bAllowInvert; |
||||
return TrackHandle(nHandle, frm, point, frmClipTo); |
||||
} |
||||
public bool TrackRubberBand(Control frm, Point point, bool bAllowInvert) |
||||
{ |
||||
// simply call helper function to track from bottom right handle
|
||||
m_bAllowInvert = bAllowInvert; |
||||
m_rect=new Rectangle(point.X, point.Y,0, 0); |
||||
return TrackHandle((int)TrackerHit.hitBottomRight, frm, point, null); |
||||
} |
||||
public virtual TrackerHit HitTest(Point point) |
||||
{ |
||||
TrackerHit hitResult = TrackerHit.hitNothing; |
||||
|
||||
Rectangle rectTrue=new Rectangle(); |
||||
GetTrueRect(ref rectTrue); |
||||
Debug.Assert(rectTrue.Left <= rectTrue.Right); |
||||
Debug.Assert(rectTrue.Top <= rectTrue.Bottom); |
||||
|
||||
if (rectTrue.Contains(point)) |
||||
{ |
||||
if ((m_nStyle & (StyleFlags.resizeInside|StyleFlags.resizeOutside)) != 0) |
||||
hitResult = HitTestHandles(point); |
||||
else |
||||
hitResult = TrackerHit.hitMiddle; |
||||
} |
||||
return hitResult; |
||||
} |
||||
protected int NormalizeHit(int nHandle) |
||||
{ |
||||
Debug.Assert(nHandle <= 8 && nHandle >= -1); |
||||
if (nHandle == (int)TrackerHit.hitMiddle || nHandle ==(int)TrackerHit.hitNothing) |
||||
return nHandle; |
||||
|
||||
HANDLEINFO handleInfo = HandleInfo[nHandle]; |
||||
if (m_rect.Width< 0) |
||||
{ |
||||
nHandle = handleInfo.nInvertX; |
||||
handleInfo = HandleInfo[nHandle]; |
||||
} |
||||
if (m_rect.Height< 0) |
||||
nHandle = handleInfo.nInvertY; |
||||
return nHandle; |
||||
} |
||||
|
||||
|
||||
private void DrawDragRect(Graphics gs,Rectangle rect,Rectangle rectLast) |
||||
{ |
||||
ControlPaint.DrawReversibleFrame(rectLast,Color.White,FrameStyle.Dashed); |
||||
ControlPaint.DrawReversibleFrame(rect,Color.White,FrameStyle.Dashed); |
||||
|
||||
} |
||||
|
||||
public virtual void DrawTrackerRect(Rectangle Rect, Form ClipToFrm,Graphics gs,Control frm) |
||||
{ |
||||
|
||||
Rectangle rect = Rect; |
||||
// convert to client coordinates
|
||||
if (ClipToFrm != null) |
||||
{ |
||||
rect=ClipToFrm.RectangleToScreen(rect); |
||||
rect=ClipToFrm.RectangleToClient(rect); |
||||
} |
||||
|
||||
Size size=new Size(0, 0); |
||||
if (!m_bFinalErase) |
||||
{ |
||||
// otherwise, size depends on the style
|
||||
if ((m_nStyle & StyleFlags.hatchedBorder)!=0) |
||||
{ |
||||
size.Width = size.Height = Math.Max(1, GetHandleSize(rect)-1); |
||||
rect.Inflate(size); |
||||
} |
||||
else |
||||
{ |
||||
size.Width = CX_BORDER; |
||||
size.Height = CY_BORDER; |
||||
} |
||||
} |
||||
|
||||
if (m_bFinalErase || !m_bErase) |
||||
{ |
||||
Rectangle rcScreen = frm.RectangleToScreen(rect); |
||||
Rectangle rcLast = frm.RectangleToScreen(m_rectLast); |
||||
DrawDragRect(gs,rcScreen,rcLast); |
||||
} |
||||
// remember last rectangles
|
||||
m_rectLast = rect; |
||||
m_sizeLast = size; |
||||
} |
||||
|
||||
public virtual void AdjustRect(int nHandle, ref Rectangle Rect) |
||||
{ |
||||
if (nHandle ==(int)TrackerHit.hitMiddle) |
||||
return; |
||||
|
||||
// convert the handle into locations within m_rect
|
||||
int px=-1, py=-1; |
||||
int ix=-1,iy=-1; |
||||
GetModifyPointers(nHandle,ref px, ref py,ref ix, ref iy,false); |
||||
|
||||
// enforce minimum width
|
||||
int nNewWidth = m_rect.Width; |
||||
int nAbsWidth = m_bAllowInvert ? Math.Abs(nNewWidth) : nNewWidth; |
||||
if (nAbsWidth < m_sizeMin.Width) |
||||
{ |
||||
nNewWidth = nAbsWidth != 0 ? nNewWidth / nAbsWidth : 1; |
||||
RECTINFO refrectinfo=RectInfo[px]; |
||||
px = GetRectInt((int)refrectinfo.nOffsetAcross) + |
||||
nNewWidth * m_sizeMin.Width * -refrectinfo.nSignAcross; |
||||
} |
||||
|
||||
// enforce minimum height
|
||||
int nNewHeight = m_rect.Height; |
||||
int nAbsHeight = m_bAllowInvert ? Math.Abs(nNewHeight) : nNewHeight; |
||||
if ((py != -1)&&(nAbsHeight < m_sizeMin.Height)) |
||||
{ |
||||
nNewHeight = nAbsHeight != 0 ? nNewHeight / nAbsHeight : 1; |
||||
Debug.Assert(py<4); |
||||
RECTINFO refrectinfo=RectInfo[py]; |
||||
py = GetRectInt((int)refrectinfo.nOffsetAcross) + |
||||
nNewHeight * m_sizeMin.Width * -refrectinfo.nSignAcross; |
||||
} |
||||
} |
||||
|
||||
public virtual void OnChangedRect(Rectangle rectOld) |
||||
{ |
||||
} |
||||
|
||||
public virtual uint GetHandleMask() |
||||
{ |
||||
uint mask = 0x0F; // always have 4 corner handles
|
||||
int size = m_nHandleSize*3; |
||||
if (Math.Abs(m_rect.Width) - size > 4) |
||||
mask |= 0x50; |
||||
if (Math.Abs(m_rect.Height) - size > 4) |
||||
mask |= 0xA0; |
||||
return mask; |
||||
} |
||||
|
||||
protected virtual TrackerHit HitTestHandles(Point point) |
||||
{ |
||||
Rectangle Truerect=new Rectangle(0,0,0,0); |
||||
uint mask = GetHandleMask(); |
||||
|
||||
// see if hit anywhere inside the tracker
|
||||
GetTrueRect(ref Truerect); |
||||
if (!Truerect.Contains(point)) |
||||
return TrackerHit.hitNothing; // totally missed
|
||||
|
||||
// see if we hit a handle
|
||||
for (int i = 0; i < 8; ++i) |
||||
{ |
||||
if((mask&(1<<i))!=0) |
||||
{ |
||||
GetHandleRect(i, ref Truerect); |
||||
if (Truerect.Contains(point)) |
||||
return (TrackerHit)i; |
||||
} |
||||
} |
||||
|
||||
// last of all, check for non-hit outside of object, between resize handles
|
||||
if ((m_nStyle & StyleFlags.hatchedBorder) == 0) |
||||
{ |
||||
// get normalized rectangle
|
||||
Rectangle rect = m_rect; |
||||
NormalizeRect(ref rect); |
||||
if ((m_nStyle & (StyleFlags.dottedLine|StyleFlags.solidLine)) != 0) |
||||
rect.Inflate(+1, +1); |
||||
if (!rect.Contains(point)) |
||||
return TrackerHit.hitNothing; // must have been between resize handles
|
||||
} |
||||
return TrackerHit.hitMiddle; // no handle hit, but hit object (or object border)
|
||||
} |
||||
|
||||
protected void GetHandleRect(int nHandle, ref Rectangle Changerect) |
||||
{ |
||||
System.Diagnostics.Debug.Assert(nHandle < 8); |
||||
|
||||
// get normalized rectangle of the tracker
|
||||
Rectangle rectT = m_rect; |
||||
NormalizeRect(ref rectT); |
||||
|
||||
if ((m_nStyle & (StyleFlags.solidLine|StyleFlags.dottedLine)) != 0) |
||||
rectT.Inflate(+1, +1); |
||||
|
||||
// since the rectangle itself was normalized, we also have to invert the
|
||||
// resize handles.
|
||||
nHandle = NormalizeHit(nHandle); |
||||
|
||||
// handle case of resize handles outside the tracker
|
||||
int size = GetHandleSize(new Rectangle()); |
||||
if ((m_nStyle&StyleFlags.resizeOutside)!=0) |
||||
rectT.Inflate(size, size); |
||||
|
||||
// calculate position of the resize handle
|
||||
int nWidth = rectT.Width; |
||||
int nHeight = rectT.Height; |
||||
Rectangle rect=new Rectangle(); |
||||
HANDLEINFO handleInfo = HandleInfo[nHandle]; |
||||
int[] arr=new int[4]{rectT.Left,rectT.Right,rectT.Top,rectT.Bottom}; |
||||
|
||||
rect.X = arr[(int)handleInfo.nOffsetX]; |
||||
rect.Y = arr[(int)handleInfo.nOffsetY]; |
||||
rect.X += size * handleInfo.nHandleX; |
||||
rect.Y += size * handleInfo.nHandleY; |
||||
rect.X += handleInfo.nCenterX * (nWidth - size) / 2; |
||||
rect.Y += handleInfo.nCenterY * (nHeight - size) / 2; |
||||
rect.Width = size; |
||||
rect.Height = size; |
||||
|
||||
Changerect = rect; |
||||
} |
||||
|
||||
protected int GetRectInt(int index) |
||||
{ |
||||
switch(index) |
||||
{ |
||||
case 0: |
||||
return m_rect.Left; |
||||
case 1: |
||||
return m_rect.Right; |
||||
case 2: |
||||
return m_rect.Top; |
||||
case 3: |
||||
return m_rect.Bottom; |
||||
default: |
||||
return -1; |
||||
} |
||||
} |
||||
|
||||
protected void SetRectInt(int index,int p) |
||||
{ |
||||
if( p >= 32768) |
||||
p=0; |
||||
switch(index) |
||||
{ |
||||
case 0://left
|
||||
m_rect.Width += (m_rect.X - p); |
||||
m_rect.X = p; |
||||
break; |
||||
case 1://right
|
||||
m_rect.Width = p - m_rect.X; |
||||
break; |
||||
case 2://top
|
||||
m_rect.Height += m_rect.Y - p; |
||||
m_rect.Y = p ; |
||||
break; |
||||
case 3://bottom
|
||||
m_rect.Height = p - m_rect.Y; |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
|
||||
} |
||||
|
||||
protected void GetModifyPointers(int nHandle,ref int ppx,ref int ppy,ref int px,ref int py,bool bModify) |
||||
{ |
||||
Debug.Assert(nHandle >= 0); |
||||
Debug.Assert(nHandle <= 8); |
||||
|
||||
if (nHandle ==(int)TrackerHit.hitMiddle) |
||||
nHandle = (int)TrackerHit.hitTopLeft; // same as hitting top-left
|
||||
|
||||
ppx = -1; |
||||
ppy = -1; |
||||
|
||||
// fill in the part of the rect that this handle modifies
|
||||
// (Note: handles that map to themselves along a given axis when that
|
||||
// axis is inverted don't modify the value on that axis)
|
||||
|
||||
HANDLEINFO handleInfo = HandleInfo[nHandle]; |
||||
|
||||
if (handleInfo.nInvertX != nHandle) |
||||
{ |
||||
ppx=(int)handleInfo.nOffsetX; |
||||
if (bModify) |
||||
px = GetRectInt(ppx); |
||||
} |
||||
else |
||||
{ |
||||
// middle handle on X axis
|
||||
if (bModify) |
||||
px = m_rect.Left + Math.Abs(m_rect.Width) / 2; |
||||
} |
||||
if (handleInfo.nInvertY != nHandle) |
||||
{ |
||||
ppy=(int)handleInfo.nOffsetY; |
||||
if (bModify) |
||||
py = GetRectInt(ppy); |
||||
} |
||||
else |
||||
{ |
||||
// middle handle on Y axis
|
||||
if (bModify) |
||||
py = m_rect.Top + Math.Abs(m_rect.Height) / 2; |
||||
} |
||||
} |
||||
|
||||
protected virtual int GetHandleSize(Rectangle rect) |
||||
{ |
||||
if (rect.IsEmpty) |
||||
rect = m_rect; |
||||
|
||||
int size = m_nHandleSize; |
||||
if ((m_nStyle & StyleFlags.resizeOutside)==0) |
||||
{ |
||||
// make sure size is small enough for the size of the rect
|
||||
int sizeMax = Math.Min(Math.Abs(rect.Right - rect.Left),Math.Abs(rect.Bottom - rect.Top)); |
||||
if (size * 2 > sizeMax) |
||||
size = sizeMax / 2; |
||||
} |
||||
return size; |
||||
} |
||||
|
||||
protected bool TrackHandle(int nHandle,Control frm,Point point,Form frmClipTo) |
||||
{ |
||||
Debug.Assert(nHandle >= 0); |
||||
Debug.Assert(nHandle <= 8); // handle 8 is inside the rect
|
||||
|
||||
// don't handle if capture already set
|
||||
//if(frm.Capture) return false;
|
||||
|
||||
Debug.Assert(!m_bFinalErase); |
||||
|
||||
// save original width & height in pixels
|
||||
int nWidth = m_rect.Width; |
||||
int nHeight = m_rect.Height; |
||||
|
||||
// set capture to the window which received this message
|
||||
frm.Capture=true; |
||||
Debug.Assert(frm.Capture); |
||||
frm.Update(); |
||||
if (frmClipTo!=null) |
||||
frmClipTo.Update(); |
||||
Rectangle rectSave = m_rect; |
||||
|
||||
// find out what x/y coords we are supposed to modify
|
||||
int px=0, py=0; |
||||
int xDiff=0, yDiff=0; |
||||
GetModifyPointers(nHandle,ref px,ref py,ref xDiff,ref yDiff,true); |
||||
xDiff = point.X - xDiff; |
||||
yDiff = point.Y - yDiff; |
||||
|
||||
// get DC for drawing
|
||||
Graphics gs; |
||||
if (frmClipTo!=null) |
||||
{ |
||||
// clip to arbitrary window by using adjusted Window DC
|
||||
gs=frmClipTo.CreateGraphics(); |
||||
} |
||||
else |
||||
{ |
||||
// otherwise, just use normal DC
|
||||
gs=frm.CreateGraphics(); |
||||
} |
||||
|
||||
Rectangle rectOld; |
||||
bool bMoved = false; |
||||
|
||||
// get messages until capture lost or cancelled/accepted
|
||||
for (;;) |
||||
{ |
||||
MSG msg=new MSG(); |
||||
if(GetMessage(ref msg, 0, 0, 0)!=1) break; |
||||
if(!frm.Capture) break; |
||||
|
||||
switch (msg.message) |
||||
{ |
||||
// handle movement/accept messages
|
||||
case WM_LBUTTONUP: |
||||
case WM_MOUSEMOVE: |
||||
rectOld = m_rect; |
||||
// handle resize cases (and part of move)
|
||||
SetRectInt(px,LoWord(msg.lParam) - xDiff); |
||||
SetRectInt(py,HiWord(msg.lParam) - yDiff); |
||||
// handle move case
|
||||
if (nHandle == (int)TrackerHit.hitMiddle) |
||||
{ |
||||
m_rect.Width=nWidth; |
||||
m_rect.Height=nHeight; |
||||
} |
||||
// allow caller to adjust the rectangle if necessary
|
||||
AdjustRect(nHandle,ref m_rect); |
||||
|
||||
// only redraw and callback if the rect actually changed!
|
||||
m_bFinalErase = (msg.message == WM_LBUTTONUP); |
||||
if (m_bFinalErase) |
||||
goto ExitLoop; |
||||
|
||||
if (!rectOld.Equals(m_rect) || m_bFinalErase) |
||||
{ |
||||
if (bMoved) |
||||
{ |
||||
m_bErase = true; |
||||
DrawTrackerRect(rectOld, frmClipTo, gs, frm); |
||||
} |
||||
OnChangedRect(rectOld); |
||||
if (msg.message != WM_LBUTTONUP) |
||||
bMoved = true; |
||||
} |
||||
if (m_bFinalErase) |
||||
goto ExitLoop; |
||||
|
||||
if (!rectOld.Equals(m_rect)) |
||||
{ |
||||
m_bErase = false; |
||||
DrawTrackerRect(m_rect, frmClipTo, gs, frm); |
||||
} |
||||
break; |
||||
|
||||
// handle cancel messages
|
||||
case WM_KEYDOWN: |
||||
if (msg.wParam != 0x1B)//VK_ESCAPE
|
||||
break; |
||||
goto default; |
||||
case WM_RBUTTONDOWN: |
||||
if (bMoved) |
||||
{ |
||||
m_bErase = m_bFinalErase = true; |
||||
DrawTrackerRect(m_rect, frmClipTo, gs, frm); |
||||
} |
||||
m_rect = rectSave; |
||||
goto ExitLoop; |
||||
|
||||
// just dispatch rest of the messages
|
||||
default: |
||||
DispatchMessage(ref msg); |
||||
break; |
||||
} |
||||
} |
||||
|
||||
ExitLoop: |
||||
gs.Dispose(); |
||||
frm.Capture=false; |
||||
// restore rect in case bMoved is still FALSE
|
||||
if (!bMoved) |
||||
m_rect = rectSave; |
||||
m_bFinalErase = false; |
||||
m_bErase = false; |
||||
|
||||
// return TRUE only if rect has changed
|
||||
return !rectSave.Equals(m_rect); |
||||
} |
||||
|
||||
public void NormalizeRect(ref Rectangle rect) |
||||
{ |
||||
Rectangle rc = new Rectangle(rect.Location,rect.Size); |
||||
if(rect.Left > rect.Right) |
||||
{ |
||||
rc.Width = -rect.Width; |
||||
rc.X = rect.Right; |
||||
} |
||||
if(rect.Top > rect.Bottom) |
||||
{ |
||||
rc.Height = -rect.Height; |
||||
rc.Y = rect.Bottom; |
||||
} |
||||
rect = rc; |
||||
} |
||||
|
||||
#region Helper functions
|
||||
|
||||
static int MakeLong(int LoWord, int HiWord) |
||||
{ |
||||
return (HiWord << 16) | (LoWord & 0xffff); |
||||
} |
||||
|
||||
static IntPtr MakeLParam(int LoWord, int HiWord) |
||||
{ |
||||
return (IntPtr) ((HiWord << 16) | (LoWord & 0xffff)); |
||||
} |
||||
|
||||
static int HiWord(int Number) |
||||
{ |
||||
return (Number >> 16) & 0xffff; |
||||
} |
||||
|
||||
static int LoWord(int Number) |
||||
{ |
||||
return Number & 0xffff; |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,66 +0,0 @@
@@ -1,66 +0,0 @@
|
||||
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This Class is used for drawing Circles
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.01.2005 15:49:38
|
||||
/// </remarks>
|
||||
namespace SharpReport.Designer{ |
||||
|
||||
internal class ReportCircleControl : AbstractGraphicControl{ |
||||
EllipseShape shape = new EllipseShape(); |
||||
|
||||
public ReportCircleControl():base(){ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
|
||||
} |
||||
|
||||
#region overrides
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea){ |
||||
base.OnPaint(pea); |
||||
base.DrawEdges (pea); |
||||
shape.FillShape(pea.Graphics, |
||||
new SolidFillPattern(this.BackColor), |
||||
(RectangleF)this.ClientRectangle); |
||||
shape.DrawShape (pea.Graphics, |
||||
new BaseLine (this.ForeColor,base.DashStyle,base.Thickness), |
||||
(RectangleF)this.ClientRectangle); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return this.Name; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "ReportCircleControl"; |
||||
this.Size = new System.Drawing.Size(50, 50); |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
} |
||||
} |
@ -1,179 +0,0 @@
@@ -1,179 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 9.48 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Base Class of all Visible Controls like Graphic or textbased Item's
|
||||
/// </summary>
|
||||
|
||||
public abstract class ReportControlBase : ReportObjectControlBase, |
||||
INotifyPropertyChanged{ |
||||
|
||||
private ControlHelper controlHelper; |
||||
|
||||
private const string contextMenuPath = "/SharpReport/ContextMenu/Items"; |
||||
|
||||
private bool selected; |
||||
|
||||
|
||||
internal ReportControlBase(){ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
controlHelper = new ControlHelper((Control)this); |
||||
} |
||||
|
||||
private ITracker GetParent { |
||||
get { |
||||
if (this.Parent is Panel) { |
||||
ITracker t = this.Parent.Parent as ITracker; |
||||
if (t != null) { |
||||
return t; |
||||
} else { |
||||
System.Console.WriteLine("!!!!!!!!! NO TRACKER !!!!"); |
||||
return null; |
||||
|
||||
} |
||||
} else { |
||||
ITracker ct = this.Parent as ITracker; |
||||
if (ct != null) { |
||||
return ct; |
||||
}else { |
||||
System.Console.WriteLine("!!!!!!!!! NO TRACKER !!!!"); |
||||
return null; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
private void NotifySelected() { |
||||
|
||||
this.GetParent.SelectedControl = this; |
||||
this.GetParent.InvalidateEx(); |
||||
this.OnClick (EventArgs.Empty); |
||||
} |
||||
|
||||
|
||||
private void NotifyUnSelected () { |
||||
this.selected = false; |
||||
this.GetParent.SelectedControl = null; |
||||
this.GetParent.InvalidateEx(); |
||||
} |
||||
|
||||
|
||||
private void OnMouseDown (object sender, MouseEventArgs e) { |
||||
ITracker tracker = this.GetParent; |
||||
if (tracker != null) { |
||||
tracker.ClearSelections(); |
||||
tracker.RectTracker.m_rect = this.Bounds; |
||||
this.selected = true; |
||||
this.NotifySelected(); |
||||
tracker.SelectedControl = this; |
||||
} |
||||
this.selected = true; |
||||
} |
||||
|
||||
|
||||
private void OnMouseUp(object sender, MouseEventArgs e){ |
||||
|
||||
if (e.Button == MouseButtons.Right) { |
||||
ContextMenuStrip ctMen = MenuService.CreateContextMenu (this,contextMenuPath); |
||||
ctMen.Show (this,new Point (e.X,e.Y)); |
||||
this.NotifyUnSelected(); |
||||
} |
||||
|
||||
} |
||||
|
||||
protected void DrawEdges (PaintEventArgs e,Rectangle rectangle) { |
||||
controlHelper.DrawEdges(e,rectangle); |
||||
} |
||||
|
||||
|
||||
protected void DrawEdges (PaintEventArgs e) { |
||||
controlHelper.DrawEdges(e); |
||||
} |
||||
|
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){ |
||||
base.OnPaint(e); |
||||
if (this.selected) { |
||||
RectTracker tracker = this.GetParent.RectTracker; |
||||
if (tracker != null) { |
||||
tracker.m_rect = this.Bounds; |
||||
tracker.Draw(this.GetParent.DesignSurface.CreateGraphics()); |
||||
} |
||||
} |
||||
} |
||||
|
||||
protected override void OnResize(EventArgs e){ |
||||
base.OnResize(e); |
||||
this.Invalidate(); |
||||
} |
||||
|
||||
protected ControlHelper ControlHelper { |
||||
get { |
||||
return controlHelper; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
protected Rectangle FocusRectangle { |
||||
get {return this.controlHelper.BuildFocusRectangle;} |
||||
} |
||||
|
||||
public bool Selected { |
||||
set { |
||||
selected = value; |
||||
} |
||||
} |
||||
|
||||
#region SharpReportCore.IPropertyChange interface implementation
|
||||
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
public void NotifyPropertyChanged(string property) { |
||||
if (this.PropertyChanged != null) { |
||||
this.PropertyChanged(this,new System.ComponentModel.PropertyChangedEventArgs (property)); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.SuspendLayout(); |
||||
//
|
||||
// ReportControlBase
|
||||
//
|
||||
this.Name = "ReportControlBase"; |
||||
this.Size = new System.Drawing.Size(292, 56); |
||||
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnMouseUp); |
||||
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseDown); |
||||
this.ResumeLayout(false); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 9.31 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of ReportDbTextItem.
|
||||
/// </summary>
|
||||
|
||||
internal class ReportDbTextControl : ReportTextControl{ |
||||
|
||||
public ReportDbTextControl():base(){ |
||||
InitializeComponent(); |
||||
this.Size = GlobalValues.PreferedSize; |
||||
base.Name = this.Name; |
||||
} |
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea){ |
||||
base.Text = this.Text; |
||||
base.OnPaint(pea); |
||||
} |
||||
|
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "ReportDbTextItem"; |
||||
this.Size = new System.Drawing.Size(120, 20); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,95 +0,0 @@
@@ -1,95 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReport.Designer; |
||||
|
||||
/// <summary>
|
||||
/// This Class acts as a Control to display images
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 04.10.2005 11:09:39
|
||||
/// </remarks>
|
||||
namespace SharpReport.ReportItems { |
||||
|
||||
public class ReportImageControl : AbstractGraphicControl { |
||||
|
||||
private Image image; |
||||
private bool scaleImageToSize; |
||||
|
||||
public ReportImageControl() { |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
} |
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea) { |
||||
base.OnPaint (pea); |
||||
base.DrawEdges (pea); |
||||
|
||||
if (this.image != null) { |
||||
if (this.scaleImageToSize) { |
||||
pea.Graphics.DrawImageUnscaled(image,0,0); |
||||
} else { |
||||
pea.Graphics.DrawImage(image,0,0,this.Width,this.Height); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return this.Name; |
||||
} |
||||
|
||||
|
||||
|
||||
public Image Image { |
||||
get { |
||||
return image; |
||||
} |
||||
set { |
||||
image = value; |
||||
} |
||||
} |
||||
|
||||
public bool ScaleImageToSize { |
||||
get { |
||||
return scaleImageToSize; |
||||
} |
||||
set { |
||||
scaleImageToSize = value; |
||||
} |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportGraphicControl
|
||||
//
|
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "ReportImageControl"; |
||||
this.Size = new System.Drawing.Size(72, 20); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,70 +0,0 @@
@@ -1,70 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This Class is used for drawing Lines
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.01.2005 15:49:38
|
||||
/// </remarks>
|
||||
namespace SharpReport.Designer{ |
||||
internal class ReportLineControl : AbstractGraphicControl { |
||||
LineShape shape = new LineShape(); |
||||
public ReportLineControl() { |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
} |
||||
|
||||
#region overrides
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea) { |
||||
base.OnPaint(pea); |
||||
base.DrawEdges (pea); |
||||
// base.DrawDecorations(pea);
|
||||
|
||||
shape.DrawShape(pea.Graphics, |
||||
new BaseLine (this.ForeColor,base.DashStyle,base.Thickness), |
||||
(RectangleF)this.ClientRectangle); |
||||
} |
||||
public override string ToString() { |
||||
return this.Name; |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportGraphicControl
|
||||
//
|
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "ReportLineControl"; |
||||
this.Size = new System.Drawing.Size(72, 10); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,79 +0,0 @@
@@ -1,79 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 10/10/2004 |
||||
* Time: 14.55 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// All report objects such as Sections and Items
|
||||
/// should derive from ReportObjectBase so they can
|
||||
/// show theirs properties in the property window
|
||||
/// and can have some common members managed easier.
|
||||
/// </summary>
|
||||
|
||||
public abstract class ReportObjectControlBase : UserControl { |
||||
|
||||
/// <summary>
|
||||
/// This Event fire's when anything in the VisualControl Design changes like
|
||||
/// Size,Location,BackColor etc.
|
||||
/// </summary>
|
||||
public event EventHandler VisualControlChanged; |
||||
|
||||
#region Constructor
|
||||
internal ReportObjectControlBase(){ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
public void NotifyControlChanged () { |
||||
if ( VisualControlChanged != null ) { |
||||
VisualControlChanged (this,EventArgs.Empty); |
||||
} |
||||
} |
||||
|
||||
#region Properties
|
||||
// Some report object such as Sections
|
||||
// does not coincide with the "rendered object"
|
||||
// so "this" identifies the whole report object
|
||||
// and "Body" identifies the rendered control
|
||||
public virtual Control Body{ |
||||
get { |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportObjectBase
|
||||
//
|
||||
this.Name = "ReportObjectBase"; |
||||
this.Size = new System.Drawing.Size(120, 56); |
||||
} |
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,76 +0,0 @@
@@ -1,76 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// UserCOntrol for rectangle in the Designer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.01.2005 15:50:40
|
||||
/// </remarks>
|
||||
namespace SharpReport.Designer { |
||||
internal class ReportRectangleControl : AbstractGraphicControl { |
||||
|
||||
RectangleShape shape = new RectangleShape(); |
||||
|
||||
public ReportRectangleControl() { |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
} |
||||
#region overrides
|
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea) { |
||||
base.OnPaint(pea); |
||||
|
||||
shape.FillShape(pea.Graphics, |
||||
new SolidFillPattern(this.BackColor), |
||||
(RectangleF)base.FocusRectangle); |
||||
|
||||
shape.DrawShape (pea.Graphics, |
||||
new BaseLine (this.ForeColor,base.DashStyle,base.Thickness), |
||||
(RectangleF)base.FocusRectangle); |
||||
} |
||||
|
||||
|
||||
public override string ToString() { |
||||
return this.Name; |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportRectangleControl
|
||||
//
|
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "ReportRectangleControl"; |
||||
this.Size = new System.Drawing.Size(72, 40); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,85 +0,0 @@
@@ -1,85 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 01.03.2006 |
||||
* Time: 14:29 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
|
||||
/// <summary>
|
||||
/// Description of ReportTableControl.
|
||||
/// </summary>
|
||||
|
||||
internal class ReportRowControl:ContainerControl{ |
||||
|
||||
private RectangleShape shape = new RectangleShape(); |
||||
private bool drawBorder; |
||||
|
||||
public ReportRowControl():base(){ |
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
|
||||
this.Size = new Size((GlobalValues.PreferedSize.Width * 2) + 10, |
||||
GlobalValues.PreferedSize.Height + 10); |
||||
} |
||||
|
||||
|
||||
#region overrides
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea){ |
||||
base.OnPaint(pea); |
||||
base.DrawEdges (pea, |
||||
new Rectangle(0,5,this.ClientSize.Width - 1,this.ClientSize.Height - 6) ); |
||||
|
||||
if (this.drawBorder) { |
||||
shape.DrawShape (pea.Graphics, |
||||
new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1), |
||||
base.FocusRectangle); |
||||
} |
||||
ControlHelper.DrawHeadLine(this,pea); |
||||
|
||||
} |
||||
|
||||
public override string ToString() { |
||||
return this.GetType().Name; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
public bool DrawBorder { |
||||
set { |
||||
drawBorder = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportRectangleControl
|
||||
//
|
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "Row"; |
||||
this.Size = new System.Drawing.Size(72, 40); |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,179 +0,0 @@
@@ -1,179 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 09.07.2006 |
||||
* Time: 15:39 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Designer |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ReportTableControl.
|
||||
/// </summary>
|
||||
public class ReportTableControl:ContainerControl |
||||
{ |
||||
private RectangleShape shape = new RectangleShape(); |
||||
private bool drawBorder; |
||||
private Padding padding = new Padding (5,12,5,5); |
||||
private ReportRowControl headerRow; |
||||
private ReportRowControl detailRow; |
||||
private ReportRowControl footerRow; |
||||
public ReportTableControl() |
||||
{ |
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
this.Padding = padding; |
||||
|
||||
this.headerRow = new ReportRowControl(); |
||||
this.headerRow.Location = new Point (this.Padding.Left,this.Padding.Top); |
||||
this.headerRow.Size = new Size (this.Width - this.Padding.Left - this.Padding.Right,this.headerRow.Size.Height); |
||||
this.headerRow.BackColor = Color.LightGray; |
||||
this.headerRow.Dock = DockStyle.Top; |
||||
this.Controls.Add(headerRow); |
||||
|
||||
System.Console.WriteLine("\tHeader Location {0}",this.headerRow.Location); |
||||
this.detailRow = new ReportRowControl(); |
||||
this.detailRow.Location = new Point (this.Padding.Left, |
||||
this.Padding.Top + this.headerRow.Size.Height + this.padding.Top); |
||||
this.detailRow.Size = new Size (this.Width - this.Padding.Left - this.Padding.Right,this.detailRow.Size.Height); |
||||
this.detailRow.BackColor = Color.Azure; |
||||
// this.Controls.Add(detailRow);
|
||||
|
||||
|
||||
System.Console.WriteLine("\tDetail Location {0}",this.detailRow.Location); |
||||
|
||||
|
||||
this.footerRow = new ReportRowControl(); |
||||
|
||||
this.footerRow.Location = new Point (this.Padding.Left, |
||||
this.Padding.Top + this.detailRow.Location.Y + this.detailRow.Size.Height + this.padding.Top); |
||||
this.footerRow.Size = new Size (this.Width - this.Padding.Left - this.Padding.Right,this.footerRow.Size.Height); |
||||
this.footerRow.BackColor = Color.LightBlue; |
||||
this.footerRow.Parent = this; |
||||
// this.footerRow.Anchor = AnchorStyles.Bottom;
|
||||
this.footerRow.Dock = DockStyle.Bottom; |
||||
|
||||
this.Controls.Add(footerRow); |
||||
System.Console.WriteLine("\tfooter Location {0}",this.footerRow.Location); |
||||
int h,w; |
||||
h = this.headerRow.Size.Height + this.detailRow.Size.Height + this.footerRow.Size.Height; |
||||
h = h + (3 * this.padding.Top) + this.padding.Bottom; |
||||
w = (GlobalValues.PreferedSize.Width * 2) + 10; |
||||
|
||||
this.Size = new Size(w,h); |
||||
|
||||
this.Resize += new EventHandler(OnResize); |
||||
} |
||||
|
||||
private void OnResize (object sender, EventArgs e) { |
||||
System.Console.WriteLine(""); |
||||
// System.Console.WriteLine("TabaleControl:Resize");
|
||||
// System.Console.WriteLine("");
|
||||
//
|
||||
// int h,w;
|
||||
// h = this.headerRow.Size.Height + this.detailRow.Size.Height + this.footerRow.Size.Height;
|
||||
// h = h + (3 * this.padding.Top) + this.padding.Bottom;
|
||||
// w = (GlobalValues.PreferedSize.Width * 2) + 10;
|
||||
//
|
||||
// this.Size = new Size(w,h);
|
||||
} |
||||
|
||||
#region overrides
|
||||
protected override void OnPaint(PaintEventArgs pea){ |
||||
System.Console.WriteLine(""); |
||||
System.Console.WriteLine("TableOnPaint"); |
||||
|
||||
base.OnPaint(pea); |
||||
this.headerRow.Invalidate(); |
||||
this.detailRow.Invalidate(); |
||||
this.footerRow.Invalidate(); |
||||
base.DrawEdges (pea, |
||||
new Rectangle(0,5, |
||||
this.ClientSize.Width - 1,this.ClientSize.Height - 6) ); |
||||
|
||||
// ControlHelper.DrawHeadLine(this,pea);
|
||||
pea.Graphics.DrawString("Table",new Font("Microsoft Sans Serif", |
||||
6), |
||||
new SolidBrush(Color.Gray), |
||||
new RectangleF(this.padding.Left,1,pea.ClipRectangle.Width,12) ); |
||||
} |
||||
|
||||
|
||||
public override string ToString() { |
||||
|
||||
return this.GetType().Name; |
||||
} |
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public bool DrawBorder { |
||||
set { |
||||
drawBorder = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
#region FormsDesigner
|
||||
|
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the control.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
|
||||
|
||||
this.SuspendLayout(); |
||||
|
||||
//
|
||||
// ReportTableControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
|
||||
this.Name = "Table"; |
||||
this.Size = new System.Drawing.Size(200,40); |
||||
this.ResumeLayout(false); |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,114 +0,0 @@
@@ -1,114 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 9.30 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Description of ReportTextItem.
|
||||
/// </summary>
|
||||
internal class ReportTextControl : ReportControlBase{ |
||||
|
||||
private StringTrimming stringTrimming; |
||||
private ContentAlignment contentAlignment; |
||||
private bool drawBorder; |
||||
|
||||
private TextDrawer textDrawer = new TextDrawer(); |
||||
private RectangleShape shape = new RectangleShape(); |
||||
|
||||
public ReportTextControl():base(){ |
||||
InitializeComponent(); |
||||
|
||||
this.SetStyle(ControlStyles.DoubleBuffer | |
||||
ControlStyles.UserPaint | |
||||
ControlStyles.AllPaintingInWmPaint | |
||||
ControlStyles.ResizeRedraw, |
||||
true); |
||||
this.UpdateStyles(); |
||||
this.Size = GlobalValues.PreferedSize; |
||||
} |
||||
|
||||
public bool DrawBorder { |
||||
set { |
||||
drawBorder = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public override string Text{ |
||||
get { return base.Text; } |
||||
set { base.Text = value;} |
||||
} |
||||
|
||||
|
||||
public StringTrimming StringTrimming { |
||||
set { |
||||
stringTrimming = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
|
||||
public System.Drawing.ContentAlignment ContentAlignment { |
||||
set { |
||||
this.contentAlignment = value; |
||||
this.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea){ |
||||
|
||||
base.OnPaint(pea); |
||||
base.DrawEdges (pea); |
||||
|
||||
string str; |
||||
|
||||
if (String.IsNullOrEmpty(this.Text)) { |
||||
str = this.Name; |
||||
} else { |
||||
str = this.Text; |
||||
} |
||||
|
||||
if (this.drawBorder) { |
||||
shape.DrawShape (pea.Graphics, |
||||
new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1), |
||||
base.FocusRectangle); |
||||
} |
||||
|
||||
this.textDrawer.DrawString (pea.Graphics,this.Text,this.Font, |
||||
new SolidBrush(this.ForeColor),(RectangleF)this.ClientRectangle, |
||||
this.stringTrimming,this.contentAlignment); |
||||
|
||||
} |
||||
|
||||
|
||||
#region Windows Forms Designer generated code
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() { |
||||
//
|
||||
// ReportTextItem
|
||||
//
|
||||
this.BackColor = System.Drawing.Color.White; |
||||
this.Name = "ReportTextItem"; |
||||
this.Size = new System.Drawing.Size(120, 20); |
||||
} |
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,67 +0,0 @@
@@ -1,67 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 06.11.2004 |
||||
* Time: 10:30 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Xml; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Designer{ |
||||
/// <summary>
|
||||
/// Helperclass with static Members for Xml
|
||||
/// </summary>
|
||||
///
|
||||
public class XmlHelpers { |
||||
/// <summary>
|
||||
/// Set the values for AbstrctColumns like for sorting etc
|
||||
/// </summary>
|
||||
/// <param name="reader">See XMLFormReader</param>
|
||||
/// <param name="item">AbstractColumn</param>
|
||||
/// <param name="ctrlElem">Element witch contains the values</param>
|
||||
public static void BuildAbstractColumn (XmlFormReader reader, |
||||
XmlElement ctrlElem, |
||||
AbstractColumn item) { |
||||
|
||||
try { |
||||
XmlNodeList nodeList = ctrlElem.ChildNodes; |
||||
foreach (XmlNode node in nodeList) { |
||||
if (node is XmlElement) { |
||||
XmlElement elem = (XmlElement)node; |
||||
if (elem.HasAttribute("value")) { |
||||
reader.SetValue (item,elem.Name,elem.GetAttribute("value")); |
||||
} |
||||
} |
||||
} |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
/// <summary>
|
||||
/// This Class fills an Reportparameter
|
||||
/// </summary>
|
||||
/// <param name="reader">See XMLFormReader</param>
|
||||
/// <param name="parElement">XmlElement ReportParameter</param>
|
||||
/// <param name="item"><see cref="ReportParameter"</param>
|
||||
public static void BuildReportParameter(XmlFormReader reader, |
||||
XmlElement parElement, |
||||
SharpReportCore.AbstractParameter item) { |
||||
try { |
||||
XmlNodeList nodeList = parElement.ChildNodes; |
||||
foreach (XmlNode node in nodeList) { |
||||
XmlElement elem = (XmlElement)node; |
||||
if (elem.HasAttribute("value")) { |
||||
reader.SetValue ((SqlParameter)item,elem.Name,elem.GetAttribute("value")); |
||||
} |
||||
} |
||||
} catch (Exception) { |
||||
|
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,142 +0,0 @@
@@ -1,142 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 09.08.2006 |
||||
* Time: 13:55 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport{ |
||||
/// <summary>
|
||||
/// Description of ParameterDialog.
|
||||
/// </summary>
|
||||
public class ParameterDialog : System.Windows.Forms.Form |
||||
{ |
||||
private SqlParametersCollection collection; |
||||
public ParameterDialog(SqlParametersCollection collection):this(){ |
||||
|
||||
this.collection = collection; |
||||
this.dataGrid1.DataSource = this.collection; |
||||
} |
||||
|
||||
public ParameterDialog() |
||||
{ |
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent(); |
||||
} |
||||
|
||||
#region Designer generated
|
||||
|
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.dataGrid1 = new System.Windows.Forms.DataGrid(); |
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); |
||||
this.cancelButton = new System.Windows.Forms.Button(); |
||||
this.okButton = new System.Windows.Forms.Button(); |
||||
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); |
||||
this.tableLayoutPanel1.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// dataGrid1
|
||||
//
|
||||
this.dataGrid1.DataMember = ""; |
||||
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; |
||||
this.dataGrid1.Location = new System.Drawing.Point(48, 26); |
||||
this.dataGrid1.Name = "dataGrid1"; |
||||
this.dataGrid1.Size = new System.Drawing.Size(363, 120); |
||||
this.dataGrid1.TabIndex = 1; |
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2; |
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 77.28119F)); |
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 22.71881F)); |
||||
this.tableLayoutPanel1.Controls.Add(this.cancelButton, 1, 0); |
||||
this.tableLayoutPanel1.Controls.Add(this.okButton, 0, 0); |
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; |
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(10, 175); |
||||
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(10, 3, 10, 3); |
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; |
||||
this.tableLayoutPanel1.RowCount = 1; |
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); |
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); |
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(457, 30); |
||||
this.tableLayoutPanel1.TabIndex = 3; |
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
||||
this.cancelButton.Dock = System.Windows.Forms.DockStyle.Right; |
||||
this.cancelButton.Location = new System.Drawing.Point(374, 3); |
||||
this.cancelButton.Name = "cancelButton"; |
||||
this.cancelButton.Size = new System.Drawing.Size(80, 24); |
||||
this.cancelButton.TabIndex = 0; |
||||
this.cancelButton.Text = "Cancel"; |
||||
this.cancelButton.UseVisualStyleBackColor = true; |
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; |
||||
this.okButton.Dock = System.Windows.Forms.DockStyle.Right; |
||||
this.okButton.Location = new System.Drawing.Point(275, 3); |
||||
this.okButton.Name = "okButton"; |
||||
this.okButton.Size = new System.Drawing.Size(75, 24); |
||||
this.okButton.TabIndex = 1; |
||||
this.okButton.Text = "Ok"; |
||||
this.okButton.UseVisualStyleBackColor = true; |
||||
//
|
||||
// ParameterDialog
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
||||
this.CancelButton = this.cancelButton; |
||||
this.ClientSize = new System.Drawing.Size(477, 215); |
||||
this.ControlBox = false; |
||||
this.Controls.Add(this.tableLayoutPanel1); |
||||
this.Controls.Add(this.dataGrid1); |
||||
this.Name = "ParameterDialog"; |
||||
this.Padding = new System.Windows.Forms.Padding(10); |
||||
this.ShowInTaskbar = false; |
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; |
||||
this.Text = "ParameterDialog"; |
||||
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); |
||||
this.tableLayoutPanel1.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
private System.Windows.Forms.Button okButton; |
||||
private System.Windows.Forms.Button cancelButton; |
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; |
||||
private System.Windows.Forms.DataGrid dataGrid1; |
||||
#endregion
|
||||
} |
||||
} |
@ -1,176 +0,0 @@
@@ -1,176 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
|
||||
/// <summary>
|
||||
/// This Function print's the PageNumber
|
||||
/// Localise it by just overriding the Text Property
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 19.04.2005 22:23:48
|
||||
/// </remarks>
|
||||
namespace SharpReport.ReportItems.Functions { |
||||
|
||||
public class PageNumber : SharpReportCore.BasePageNumber,SharpReport.Designer.IDesignable { |
||||
private string functionName = "PageNumber"; |
||||
private FunctionControl visualControl; |
||||
private bool initDone; |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
public PageNumber():base(){ |
||||
visualControl = new FunctionControl(); |
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
|
||||
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange); |
||||
|
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
|
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
|
||||
this.Text = functionName; |
||||
this.visualControl.FunctionValue = String.Empty; |
||||
GrapFromBase(); |
||||
this.initDone = true; |
||||
} |
||||
|
||||
private void GrapFromBase() { |
||||
this.visualControl.SuspendLayout(); |
||||
visualControl.StringFormat = base.StringFormat; |
||||
this.visualControl.ResumeLayout(); |
||||
} |
||||
|
||||
#region Events
|
||||
//Tracker
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
if (initDone == true) { |
||||
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
public void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
public override Font Font { |
||||
get { |
||||
return base.Font; |
||||
} |
||||
set { |
||||
base.Font = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Font = value; |
||||
} |
||||
this.HandlePropertyChanged("Font"); |
||||
} |
||||
} |
||||
///<summary>
|
||||
/// Holds the text to be displayed
|
||||
/// </summary>
|
||||
|
||||
public override string Text{ |
||||
get { |
||||
return base.Text; |
||||
} |
||||
set { |
||||
base.Text = value; |
||||
if (this.visualControl.Text != value) { |
||||
this.visualControl.Text = value; |
||||
this.visualControl.Refresh(); |
||||
} |
||||
this.HandlePropertyChanged("Text"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IDesignable
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return visualControl; |
||||
} |
||||
} |
||||
|
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,192 +0,0 @@
@@ -1,192 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
|
||||
/// <summary>
|
||||
/// This Function show's the date like
|
||||
/// 'Printed : 04.23.2005'
|
||||
/// Localise it by just overriding the Text Property
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 24.04.2005 10:29:05
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReport.ReportItems.Functions { |
||||
|
||||
public class TodaysDate : SharpReportCore.BaseToday,SharpReport.Designer.IDesignable { |
||||
|
||||
private string functionName = "TodaysDate"; |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
private FunctionControl visualControl; |
||||
bool initDone = false; |
||||
|
||||
public TodaysDate():base() { |
||||
visualControl = new FunctionControl(); |
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
|
||||
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange); |
||||
|
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
|
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
|
||||
this.Text = functionName; |
||||
GrapFromBase(); |
||||
this.initDone = true; |
||||
} |
||||
|
||||
private void GrapFromBase() { |
||||
this.visualControl.SuspendLayout(); |
||||
visualControl.StringFormat = base.StringFormat; |
||||
this.visualControl.ResumeLayout(); |
||||
} |
||||
|
||||
#region events
|
||||
|
||||
//Tracker
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
if (initDone == true) { |
||||
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
public void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region overrides
|
||||
|
||||
public override string ToString() { |
||||
return functionName; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Properties
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
|
||||
public override Font Font { |
||||
get { |
||||
return base.Font; |
||||
} |
||||
set { |
||||
base.Font = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Font = value; |
||||
} |
||||
this.HandlePropertyChanged("Font"); |
||||
} |
||||
} |
||||
///<summary>
|
||||
/// Holds the text to be displayed
|
||||
/// </summary>
|
||||
|
||||
public override string Text{ |
||||
get { |
||||
return base.Text; |
||||
} |
||||
set { |
||||
base.Text = value; |
||||
if (this.visualControl.Text != value) { |
||||
this.visualControl.Text = value; |
||||
this.visualControl.Refresh(); |
||||
} |
||||
this.HandlePropertyChanged("Text"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IDesignable
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return visualControl; |
||||
} |
||||
} |
||||
|
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,163 +0,0 @@
@@ -1,163 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Fabio |
||||
* Date: 09/10/2004 |
||||
* Time: 21.43 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.ReportItems{ |
||||
|
||||
public class ReportCircleItem : BaseCircleItem,IDesignable{ |
||||
/// <summary>
|
||||
/// This Class draws a Circle
|
||||
///All this Graphical Classes derive from <see cref="BaseGraphicItem"></see>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.01.2005 16:14:05
|
||||
/// </remarks>
|
||||
///
|
||||
|
||||
private ReportCircleControl visualControl; |
||||
|
||||
|
||||
public ReportCircleItem() : base(){ |
||||
visualControl = new ReportCircleControl(); |
||||
|
||||
// ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this);
|
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
|
||||
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange); |
||||
} |
||||
|
||||
#region EventHandling
|
||||
|
||||
//Tracker
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateControlFromGraphicBase (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
|
||||
} |
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
base.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this); |
||||
base.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
public override void Render(SharpReportCore.ReportPageEventArgs e) { |
||||
base.Render(e); |
||||
} |
||||
|
||||
public override void Dispose() { |
||||
base.Dispose(); |
||||
this.visualControl.Dispose(); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return this.Name; |
||||
} |
||||
#endregion
|
||||
|
||||
#region properties
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
public override Color BackColor { |
||||
get { |
||||
return base.BackColor; |
||||
} |
||||
set { |
||||
base.BackColor = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.BackColor = value; |
||||
} |
||||
this.HandlePropertyChanged("Backcolor"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region SharpReport.Designer.IDesignable interface implementation
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return this.visualControl; |
||||
} |
||||
} |
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
} |
@ -1,175 +0,0 @@
@@ -1,175 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Drawing.Design; |
||||
using System.Windows.Forms.Design; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
//using System.Windows.Forms;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 04.10.2005 11:15:23
|
||||
/// </remarks>
|
||||
namespace SharpReport.ReportItems { |
||||
|
||||
public class ReportImageItem : BaseImageItem,SharpReport.Designer.IDesignable { |
||||
|
||||
private ReportImageControl visualControl; |
||||
|
||||
public ReportImageItem() :base(){ |
||||
|
||||
visualControl = new ReportImageControl(); |
||||
ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this); |
||||
|
||||
Setup(); |
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange); |
||||
|
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
} |
||||
|
||||
private void Setup() { |
||||
this.visualControl.Location = base.Location; |
||||
this.visualControl.Size = base.Size; |
||||
|
||||
if (base.Image != null) { |
||||
this.visualControl.Image = base.Image; |
||||
this.visualControl.ScaleImageToSize = base.ScaleImageToSize; |
||||
this.visualControl.Invalidate(); |
||||
} |
||||
} |
||||
|
||||
#region EventHandling
|
||||
|
||||
//Tracker
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
Setup(); |
||||
ItemsHelper.UpdateControlFromGraphicBase(this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
Setup(); |
||||
base.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this); |
||||
base.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region SharpReport.Designer.IDesignable interface implementation
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return visualControl; |
||||
} |
||||
} |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
[Editor ( typeof(FileNameEditor), typeof(UITypeEditor) ) ] |
||||
public override string FileName { |
||||
get { |
||||
return base.FileName; |
||||
} |
||||
set { |
||||
base.FileName = value; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public override void Dispose() { |
||||
base.Dispose(); |
||||
this.visualControl.Dispose(); |
||||
} |
||||
|
||||
public override string ToString(){ |
||||
return this.Name; |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,155 +0,0 @@
@@ -1,155 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This Class draws a Line with Thickness and DashStyle
|
||||
/// All this Graphical Classes derive from <see cref="BaseGraphicItem"></see>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.01.2005 16:14:05
|
||||
/// </remarks>
|
||||
namespace SharpReport.ReportItems{ |
||||
public class ReportLineItem : BaseLineItem,SharpReport.Designer.IDesignable { |
||||
|
||||
private ReportLineControl visualControl; |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor - initializes all fields to default values
|
||||
/// </summary>
|
||||
public ReportLineItem():base() { |
||||
visualControl = new ReportLineControl(); |
||||
// ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this);
|
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
|
||||
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange); |
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
|
||||
} |
||||
|
||||
#region EventHandling
|
||||
|
||||
|
||||
//Tracker
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateControlFromGraphicBase (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
base.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this); |
||||
base.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
private void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
|
||||
} |
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
|
||||
public override void Render(SharpReportCore.ReportPageEventArgs rpea) { |
||||
base.Render(rpea); |
||||
} |
||||
|
||||
public override void Dispose() { |
||||
base.Dispose(); |
||||
this.visualControl.Dispose(); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return this.Name; |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region properties
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
|
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region SharpReport.Designer.IDesignable interface implementation
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return this.visualControl; |
||||
} |
||||
} |
||||
|
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,166 +0,0 @@
@@ -1,166 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This Class Draws a Rectangle
|
||||
/// All this Graphical Classes derive from <see cref="BaseGraphicItem"></see>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.01.2005 23:12:07
|
||||
/// </remarks>
|
||||
///
|
||||
namespace SharpReport.ReportItems{ |
||||
public class ReportRectangleItem : BaseRectangleItem,SharpReport.Designer.IDesignable { |
||||
|
||||
private ReportRectangleControl visualControl; |
||||
|
||||
public ReportRectangleItem():base() { |
||||
visualControl = new ReportRectangleControl(); |
||||
|
||||
// ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this);
|
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
|
||||
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange); |
||||
|
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
} |
||||
|
||||
#region EventHandling
|
||||
|
||||
|
||||
//Tracker
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateControlFromGraphicBase (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
|
||||
} |
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
base.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromGraphicControl (this.visualControl,this); |
||||
base.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region overrides
|
||||
public override void Render(SharpReportCore.ReportPageEventArgs rpea) { |
||||
base.Render(rpea); |
||||
} |
||||
|
||||
public override void Dispose() { |
||||
base.Dispose(); |
||||
this.visualControl.Dispose(); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return this.Name; |
||||
} |
||||
#endregion
|
||||
|
||||
#region properties
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
public override Color BackColor { |
||||
get { |
||||
return base.BackColor; |
||||
} |
||||
set { |
||||
base.BackColor = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.BackColor = value; |
||||
} |
||||
this.HandlePropertyChanged("Backcolor"); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region SharpReport.Designer.IDesignable interface implementation
|
||||
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return this.visualControl; |
||||
} |
||||
} |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,68 +0,0 @@
@@ -1,68 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SharpReport { |
||||
using System; |
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// Helper Class for Report Items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 31.08.2005 13:49:47
|
||||
/// </remarks>
|
||||
internal class ItemsHelper : object { |
||||
|
||||
|
||||
internal static void UpdateBaseFromTextControl (ReportObjectControlBase control, |
||||
BaseReportItem item) { |
||||
|
||||
item.Size = control.Size; |
||||
item.Location = new System.Drawing.Point (control.Location.X,control.Location.Y); |
||||
item.Name = control.Name; |
||||
item.BackColor = control.BackColor; |
||||
item.ForeColor = control.ForeColor; |
||||
item.Font = control.Font; |
||||
} |
||||
|
||||
internal static void UpdateBaseFromGraphicControl (AbstractGraphicControl control, |
||||
BaseGraphicItem item) { |
||||
|
||||
ItemsHelper.UpdateBaseFromTextControl (control,item); |
||||
item.Thickness = control.Thickness; |
||||
item.DashStyle = control.DashStyle; |
||||
} |
||||
|
||||
|
||||
internal static void UpdateControlFromTextBase (ReportObjectControlBase control, |
||||
BaseReportItem item) { |
||||
|
||||
control.BackColor = item.BackColor; |
||||
control.ForeColor = item.ForeColor; |
||||
control.Location = item.Location; |
||||
control.Size = item.Size; |
||||
control.Font = item.Font; |
||||
control.Name = item.Name; |
||||
} |
||||
|
||||
|
||||
internal static void UpdateControlFromGraphicBase (AbstractGraphicControl control, |
||||
BaseGraphicItem item) { |
||||
ItemsHelper.UpdateControlFromTextBase(control,item); |
||||
control.Location = item.Location; |
||||
control.DashStyle = item.DashStyle; |
||||
control.Thickness = item.Thickness; |
||||
} |
||||
|
||||
|
||||
} |
||||
} |
@ -1,222 +0,0 @@
@@ -1,222 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 13.11.2004 |
||||
* Time: 22:48 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.ReportItems{ |
||||
/// <summary>
|
||||
/// This class reads a Column from a DataSource
|
||||
/// </summary>
|
||||
|
||||
public class ReportDataItem : BaseDataItem ,IDesignable{ |
||||
|
||||
private ReportDbTextControl visualControl; |
||||
|
||||
#region Constructors
|
||||
|
||||
public ReportDataItem() : this(String.Empty){ |
||||
} |
||||
|
||||
public ReportDataItem(string columnName):base(columnName){ |
||||
Setup(); |
||||
} |
||||
#endregion
|
||||
|
||||
#region SetUp
|
||||
private void Setup(){ |
||||
visualControl = new ReportDbTextControl(); |
||||
|
||||
this.visualControl.Text = base.ColumnName; |
||||
|
||||
this.Text = base.ColumnName; |
||||
|
||||
visualControl.ContentAlignment = base.ContentAlignment; |
||||
visualControl.StringTrimming = base.StringTrimming; |
||||
|
||||
// ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
|
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
|
||||
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (BasePropertyChange); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region events's
|
||||
|
||||
//Tracker
|
||||
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this); |
||||
|
||||
this.visualControl.ContentAlignment = base.ContentAlignment; |
||||
this.visualControl.StringTrimming = base.StringTrimming; |
||||
this.visualControl.DrawBorder = base.DrawBorder; |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
base.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
base.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region Property's
|
||||
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
public override Font Font { |
||||
get { |
||||
return base.Font; |
||||
} |
||||
set { |
||||
base.Font = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Font = value; |
||||
} |
||||
this.HandlePropertyChanged("Font"); |
||||
} |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Holds the text to be displayed
|
||||
/// </summary>
|
||||
|
||||
public override string Text{ |
||||
get { |
||||
return base.Text; |
||||
} |
||||
set { |
||||
base.Text = value; |
||||
if (this.visualControl.Text != value) { |
||||
this.visualControl.Text = value; |
||||
this.visualControl.Refresh(); |
||||
} |
||||
this.HandlePropertyChanged("Text"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IDesignable
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return visualControl; |
||||
} |
||||
} |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
public override string ToString(){ |
||||
return this.Name; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/* |
||||
#region IDisposable
|
||||
public override void Dispose(){ |
||||
this.Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~ReportDataItem() |
||||
{ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing){ |
||||
try { |
||||
if (disposing) { |
||||
// Free other state (managed objects).
|
||||
if (this.visualControl != null) { |
||||
this.visualControl.Dispose(); |
||||
} |
||||
} |
||||
} finally { |
||||
base.Dispose(); |
||||
} |
||||
} |
||||
#endregion
|
||||
*/ |
||||
} |
||||
} |
@ -1,257 +0,0 @@
@@ -1,257 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 01.03.2006 |
||||
* Time: 14:35 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.ReportItems |
||||
{ |
||||
|
||||
/// <summary>
|
||||
/// Description of ReportTableItem.
|
||||
/// </summary>
|
||||
public class ReportRowItem : RowItem ,IDesignable{ |
||||
private ReportRowControl visualControl; |
||||
|
||||
|
||||
#region Constructor
|
||||
public ReportRowItem():this (GlobalValues.UnboundName){ |
||||
} |
||||
|
||||
public ReportRowItem (string tableName):base(tableName) { |
||||
Setup(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Setup
|
||||
private void Setup(){ |
||||
|
||||
visualControl = new ReportRowControl(); |
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnAppereanceChanged); |
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
|
||||
base.PropertyChanged += new PropertyChangedEventHandler (BasePropertyChange); |
||||
|
||||
base.Items.Added += OnAdd; |
||||
base.Items.Removed += OnRemove; |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region Events for Childs
|
||||
private void ChildSelected(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(sender,e); |
||||
} |
||||
/* |
||||
private void OnChildControlChanged (object sender, EventArgs e) { |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged("OnChildControlChanged"); |
||||
} |
||||
*/ |
||||
|
||||
private void ChildPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
if (! base.Suspend) { |
||||
ItemsHelper.UpdateControlFromTextBase (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
private void UpdateChilds () { |
||||
foreach (BaseReportItem br in this.Items) { |
||||
br.BackColor = this.BackColor; |
||||
IDesignable des = br as IDesignable; |
||||
if (des != null) { |
||||
des.VisualControl.BackColor = this.BackColor; |
||||
} |
||||
} |
||||
} |
||||
|
||||
#region EventHandling for this Class
|
||||
|
||||
|
||||
private void OnAdd (object sender, CollectionItemEventArgs<IItemRenderer> e){ |
||||
IDesignable des = e.Item as IDesignable; |
||||
if (des != null) { |
||||
this.visualControl.Controls.Add (des.VisualControl); |
||||
des.Selected += ChildSelected; |
||||
des.PropertyChanged += ChildPropertyChange; |
||||
} |
||||
} |
||||
|
||||
private void OnRemove (object sender, CollectionItemEventArgs<IItemRenderer> e){ |
||||
|
||||
IDesignable des = e.Item as IDesignable; |
||||
if (des != null) { |
||||
this.visualControl.Controls.Remove(des.VisualControl); |
||||
des.Selected -= ChildSelected; |
||||
this.HandlePropertyChanged("OnChildControlRemoved"); |
||||
} |
||||
} |
||||
|
||||
//Tracker
|
||||
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateControlFromTextBase (this.visualControl,this); |
||||
this.visualControl.DrawBorder = base.DrawBorder; |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
this.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
|
||||
this.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
|
||||
} |
||||
|
||||
private void OnAppereanceChanged (object sender, EventArgs e) { |
||||
this.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.ResumeLayout(); |
||||
UpdateChilds(); |
||||
|
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDesignable
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return visualControl; |
||||
} |
||||
} |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region overrides
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
public override Font Font { |
||||
get { |
||||
return base.Font; |
||||
} |
||||
set { |
||||
base.Font = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Font = value; |
||||
} |
||||
this.HandlePropertyChanged("Font"); |
||||
} |
||||
} |
||||
|
||||
public override string ToString(){ |
||||
return this.GetType().Name; |
||||
} |
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/* |
||||
#region IDisposable
|
||||
public override void Dispose(){ |
||||
this.Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~ReportRowItem() |
||||
{ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing){ |
||||
try { |
||||
if (disposing) { |
||||
|
||||
} |
||||
} finally { |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Dispose(); |
||||
this.visualControl = null; |
||||
} |
||||
base.Dispose(); |
||||
} |
||||
} |
||||
#endregion
|
||||
*/ |
||||
} |
||||
} |
@ -1,206 +0,0 @@
@@ -1,206 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 09.07.2006 |
||||
* Time: 15:51 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.ReportItems{ |
||||
/// <summary>
|
||||
/// Description of ReportTableItem.
|
||||
/// </summary>
|
||||
public class ReportTableItem:TableItem ,IDesignable{ |
||||
private ReportTableControl visualControl; |
||||
|
||||
|
||||
#region Constructor
|
||||
public ReportTableItem():this (GlobalValues.UnboundName){ |
||||
|
||||
} |
||||
|
||||
public ReportTableItem (string tableName):base(tableName) { |
||||
Setup(); |
||||
base.Name = this.visualControl.Name; |
||||
} |
||||
|
||||
private void Setup (){ |
||||
visualControl = new ReportTableControl(); |
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
|
||||
|
||||
// //Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
base.PropertyChanged += new PropertyChangedEventHandler (BasePropertyChange); |
||||
//
|
||||
base.Items.Added += OnAdd; |
||||
base.Items.Removed += OnRemove; |
||||
} |
||||
#endregion
|
||||
|
||||
#region List Handling
|
||||
private void ChildSelected(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
Selected(sender,e); |
||||
} |
||||
|
||||
private void ChildPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
if (! base.Suspend) { |
||||
ItemsHelper.UpdateControlFromTextBase (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
} |
||||
|
||||
private void OnAdd (object sender, CollectionItemEventArgs<IItemRenderer> e){ |
||||
System.Console.WriteLine("TableItem:OnAdd"); |
||||
IDesignable des = e.Item as IDesignable; |
||||
|
||||
if (des != null) { |
||||
this.visualControl.Controls.Add (des.VisualControl); |
||||
des.Selected += ChildSelected; |
||||
des.PropertyChanged += ChildPropertyChange; |
||||
System.Console.WriteLine("\t Added <{0}>",e.Item.Name); |
||||
} |
||||
} |
||||
|
||||
private void OnRemove (object sender, CollectionItemEventArgs<IItemRenderer> e){ |
||||
System.Console.WriteLine("TableItem:OnRemove"); |
||||
IDesignable des = e.Item as IDesignable; |
||||
System.Console.WriteLine("\t <{0}>",des.Name); |
||||
if (des != null) { |
||||
this.visualControl.Controls.Remove(des.VisualControl); |
||||
des.Selected -= ChildSelected; |
||||
this.HandlePropertyChanged("OnChildControlRemoved"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Events from Control
|
||||
//Tracker
|
||||
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateControlFromTextBase (this.visualControl,this); |
||||
this.visualControl.DrawBorder = base.DrawBorder; |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
this.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
|
||||
this.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
|
||||
} |
||||
|
||||
private void OnAppereanceChanged (object sender, EventArgs e) { |
||||
this.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.ResumeLayout(); |
||||
// UpdateChilds();
|
||||
|
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null) |
||||
System.Console.WriteLine("fire selected"); |
||||
Selected(this,e); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
|
||||
public override Size Size { |
||||
get { |
||||
return base.Size; |
||||
} |
||||
set { |
||||
base.Size = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Size = value; |
||||
} |
||||
this.HandlePropertyChanged("Size"); |
||||
} |
||||
} |
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
public override Font Font { |
||||
get { |
||||
return base.Font; |
||||
} |
||||
set { |
||||
base.Font = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Font = value; |
||||
} |
||||
this.HandlePropertyChanged("Font"); |
||||
} |
||||
} |
||||
|
||||
public override string ToString(){ |
||||
return this.GetType().Name; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IDesignable
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return visualControl; |
||||
} |
||||
} |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
#endregion
|
||||
} |
||||
} |
@ -1,197 +0,0 @@
@@ -1,197 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 13.11.2004 |
||||
* Time: 22:40 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
|
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.ReportItems { |
||||
/// <summary>
|
||||
/// Description of ReportTextControl.
|
||||
/// </summary>
|
||||
///<remarks>The <see cref="IDesignable"></see> Interface implementaion is already
|
||||
/// included in the BaseClasses</remarks>
|
||||
|
||||
|
||||
|
||||
public class ReportTextItem : BaseTextItem,IDesignable { |
||||
|
||||
private ReportTextControl visualControl; |
||||
|
||||
#region Constructor
|
||||
public ReportTextItem() : base(){ |
||||
visualControl = new ReportTextControl(); |
||||
|
||||
this.Text = visualControl.Name; |
||||
|
||||
visualControl.ContentAlignment = base.ContentAlignment; |
||||
visualControl.StringTrimming = base.StringTrimming; |
||||
|
||||
// ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
|
||||
|
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
|
||||
this.visualControl.Click += new EventHandler(OnControlSelect); |
||||
this.visualControl.LocationChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.FontChanged += new EventHandler (OnControlChanged); |
||||
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged); |
||||
//Event from Tracker
|
||||
this.visualControl.PropertyChanged += new PropertyChangedEventHandler (ControlPropertyChange); |
||||
|
||||
base.PropertyChanged += new PropertyChangedEventHandler (BasePropertyChange); |
||||
|
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region events
|
||||
|
||||
//Tracker
|
||||
private void ControlPropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){ |
||||
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this); |
||||
this.visualControl.ContentAlignment = base.ContentAlignment; |
||||
this.visualControl.StringTrimming = base.StringTrimming; |
||||
this.visualControl.DrawBorder = base.DrawBorder; |
||||
this.HandlePropertyChanged(e.PropertyName); |
||||
} |
||||
|
||||
|
||||
private void OnControlChanged (object sender, EventArgs e) { |
||||
base.SuspendLayout(); |
||||
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this); |
||||
base.ResumeLayout(); |
||||
this.HandlePropertyChanged("OnControlChanged"); |
||||
} |
||||
|
||||
|
||||
private void OnControlSelect(object sender, EventArgs e){ |
||||
if (Selected != null){ |
||||
Selected(this,e); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Property in ReportItem has changed, inform the Designer
|
||||
/// to set the View's 'IsDirtyFlag' to true
|
||||
/// </summary>
|
||||
|
||||
protected void HandlePropertyChanged(string info) { |
||||
if ( !base.Suspend) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs(info)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
public override Point Location { |
||||
get { |
||||
return base.Location; |
||||
} |
||||
set { |
||||
base.Location = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Location = value; |
||||
} |
||||
this.HandlePropertyChanged("Location"); |
||||
} |
||||
} |
||||
|
||||
public override Font Font { |
||||
get { |
||||
return base.Font; |
||||
} |
||||
set { |
||||
base.Font = value; |
||||
if (this.visualControl != null) { |
||||
this.visualControl.Font = value; |
||||
} |
||||
this.HandlePropertyChanged("Font"); |
||||
} |
||||
} |
||||
///<summary>
|
||||
/// Holds the text to be displayed
|
||||
/// </summary>
|
||||
|
||||
public override string Text{ |
||||
get { |
||||
return base.Text; |
||||
} |
||||
set { |
||||
base.Text = value; |
||||
if (this.visualControl.Text != value) { |
||||
this.visualControl.Text = value; |
||||
this.visualControl.Refresh(); |
||||
} |
||||
this.HandlePropertyChanged("Text"); |
||||
} |
||||
} |
||||
|
||||
#region IDesignable
|
||||
|
||||
[System.Xml.Serialization.XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public ReportObjectControlBase VisualControl { |
||||
get { |
||||
return visualControl; |
||||
} |
||||
} |
||||
|
||||
public new event PropertyChangedEventHandler PropertyChanged; |
||||
public event EventHandler <EventArgs> Selected; |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
|
||||
public override string ToString(){ |
||||
return this.Name; |
||||
} |
||||
|
||||
#endregion
|
||||
/* |
||||
#region IDisposable
|
||||
public override void Dispose(){ |
||||
this.Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~ReportTextItem() |
||||
{ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing){ |
||||
try { |
||||
if (disposing) { |
||||
// Free other state (managed objects).
|
||||
if (this.visualControl != null) { |
||||
this.visualControl.Dispose(); |
||||
} |
||||
} |
||||
} finally { |
||||
base.Dispose(); |
||||
} |
||||
} |
||||
#endregion
|
||||
*/ |
||||
} |
||||
} |
@ -1,140 +0,0 @@
@@ -1,140 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>SharpReport</RootNamespace> |
||||
<AssemblyName>SharpReport</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>124780544</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\SharpReport\</OutputPath> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
<Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
||||
<Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
<Reference Include="System.Drawing.Design" /> |
||||
<Reference Include="System.Design" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Designer\Ruler\ctrlRuler.cs" /> |
||||
<Compile Include="Designer\Ruler\GdiHelper.cs" /> |
||||
<Compile Include="Designer\SectionControls\BaseDesignerControl.cs" /> |
||||
<Compile Include="Designer\SectionControls\ItemsDragDropEventArgs.cs" /> |
||||
<Compile Include="Designer\SectionControls\ReportDetail.cs" /> |
||||
<Compile Include="Designer\SectionControls\ReportFooter.cs" /> |
||||
<Compile Include="Designer\SectionControls\ReportHeader.cs" /> |
||||
<Compile Include="Designer\SectionControls\ReportPageFooter.cs" /> |
||||
<Compile Include="Designer\SectionControls\ReportPageHeader.cs" /> |
||||
<Compile Include="Designer\SectionControls\ReportSectionControlbase.cs" /> |
||||
<Compile Include="Designer\SectionControls\SectionChangedEventArgs.cs" /> |
||||
<Compile Include="Designer\VisualControls\AbstractGraphicControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\FunctionControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportCircleControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportControlBase.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportDbTextControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportImageControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportLineControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportObjectControlBase.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportRectangleControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportTextControl.cs" /> |
||||
<Compile Include="Designer\Factories.cs" /> |
||||
<Compile Include="Designer\IDesignable.cs" /> |
||||
<Compile Include="Designer\NameService.cs" /> |
||||
<Compile Include="Designer\Report.cs" /> |
||||
<Compile Include="Designer\XmlHelpers.cs" /> |
||||
<Compile Include="ReportItems\Functions\MiscFunctions\PageNumber.cs" /> |
||||
<Compile Include="ReportItems\Functions\MiscFunctions\Today.cs" /> |
||||
<Compile Include="ReportItems\GraphicBased\ReportCircleItem.cs" /> |
||||
<Compile Include="ReportItems\GraphicBased\ReportImageItem.cs" /> |
||||
<Compile Include="ReportItems\GraphicBased\ReportLineItem.cs" /> |
||||
<Compile Include="ReportItems\GraphicBased\ReportRectangleItem.cs" /> |
||||
<Compile Include="ReportItems\TextBased\ItemsHelper.cs" /> |
||||
<Compile Include="ReportItems\TextBased\ReportDataItem.cs" /> |
||||
<Compile Include="ReportItems\TextBased\ReportTextItem.cs" /> |
||||
<Compile Include="Visitors\LoadReportVisitor.cs" /> |
||||
<Compile Include="Visitors\SaveReportVisitor.cs" /> |
||||
<Compile Include="AutoReport.cs" /> |
||||
<Compile Include="SharpReportManager.cs" /> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<Compile Include="Designer\SectionControls\ReportSection.cs" /> |
||||
<Compile Include="Designer\SideTab\BuildSideTab.cs" /> |
||||
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs"> |
||||
<Link>Configuration\GlobalAssemblyInfo.cs</Link> |
||||
</Compile> |
||||
<Compile Include="Designer\VisualControls\ReportRowControl.cs" /> |
||||
<Compile Include="ReportItems\TextBased\ReportRowItem.cs" /> |
||||
<Compile Include="Designer\VisualControls\ControlHelper.cs" /> |
||||
<Compile Include="Designer\VisualControls\RectTracker.cs" /> |
||||
<Compile Include="Designer\VisualControls\ContainerControl.cs" /> |
||||
<Compile Include="Designer\VisualControls\ITracker.cs" /> |
||||
<Compile Include="Designer\VisualControls\ReportTableControl.cs" /> |
||||
<Compile Include="ReportItems\TextBased\ReportTableItem.cs" /> |
||||
<Compile Include="ParameterDialog.cs" /> |
||||
<Compile Include="Designer\SideTab\BuildDesignerTab.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Folder Include="Designer" /> |
||||
<Folder Include="Designer\Ruler" /> |
||||
<Folder Include="Designer\SectionControls" /> |
||||
<Folder Include="Designer\VisualControls" /> |
||||
<Folder Include="ReportItems" /> |
||||
<Folder Include="ReportItems\Functions" /> |
||||
<Folder Include="ReportItems\Functions\MiscFunctions" /> |
||||
<Folder Include="ReportItems\GraphicBased" /> |
||||
<Folder Include="ReportItems\TextBased" /> |
||||
<Folder Include="Visitors" /> |
||||
<Folder Include="Configuration" /> |
||||
<Folder Include="Designer\SideTab" /> |
||||
<ProjectReference Include="..\..\SharpQuery\SharpQuery.csproj"> |
||||
<Project>{BDD03ECD-42AE-4B50-9805-9C19090A264F}</Project> |
||||
<Name>SharpQuery</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\SharpReportCore\SharpReportCore.csproj"> |
||||
<Project>{4B2239FF-8FD6-431D-9D22-1B8049BA6917}</Project> |
||||
<Name>SharpReportCore</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj"> |
||||
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project> |
||||
<Name>ICSharpCode.SharpDevelop.Widgets</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -1,383 +0,0 @@
@@ -1,383 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Peter Forstmeier" email="peter.forstmeier@t-online.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
using System.Xml; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using SharpQuery.Connection; |
||||
using SharpReport.Designer; |
||||
using SharpReport.ReportItems.Functions; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport{ |
||||
/// <summary>
|
||||
/// Description of SharpReportManager.
|
||||
/// </summary>
|
||||
public class SharpReportManager :SharpReportEngine,IDisposable { |
||||
|
||||
private BaseDesignerControl baseDesignerControl; |
||||
private ReportModel reportModel; |
||||
|
||||
//TODO Move this to reportSettings
|
||||
private ColumnCollection availableFields = null; |
||||
|
||||
public SharpReportManager():base(){ |
||||
} |
||||
|
||||
#region privates
|
||||
|
||||
private ConnectionObject BuildConnectionObject (ReportSettings settings) { |
||||
if (settings.ReportType == GlobalEnums.ReportType.DataReport) { |
||||
try { |
||||
if (settings.ConnectionString.Length > 0) { |
||||
return new ConnectionObject(settings.ConnectionString); |
||||
} else { |
||||
IConnection ole = OLEDBConnectionWrapper.CreateFromDataConnectionLink(); |
||||
return new ConnectionObject(ole.ConnectionString); |
||||
} |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Get the <see cref="ColumnCollection"></see> from ReportModel or
|
||||
/// use the <see cref="DataManager"></see> to read the Fields from the Query
|
||||
/// </summary>
|
||||
/// <returns><see cref="ColumnCollection"</returns>
|
||||
|
||||
private ColumnCollection ReadColumnCollection() { |
||||
ColumnCollection columnCollecion = new ColumnCollection(); |
||||
switch (baseDesignerControl.ReportModel.DataModel) { |
||||
case GlobalEnums.PushPullModel.FormSheet: |
||||
//Plain FormSheet we do nothing for the moment
|
||||
break; |
||||
case GlobalEnums.PushPullModel.PushData: |
||||
//PushData
|
||||
columnCollecion = SharpReportEngine.CollectFieldsFromModel(this.baseDesignerControl.ReportModel); |
||||
break; |
||||
case GlobalEnums.PushPullModel.PullData: |
||||
// PullData, query the Datasource and ask for the available Fields
|
||||
if (base.ConnectionObject == null) { |
||||
base.ConnectionObject = this.BuildConnectionObject(baseDesignerControl.ReportModel.ReportSettings); |
||||
} |
||||
|
||||
if (this.baseDesignerControl.ReportModel.DataModel.Equals(GlobalEnums.PushPullModel.PullData)){ |
||||
try { |
||||
using (DataManager dataManager = new DataManager(base.ConnectionObject, |
||||
baseDesignerControl.ReportModel.ReportSettings)) { |
||||
|
||||
dataManager.DataBind(); |
||||
columnCollecion = dataManager.AvailableFields; |
||||
} |
||||
|
||||
} catch (Exception ) { |
||||
throw; |
||||
} finally { |
||||
// System.Console.WriteLine("ReportManager:ReadColumnCollection in finally");
|
||||
} |
||||
} |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
return columnCollecion; |
||||
} |
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Standarts for all reports (Headlines etc)
|
||||
|
||||
/// <summary>
|
||||
/// Insert a <see cref="ReportTextItem"></see> in the PageHeader with
|
||||
/// the <see cref="ReportModel.ReportSettings.ReportName"></see> as
|
||||
/// text
|
||||
/// </summary>
|
||||
/// <param name="model">ReportModel</param>
|
||||
public void CreatePageHeader (ReportModel model) { |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
|
||||
BaseSection section = model.PageHeader; |
||||
section.SuspendLayout(); |
||||
SharpReport.Designer.IDesignableFactory gf = new SharpReport.Designer.IDesignableFactory(); |
||||
BaseTextItem item = (BaseTextItem)gf.Create ("ReportTextItem"); |
||||
item.SuspendLayout(); |
||||
item.Text = model.ReportSettings.ReportName; |
||||
item.Font = CopyFont(model.ReportSettings.DefaultFont); |
||||
item.Location = new Point (0,0); |
||||
item.Size = new Size (item.Size.Width,item.Font.Height + SharpReportCore.GlobalValues.EnlargeControl); |
||||
item.Parent = section; |
||||
section.Items.Add (item); |
||||
item.ResumeLayout(); |
||||
section.ResumeLayout(); |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Insert Function 'PageNumber' in Section PageFooter
|
||||
/// </summary>
|
||||
/// <param name="model">ReportModel</param>
|
||||
|
||||
public void CreatePageNumber (ReportModel model) { |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
|
||||
BaseSection section = model.PageFooter; |
||||
section.SuspendLayout(); |
||||
FunctionFactory gf = new FunctionFactory(); |
||||
PageNumber pageNumber = (PageNumber)gf.Create ("PageNumber"); |
||||
pageNumber.SuspendLayout(); |
||||
|
||||
pageNumber.Text = ResourceService.GetString("SharpReport.Toolbar.Functions.PageNumber"); |
||||
pageNumber.Location = new Point (0,0); |
||||
pageNumber.Parent = section; |
||||
section.Items.Add(pageNumber); |
||||
pageNumber.ResumeLayout(); |
||||
section.ResumeLayout(); |
||||
} |
||||
#endregion
|
||||
|
||||
private Font CopyFont (Font orgF) { |
||||
Font f = new Font(orgF.Name,orgF.Size,orgF.Style,orgF.Unit); |
||||
return f; |
||||
} |
||||
|
||||
#region Preview
|
||||
|
||||
public AbstractRenderer GetRendererForStandartReports (ReportModel model) { |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
return this.BuildStandartRenderer (model); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Run Preview with Designer
|
||||
/// </summary>
|
||||
/// <param name="model"><see cref="">ReportModel</see></param>
|
||||
/// <param name="showInUserControl"></param>
|
||||
public void ReportPreview (ReportModel model,bool standAlone) { |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
|
||||
try { |
||||
AbstractRenderer abstr = this.BuildStandartRenderer (model); |
||||
if (abstr != null) { |
||||
PreviewControl.ShowPreview (abstr,1.5,standAlone); |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
MessageService.ShowError (e,"SharpReportManager:ReportPreview"); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
private AbstractRenderer BuildStandartRenderer (ReportModel model) { |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
if (base.ConnectionObject == null) { |
||||
base.ConnectionObject = this.BuildConnectionObject(model.ReportSettings); |
||||
} |
||||
|
||||
return base.AbstractRenderer(model); |
||||
} |
||||
|
||||
|
||||
public AbstractRenderer GetRendererForPushDataReports (ReportModel model, |
||||
DataSet dataSet) { |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
if (dataSet == null) { |
||||
throw new ArgumentNullException("dataSet"); |
||||
} |
||||
return base.SetupPushDataRenderer(model,dataSet.Tables[0]); |
||||
} |
||||
|
||||
|
||||
public void ReportPreviewPushData (ReportModel model, |
||||
DataSet dataSet, |
||||
bool standAlone) { |
||||
if (model == null) { |
||||
throw new ArgumentNullException("model"); |
||||
} |
||||
if (dataSet == null) { |
||||
throw new ArgumentNullException("dataSet"); |
||||
} |
||||
try { |
||||
AbstractRenderer abstr = GetRendererForPushDataReports (model,dataSet); |
||||
if (abstr != null) { |
||||
PreviewControl.ShowPreview (abstr,1.5,standAlone); |
||||
} |
||||
|
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Load and Save
|
||||
/// <summary>
|
||||
/// Saves the File to 'FileName"'
|
||||
/// </summary>
|
||||
/// <param name="fileName">FileName of Report</param>
|
||||
|
||||
public void SaveToFile(string fileName){ |
||||
try { |
||||
SharpReport.Visitors.SaveReportVisitor saveVisitor = new SharpReport.Visitors.SaveReportVisitor(); |
||||
this.baseDesignerControl.Accept ((SharpReportCore.IModelVisitor)saveVisitor); |
||||
XmlDocument xmlDoc = saveVisitor.XmlDocument; |
||||
XmlTextWriter xw = new XmlTextWriter (fileName,System.Text.Encoding.UTF8); |
||||
xmlDoc.PreserveWhitespace = true; |
||||
xmlDoc.Save (xw); |
||||
xw.Close(); |
||||
FileService.RecentOpen.AddLastFile(fileName); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Load the Designer with a Report
|
||||
/// </summary>
|
||||
/// <param name="fileName">Valid Filename with .xml or .sdr Extension</param>
|
||||
|
||||
public void LoadFromFile(string fileName){ |
||||
|
||||
SharpReport.Visitors.LoadReportVisitor loadVisitor = new SharpReport.Visitors.LoadReportVisitor(fileName); |
||||
//TODO Thsi methiod takes aprox 2 secounds
|
||||
this.baseDesignerControl.Accept(loadVisitor); |
||||
|
||||
this.baseDesignerControl.ReportModel.ReportSettings.FileName = fileName; |
||||
reportModel = this.baseDesignerControl.ReportModel; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Collections
|
||||
/// <summary>
|
||||
/// A Typed Collection of all Available fields return from a query
|
||||
/// </summary>
|
||||
|
||||
public ColumnCollection AvailableFieldsCollection { |
||||
|
||||
get { |
||||
if (this.baseDesignerControl.ReportModel.ReportSettings.AvailableFieldsCollection.Count == 0) { |
||||
this.availableFields = this.ReadColumnCollection(); |
||||
} else { |
||||
this.availableFields = this.baseDesignerControl.ReportModel.ReportSettings.AvailableFieldsCollection; |
||||
} |
||||
|
||||
this.baseDesignerControl.ReportModel.ReportSettings.AvailableFieldsCollection = this.availableFields; |
||||
return availableFields; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Collection of Columns we like to sort
|
||||
/// </summary>
|
||||
public ColumnCollection SortColumnCollection { |
||||
get { |
||||
return this.baseDesignerControl.ReportModel.ReportSettings.SortColumnCollection; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// A Collection of Columns we like to Group
|
||||
/// </summary>
|
||||
|
||||
public ColumnCollection GroupColumnCollection { |
||||
get { |
||||
return this.baseDesignerControl.ReportModel.ReportSettings.GroupColumnsCollection; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Collection of Parameters for the Report
|
||||
/// </summary>
|
||||
|
||||
public SqlParametersCollection SqlParametersCollection{ |
||||
get { |
||||
return this.baseDesignerControl.ReportModel.ReportSettings.SqlParametersCollection; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region property's
|
||||
|
||||
public SharpReport.Designer.BaseDesignerControl BaseDesignControl { |
||||
get { |
||||
if (this.baseDesignerControl == null) { |
||||
this.baseDesignerControl = new BaseDesignerControl(); |
||||
this.baseDesignerControl.ReportControl.AutoScroll = true; |
||||
this.baseDesignerControl.Dock = DockStyle.Fill; |
||||
} |
||||
return this.baseDesignerControl; |
||||
} |
||||
set { |
||||
this.baseDesignerControl = value; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable
|
||||
|
||||
public new void Dispose(){ |
||||
this.Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~SharpReportManager(){ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected new void Dispose(bool disposing){ |
||||
try { |
||||
if (disposing) { |
||||
// Free other state (managed objects).
|
||||
if (this.baseDesignerControl != null) { |
||||
this.baseDesignerControl.Dispose(); |
||||
} |
||||
if (this.reportModel != null) { |
||||
this.reportModel.Dispose(); |
||||
} |
||||
} |
||||
} finally { |
||||
// Release unmanaged resources.
|
||||
// Set large fields to null.
|
||||
// Call Dispose on your base class.
|
||||
base.Dispose(); |
||||
} |
||||
} |
||||
#endregion
|
||||
} |
||||
|
||||
} |
@ -1,124 +0,0 @@
@@ -1,124 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Loads a ReportFile and set it's Values in the ReportDesigner
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 02.12.2004 22:44:39
|
||||
/// </remarks>
|
||||
|
||||
using System; |
||||
using System.Xml; |
||||
using SharpReport.Designer; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReport.Visitors { |
||||
|
||||
public class LoadReportVisitor : SharpReportCore.AbstractModelVisitor { |
||||
SharpReport.Designer.BaseDesignerControl baseDesigner; |
||||
IDesignableFactory designableFactory ; |
||||
|
||||
public LoadReportVisitor(string fileName):base(fileName) { |
||||
designableFactory = new IDesignableFactory(); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Loads ReportDefinition from File and set the values in the SharpReportDesigner
|
||||
/// </summary>
|
||||
/// <param name='designer'>SharpReportDesigner</param>
|
||||
public override void Visit(System.Windows.Forms.Control designer){ |
||||
if (designer == null) { |
||||
throw new ArgumentNullException("designer"); |
||||
} |
||||
this.baseDesigner = designer as SharpReport.Designer.BaseDesignerControl; |
||||
|
||||
if (this.baseDesigner == null) { |
||||
throw new ArgumentException("designer"); |
||||
} |
||||
|
||||
XmlDocument xmlDoc; |
||||
try { |
||||
xmlDoc = XmlHelper.OpenSharpReport (base.FileName); |
||||
SetDesigner (xmlDoc); |
||||
AdjustSectionsWidth(); |
||||
} catch (Exception ) { |
||||
throw ; |
||||
} |
||||
|
||||
} |
||||
|
||||
private void AdjustSectionsWidth() { |
||||
foreach (ReportSection section in baseDesigner.SectionsCollection) { |
||||
section.VisualControl.Width = baseDesigner.ReportModel.ReportSettings.PageSettings.Bounds.Width; |
||||
if (section.SectionMargin == 0) { |
||||
section.SectionMargin = baseDesigner.ReportModel.ReportSettings.PageSettings.Bounds.Left; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
private void SetDesigner (XmlDocument doc){ |
||||
this.baseDesigner.ReportModel.ReportSettings.SetSettings ((XmlElement)doc.DocumentElement.FirstChild); |
||||
SetSections (doc); |
||||
} |
||||
|
||||
|
||||
|
||||
private void SetSections (XmlDocument doc) { |
||||
|
||||
XmlNodeList sectionNodes = doc.DocumentElement.ChildNodes; |
||||
//Start with node(1)
|
||||
|
||||
for (int i = 1;i < sectionNodes.Count ; i++ ) { |
||||
XmlNode node = sectionNodes[i]; |
||||
XmlElement sectionElem = node as XmlElement; |
||||
if (sectionElem != null) { |
||||
BaseSection baseSection = (BaseSection)baseDesigner.ReportModel.SectionCollection.Find(sectionElem.GetAttribute("name")); |
||||
|
||||
XmlNodeList ctrlList = base.MakeSection(sectionElem,baseSection); |
||||
SetReportItems(baseSection,null,ctrlList); |
||||
|
||||
} else { |
||||
throw new MissingSectionException(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
void SetReportItems(BaseSection baseSection, |
||||
IContainerItem parentContainer,XmlNodeList ctrlList) { |
||||
|
||||
BaseReportItem baseReportItem; |
||||
foreach (XmlNode ctrlNode in ctrlList) { |
||||
XmlElement ctrlElem = ctrlNode as XmlElement; |
||||
if (ctrlElem != null) { |
||||
IItemRenderer itemRenderer = null; |
||||
try { |
||||
itemRenderer = designableFactory.Create(ctrlElem.GetAttribute("type")); |
||||
|
||||
baseReportItem = base.MakeItem(ctrlElem,parentContainer,baseSection,itemRenderer); |
||||
IContainerItem iContainer = baseReportItem as IContainerItem; |
||||
|
||||
if (iContainer != null) { |
||||
XmlNodeList newList = ctrlNode.SelectNodes (base.NodesQuery); |
||||
if (newList.Count > 0) { |
||||
SetReportItems (baseSection,iContainer,newList); |
||||
} |
||||
} |
||||
} |
||||
catch (Exception ) { |
||||
throw new UnkownItemException(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,68 +0,0 @@
@@ -1,68 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 02.12.2004 |
||||
* Time: 22:19 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
using System.Xml; |
||||
|
||||
namespace SharpReport.Visitors{ |
||||
|
||||
/// <summary>
|
||||
/// Description of SaveReportVisitor.
|
||||
/// </summary>
|
||||
|
||||
public class SaveReportVisitor :SharpReportCore.AbstractModelVisitor |
||||
{ |
||||
|
||||
private XmlDocument xmlDoc; |
||||
private SharpReport.Designer.BaseDesignerControl baseDesigner; |
||||
|
||||
public SaveReportVisitor ():base(String.Empty) { |
||||
|
||||
} |
||||
public override void Visit (Control designer) { |
||||
this.baseDesigner = designer as SharpReport.Designer.BaseDesignerControl; |
||||
|
||||
if (this.baseDesigner == null) { |
||||
throw new ArgumentException("designer"); |
||||
} |
||||
xmlDoc = this.BuildReportDocument(baseDesigner); |
||||
} |
||||
|
||||
private XmlDocument BuildReportDocument (SharpReport.Designer.BaseDesignerControl designer) { |
||||
|
||||
XmlDocument xmlDoc = SharpReportCore.XmlHelper.BuildXmlDocument (); |
||||
|
||||
XmlElement root = xmlDoc.CreateElement (SharpReportCore.GlobalValues.SharpReportString); |
||||
xmlDoc.AppendChild(root); |
||||
|
||||
XmlDocument docSetting = designer.ReportModel.ReportSettings.GetXmlData(); |
||||
XmlNode nodeSetting = xmlDoc.ImportNode (docSetting.SelectSingleNode("Sections"),true); |
||||
xmlDoc.DocumentElement.AppendChild (nodeSetting.LastChild); |
||||
|
||||
//Loop over all Sections
|
||||
foreach(ReportSection section in designer.SectionsCollection){ |
||||
section.Items.SortByLocation(); |
||||
XmlDocument dd = section.GetXmlData(); |
||||
XmlNode n = xmlDoc.ImportNode (dd.SelectSingleNode("Sections"),true); |
||||
xmlDoc.DocumentElement.AppendChild (n.LastChild); |
||||
} |
||||
return xmlDoc; |
||||
} |
||||
|
||||
public XmlDocument XmlDocument { |
||||
get { |
||||
return xmlDoc; |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
} |
@ -1,54 +0,0 @@
@@ -1,54 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 08.06.2005 |
||||
* Time: 22:35 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
/// <summary>
|
||||
/// Description of AbstractExplorerCommand
|
||||
/// </summary>
|
||||
namespace SharpReportAddin.Commands{ |
||||
public abstract class AbstractExplorerCommand : AbstractMenuCommand{ |
||||
|
||||
ReportExplorer reportExplorer; |
||||
protected AbstractExplorerCommand(){ |
||||
this.reportExplorer = (SharpReportAddin.ReportExplorer)WorkbenchSingleton.Workbench.GetPad(typeof(ReportExplorer)).PadContent; |
||||
if (reportExplorer == null) { |
||||
throw new SharpReportCore.SharpReportException("Explorer"); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Enabled or disabled the command
|
||||
/// <remarks> /remarks>
|
||||
/// </summary>
|
||||
public override bool IsEnabled { |
||||
get{ |
||||
if (reportExplorer != null) { |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
set{} |
||||
} |
||||
|
||||
protected ReportExplorer ReportExplorer { |
||||
get { |
||||
return reportExplorer; |
||||
} |
||||
} |
||||
|
||||
protected PadDescriptor ReportExplorerPad { |
||||
get{ |
||||
return WorkbenchSingleton.Workbench.GetPad(typeof(ReportExplorer)); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
/// <summary>
|
||||
/// Abstract Class to give access to Sharpreport Designer
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 25.01.2005 11:46:09
|
||||
/// </remarks>
|
||||
namespace SharpReportAddin.Commands { |
||||
public abstract class AbstractSharpReportCommand : AbstractMenuCommand { |
||||
SharpReportView view; |
||||
|
||||
/// <summary>
|
||||
/// get a instance of SharpReportView
|
||||
/// </summary>
|
||||
///
|
||||
protected AbstractSharpReportCommand() : base() { |
||||
try { |
||||
view = (SharpReportView)WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent; |
||||
if (view == null) { |
||||
throw new SharpReportCore.SharpReportException("No View"); |
||||
} |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Enabled or disabled the command
|
||||
/// <remarks> /remarks>
|
||||
/// </summary>
|
||||
public override bool IsEnabled |
||||
{ |
||||
get |
||||
{ |
||||
if (view != null) { |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
set{} |
||||
} |
||||
|
||||
|
||||
#region property'S
|
||||
public SharpReportView View { |
||||
get { |
||||
return view; |
||||
} |
||||
} |
||||
#endregion
|
||||
} |
||||
} |
@ -1,124 +0,0 @@
@@ -1,124 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This class'es handles all the commands used by the
|
||||
/// <see cref="ReportExplorer"></see>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.06.2005 11:49:54
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReportAddin.Commands { |
||||
/// <summary>
|
||||
/// Fill and BringToFront
|
||||
/// </summary>
|
||||
public class ShowAndFillExplorer : AbstractExplorerCommand{ |
||||
ReportModel reportModel; |
||||
|
||||
public override void Run(){ |
||||
if (this.reportModel == null) { |
||||
throw new ArgumentNullException("reportModel"); |
||||
} |
||||
base.ReportExplorerPad.BringPadToFront(); |
||||
base.ReportExplorer.ReportModel = this.reportModel; |
||||
} |
||||
|
||||
public ReportModel ReportModel { |
||||
set { |
||||
reportModel = value; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// ShutDown Explorer
|
||||
/// </summary>
|
||||
public class HideExplorer:AbstractExplorerCommand{ |
||||
|
||||
public override void Run(){ |
||||
WorkbenchSingleton.Workbench.WorkbenchLayout.HidePad(base.ReportExplorerPad); |
||||
} |
||||
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Clear and rebuild the ExplorerTree
|
||||
/// </summary>
|
||||
public class ClearAndRebuildExplorer : AbstractExplorerCommand{ |
||||
|
||||
public override void Run() |
||||
{ |
||||
base.ReportExplorer.ClearAndRebuildTree(); |
||||
} |
||||
|
||||
} |
||||
|
||||
///<summary>
|
||||
/// Clear the selected Section (Grouping/Sorting)
|
||||
/// </summary>
|
||||
|
||||
public class ClearNodes : AbstractExplorerCommand{ |
||||
public ClearNodes() { |
||||
} |
||||
|
||||
public override void Run() { |
||||
try { |
||||
base.ReportExplorer.ClearNodes(); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toggle the SortOrder
|
||||
/// </summary>
|
||||
public class ToogleOrder : AbstractExplorerCommand{ |
||||
public ToogleOrder() { |
||||
} |
||||
|
||||
public override void Run() { |
||||
try { |
||||
base.ReportExplorer.ToggleOrder(); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Remove the Selected Node from the Collection
|
||||
/// </summary>
|
||||
public class RemoveNode : AbstractExplorerCommand{ |
||||
public RemoveNode() { |
||||
|
||||
} |
||||
public override void Run() { |
||||
try { |
||||
base.ReportExplorer.RemoveNode(); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
} // End
|
||||
|
||||
|
||||
} |
@ -1,92 +0,0 @@
@@ -1,92 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 24.01.2005 |
||||
* Time: 22:09 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Windows.Forms; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This Class contains all commands belonging to a ReportItem
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
namespace SharpReportAddin.Commands { |
||||
|
||||
/// <summary>
|
||||
/// Cut the ReportItem
|
||||
/// </summary>
|
||||
///
|
||||
public class CutReportItem : AbstractSharpReportCommand{ |
||||
/// <summary>
|
||||
/// Creates a new ContextCommands
|
||||
/// </summary>
|
||||
public CutReportItem(){ |
||||
} |
||||
|
||||
public override bool IsEnabled { |
||||
get { |
||||
if (base.View.DesignerControl.SelectedObject is IItemRenderer) { |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Cut Selected ReportItem
|
||||
/// </summary>
|
||||
///
|
||||
public override void Run(){ |
||||
if (this.IsEnabled){ |
||||
base.View.RemoveSelectedItem(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class PasteReportItem : AbstractSharpReportCommand |
||||
{ |
||||
/// <summary>
|
||||
/// Creates a new ContextCommands
|
||||
/// </summary>
|
||||
public PasteReportItem(){ |
||||
} |
||||
|
||||
public override bool IsEnabled { |
||||
get { |
||||
// if (base.View.DesignerControl.SelectedObject is ReportItem) {
|
||||
// return true;
|
||||
// }
|
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Cut Selected ReportItem
|
||||
/// </summary>
|
||||
///
|
||||
public override void Run(){ |
||||
// if (base.View.DesignerControl.SelectedObject is ReportItem) {
|
||||
// try {
|
||||
// ReportItem it = (ReportItem)base.View.DesignerControl.SelectedObject;
|
||||
// if (base.View.DesignerControl.SelectedSection.Items.Contains(it)) {
|
||||
// MessageBox.Show ("ContextCommand " + it.Name);
|
||||
// base.View.DesignerControl.SelectedSection.Items.Remove ((ReportItem)base.View.DesignerControl.SelectedObject);
|
||||
// base.View.IsDirty = true;
|
||||
// }
|
||||
// } catch (Exception) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
MessageBox.Show (this.ToString() + " not implemented"); |
||||
} |
||||
} |
||||
|
||||
///<summary>Show a List of available Fields</summary>
|
||||
|
||||
|
||||
} |
@ -1,125 +0,0 @@
@@ -1,125 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 19.04.2005 |
||||
* Time: 11:26 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
/// <summary>
|
||||
/// this Class contains all commands belonging to a ReportSection
|
||||
/// </summary>
|
||||
namespace SharpReportAddin.Commands { |
||||
|
||||
///<summary>
|
||||
/// Show the ReportSettings in Property Grid
|
||||
///</summary>
|
||||
public class ShowSettings : AbstractSharpReportCommand{ |
||||
public ShowSettings() { |
||||
|
||||
} |
||||
public override void Run() { |
||||
try { |
||||
base.View.ShowReportSettings(); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
} // End ShowSettings
|
||||
|
||||
/// <summary>
|
||||
/// Show Preview
|
||||
/// </summary>
|
||||
public class RunPreview :AbstractSharpReportCommand { |
||||
|
||||
public RunPreview(){ |
||||
} |
||||
|
||||
public override void Run(){ |
||||
try { |
||||
base.View.OnPreviewClick (); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public class SectionVisible : AbstractSharpReportCommand |
||||
{ |
||||
/// <summary>
|
||||
/// Creates a new ContextCommands
|
||||
/// </summary>
|
||||
public SectionVisible(){ |
||||
} |
||||
|
||||
public override bool IsEnabled { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Starts the command
|
||||
/// </summary>
|
||||
public override void Run() |
||||
{ |
||||
MessageBox.Show (this.ToString() + " not implemented"); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Let user choose from a List of Functions
|
||||
/// </summary>
|
||||
public class InsertFunction : AbstractSharpReportCommand{ |
||||
/// <summary>
|
||||
/// Creates a new ContextCommands
|
||||
/// </summary>
|
||||
public InsertFunction(){ |
||||
} |
||||
|
||||
public override bool IsEnabled { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
MessageBox.Show (this.ToString() + " not implemented"); |
||||
} |
||||
} |
||||
|
||||
/* |
||||
/// <summary>
|
||||
/// Show a list of all Available Fields
|
||||
/// </summary>
|
||||
public class ShowFieldsList : AbstractSharpReportCommand{ |
||||
/// <summary>
|
||||
/// Creates a new ContextCommands
|
||||
/// </summary>
|
||||
public ShowFieldsList(){ |
||||
} |
||||
|
||||
public override bool IsEnabled { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override void Run(){ |
||||
try { |
||||
base.View.ListAvailableFields(); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
||||
*/ |
||||
} |
@ -1,63 +0,0 @@
@@ -1,63 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 19.01.2006 |
||||
* Time: 10:04 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReportAddin.Commands{ |
||||
|
||||
/// <summary>
|
||||
/// This command is used when starting the <see cref="SharpReportView"></see>
|
||||
/// from MainMenu/Extras/ReportGenerator
|
||||
/// </summary>
|
||||
///
|
||||
public class RunSharpReport: AbstractMenuCommand{ |
||||
|
||||
public override void Run(){ |
||||
SharpReportView view = new SharpReportView(); |
||||
if (view != null) { |
||||
if (SharpReportCore.GlobalValues.IsValidPrinter()) { |
||||
WorkbenchSingleton.Workbench.ShowView(view); |
||||
} else { |
||||
MessageService.ShowError(ResourceService.GetString("Sharpreport.Error.NoPrinter")); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public class DataSetFromXSDCommand:AbstractCommand{ |
||||
System.Data.DataSet ds; |
||||
public override void Run() |
||||
{ |
||||
using (OpenFileDialog openFileDialog = new OpenFileDialog()){ |
||||
openFileDialog.Filter = GlobalValues.XsdFileFilter; |
||||
openFileDialog.DefaultExt = GlobalValues.XsdExtension; |
||||
openFileDialog.AddExtension = true; |
||||
if(openFileDialog.ShowDialog() == DialogResult.OK){ |
||||
if (openFileDialog.FileName.Length > 0) { |
||||
this.ds = new System.Data.DataSet(); |
||||
this.ds.ReadXml (openFileDialog.FileName); |
||||
this.ds.Locale = CultureInfo.InvariantCulture; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public System.Data.DataSet DataSet { |
||||
get { return ds; } |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
using System.Reflection; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
@ -1,72 +0,0 @@
@@ -1,72 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
/// <summary>
|
||||
/// This node act's as an Abstract Class for all Nodes used in the FieldsExplorer
|
||||
///
|
||||
/// Partially copied from ProjectBrowser/AbstractBrowserNode</summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 05.06.2005 18:30:32
|
||||
/// </remarks>
|
||||
namespace SharpReportAddin { |
||||
|
||||
internal class AbstractFieldsNode : TreeNode { |
||||
|
||||
private string contextmenuAddinTreePath = String.Empty; |
||||
|
||||
protected AbstractFieldsNode() { |
||||
} |
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generates a Drag & Drop data object. If this property returns null
|
||||
/// the node indicates that it can't be dragged.
|
||||
/// </summary>
|
||||
public virtual DataObject DragDropDataObject { |
||||
get { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the add-in tree path for the context menu.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// I choosed to give back the add-in tree path instead of a popup menu
|
||||
/// or a menuitem collection, because I don't want to add a magic library
|
||||
/// or Windows.Forms dependency.
|
||||
/// </remarks>
|
||||
|
||||
public virtual string ContextmenuAddinTreePath { |
||||
get { |
||||
return contextmenuAddinTreePath; |
||||
} |
||||
set { |
||||
contextmenuAddinTreePath = value; |
||||
} |
||||
} |
||||
// public Image a_IconImage {
|
||||
// get {
|
||||
// return iconImage;
|
||||
// }
|
||||
// set {
|
||||
// iconImage = value;
|
||||
// }
|
||||
// }
|
||||
|
||||
} |
||||
} |
@ -1,64 +0,0 @@
@@ -1,64 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Windows.Forms; |
||||
|
||||
/// <summary>
|
||||
/// Thsi class acts as a derived TreeNode for Columns
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 05.06.2005 18:54:33
|
||||
/// </remarks>
|
||||
namespace SharpReportAddin { |
||||
internal class ColumnsTreeNode : SharpReportAddin.AbstractFieldsNode { |
||||
ListSortDirection listSortDirection; |
||||
|
||||
public ColumnsTreeNode(string nodeName):this(nodeName,ListSortDirection.Ascending) { |
||||
} |
||||
|
||||
public ColumnsTreeNode(string nodeName,ListSortDirection direction) { |
||||
this.Text = nodeName; |
||||
this.listSortDirection = direction; |
||||
base.ContextmenuAddinTreePath = "/SharpReport/ContextMenu/ContextMenu/FieldsExplorer/ColumnTreeNode"; |
||||
} |
||||
|
||||
public ListSortDirection SortDirection { |
||||
get { |
||||
return listSortDirection; |
||||
} |
||||
set { |
||||
listSortDirection = value; |
||||
} |
||||
} |
||||
|
||||
|
||||
public override string ContextmenuAddinTreePath { |
||||
get { |
||||
return base.ContextmenuAddinTreePath; |
||||
} |
||||
set { |
||||
base.ContextmenuAddinTreePath = value; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Generates a Drag & Drop data object. If this property returns null
|
||||
/// the node indicates that it can't be dragged.
|
||||
/// </summary>
|
||||
public override DataObject DragDropDataObject { |
||||
get { |
||||
return new DataObject(this); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,425 +0,0 @@
@@ -1,425 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 01.08.2006 |
||||
* Time: 15:48 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Text; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReportAddin{ |
||||
/// <summary>
|
||||
/// Description of ExplorerTree.
|
||||
/// </summary>
|
||||
internal class ExplorerTree:TreeView{ |
||||
private SectionTreeNode nodeRoot; |
||||
private SectionTreeNode nodeModel; |
||||
private SectionTreeNode nodeLayout; |
||||
private SectionTreeNode nodeAvailableFields; |
||||
private SectionTreeNode nodeSorting; |
||||
private SectionTreeNode nodeGrouping; |
||||
private TreeNode nodeFunction; |
||||
private TreeNode nodeParams; |
||||
|
||||
private const int folderClosed = 0; |
||||
private const int folderOpen = 1; |
||||
private const int clearIcon = 2; |
||||
|
||||
private const int ascendingIcon = 4; |
||||
private const int descendingIcon = 5; |
||||
private const int storedprocIcon = 7; |
||||
|
||||
private const int columnIcon = 8; |
||||
private const int functionIcon = 9; |
||||
|
||||
public ExplorerTree():base(){ |
||||
LabelEdit = true; |
||||
AllowDrop = true; |
||||
HideSelection = false; |
||||
Dock = DockStyle.Fill; |
||||
Scrollable = true; |
||||
this.MouseDown += new MouseEventHandler(TreeMouseDown ); |
||||
this.InitImageList(); |
||||
BuildNodes(); |
||||
} |
||||
|
||||
|
||||
#region Contextmenu
|
||||
|
||||
private void TreeMouseDown(object sender, System.Windows.Forms.MouseEventArgs e){ |
||||
|
||||
TreeNode node = this.GetNodeAt(PointToClient(Cursor.Position)); |
||||
if (node != null) { |
||||
this.SelectedNode = node; |
||||
CheckNode (node); |
||||
if (e.Button == MouseButtons.Right) { |
||||
AbstractFieldsNode abstrNode = node as AbstractFieldsNode; |
||||
if (abstrNode != null) { |
||||
if (abstrNode.ContextmenuAddinTreePath.Length > 0) { |
||||
ContextMenuStrip ctMen = MenuService.CreateContextMenu (this,abstrNode.ContextmenuAddinTreePath); |
||||
ctMen.Show (this,new Point (e.X,e.Y)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public void ClearSortNode() { |
||||
this.nodeSorting.Nodes.Clear(); |
||||
} |
||||
|
||||
public bool IsGroupNode (SectionTreeNode node) { |
||||
return (node == this.nodeGrouping); |
||||
} |
||||
|
||||
public static bool CheckForExist (SectionTreeNode sec,ColumnsTreeNode col) { |
||||
if (sec.Nodes.Count > 0) { |
||||
for (int i = 0;i < sec.Nodes.Count ;i++ ) { |
||||
if (sec.Nodes[i].Text == col.Text) { |
||||
return true; |
||||
} |
||||
} |
||||
} else { |
||||
return false; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
public void CheckNode (TreeNode node) { |
||||
ColumnsTreeNode cn = node as ColumnsTreeNode; |
||||
|
||||
if (cn != null) { |
||||
if (node.Parent == nodeSorting) { |
||||
if (cn.SortDirection == ListSortDirection.Ascending) { |
||||
cn.ImageIndex = ascendingIcon; |
||||
} else { |
||||
cn.ImageIndex = descendingIcon; |
||||
} |
||||
} else if (node.Parent == this.nodeGrouping) { |
||||
cn.ImageIndex = clearIcon; |
||||
cn.SelectedImageIndex = clearIcon; |
||||
} |
||||
} |
||||
|
||||
} |
||||
#endregion
|
||||
|
||||
#region Update ReportModel
|
||||
|
||||
private void UpdateSorting (ReportModel model) { |
||||
model.ReportSettings.SortColumnCollection.Clear(); |
||||
if (this.nodeSorting.Nodes.Count > 0) { |
||||
SortColumn sc; |
||||
AbstractColumn af; |
||||
foreach (ColumnsTreeNode cn in this.nodeSorting.Nodes) { |
||||
af = model.ReportSettings.AvailableFieldsCollection.Find(cn.Text); |
||||
if (af != null) { |
||||
sc = new SortColumn (cn.Text, |
||||
cn.SortDirection, |
||||
af.DataType); |
||||
} else { |
||||
sc = new SortColumn (cn.Text, |
||||
cn.SortDirection, |
||||
typeof(System.String)); |
||||
} |
||||
model.ReportSettings.SortColumnCollection.Add(sc); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
private void UpdateGrouping (ReportModel model) { |
||||
model.ReportSettings.GroupColumnsCollection.Clear(); |
||||
if (this.nodeGrouping.Nodes.Count > 0) { |
||||
GroupColumn gc; |
||||
for (int i = 0;i < this.nodeGrouping.Nodes.Count ;i++ ) { |
||||
ColumnsTreeNode cn = (ColumnsTreeNode)this.nodeGrouping.Nodes[i]; |
||||
gc = new GroupColumn (cn.Text,i,cn.SortDirection); |
||||
model.ReportSettings.GroupColumnsCollection.Add(gc); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Commands
|
||||
|
||||
public void CollectModel (ReportModel model) { |
||||
UpdateSorting(model); |
||||
UpdateGrouping(model); |
||||
} |
||||
|
||||
public void ClearAndFill() { |
||||
this.Nodes.Clear(); |
||||
this.BuildNodes(); |
||||
} |
||||
|
||||
public void ToggleOrder() { |
||||
if (this.SelectedNode is ColumnsTreeNode) { |
||||
ColumnsTreeNode cn = (ColumnsTreeNode)this.SelectedNode; |
||||
if (cn.SortDirection == ListSortDirection.Ascending) { |
||||
cn.SortDirection = ListSortDirection.Descending; |
||||
cn.ImageIndex = descendingIcon; |
||||
cn.SelectedImageIndex = descendingIcon; |
||||
} else { |
||||
cn.SortDirection = ListSortDirection.Ascending; |
||||
cn.ImageIndex = ascendingIcon; |
||||
cn.SelectedImageIndex = ascendingIcon; |
||||
} |
||||
|
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public int FolderClosed { |
||||
get { |
||||
return folderClosed; |
||||
} |
||||
|
||||
} |
||||
|
||||
public int FolderOpen { |
||||
get { |
||||
return folderOpen; |
||||
} |
||||
} |
||||
|
||||
public int ClearIcon { |
||||
get { |
||||
return clearIcon; |
||||
} |
||||
} |
||||
|
||||
public int AscendingIcon { |
||||
get { |
||||
return ascendingIcon; |
||||
} |
||||
} |
||||
|
||||
public int DescendingIcon { |
||||
get { |
||||
return descendingIcon; |
||||
} |
||||
} |
||||
|
||||
public int StoredprocIcon { |
||||
get { |
||||
return storedprocIcon; |
||||
} |
||||
} |
||||
|
||||
public int ColumnIcon { |
||||
get { |
||||
return columnIcon; |
||||
} |
||||
} |
||||
|
||||
public int FunctionIcon { |
||||
get { |
||||
return functionIcon; |
||||
} |
||||
} |
||||
|
||||
|
||||
#region FillTree
|
||||
|
||||
private void SetAvailableFields (ReportModel model) { |
||||
|
||||
this.nodeAvailableFields.Nodes.Clear(); |
||||
|
||||
|
||||
foreach (AbstractColumn af in model.ReportSettings.AvailableFieldsCollection){ |
||||
|
||||
ColumnsTreeNode node = new ColumnsTreeNode(af.ColumnName); |
||||
node.Tag = this.nodeAvailableFields; |
||||
|
||||
//we don't like ContextMenu here
|
||||
node.ContextmenuAddinTreePath = ""; |
||||
// and a node is a node, otherwise we cant't dragdrop
|
||||
node.ImageIndex = columnIcon; |
||||
node.SelectedImageIndex = columnIcon; |
||||
|
||||
this.nodeAvailableFields.Nodes.Add(node); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
void SetSortFields(ColumnCollection collection){ |
||||
ColumnsTreeNode node; |
||||
|
||||
this.nodeSorting.Nodes.Clear(); |
||||
|
||||
foreach (SortColumn sc in collection) { |
||||
node = new ColumnsTreeNode(sc.ColumnName,sc.SortDirection); |
||||
if (node.SortDirection == ListSortDirection.Ascending) { |
||||
node.ImageIndex = 4; |
||||
node.SelectedImageIndex = 4; |
||||
} else { |
||||
node.ImageIndex = descendingIcon; |
||||
node.SelectedImageIndex = descendingIcon; |
||||
} |
||||
this.nodeSorting.Nodes.Add(node); |
||||
} |
||||
} |
||||
|
||||
private void SetGroupFields(ColumnCollection collection){ |
||||
ColumnsTreeNode node; |
||||
|
||||
this.nodeGrouping.Nodes.Clear(); |
||||
foreach (GroupColumn gc in collection) { |
||||
node = new ColumnsTreeNode(gc.ColumnName); |
||||
if (node.SortDirection == ListSortDirection.Ascending) { |
||||
node.ImageIndex = ascendingIcon; |
||||
node.SelectedImageIndex = ascendingIcon; |
||||
} else { |
||||
node.ImageIndex = descendingIcon; |
||||
node.SelectedImageIndex = descendingIcon; |
||||
} |
||||
this.nodeGrouping.Nodes.Add(node); |
||||
} |
||||
} |
||||
|
||||
private void SetParamFields (SqlParametersCollection collection){ |
||||
ColumnsTreeNode node; |
||||
|
||||
this.nodeParams.Nodes.Clear(); |
||||
foreach (SqlParameter par in collection) { |
||||
StringBuilder sb = new StringBuilder(par.ParameterName); |
||||
sb.Append(" {"); |
||||
sb.Append(par.DataType); |
||||
sb.Append("}"); |
||||
node = new ColumnsTreeNode(sb.ToString()); |
||||
node.Tag = par; |
||||
// No ContextMenu for Parameters
|
||||
node.ContextmenuAddinTreePath = String.Empty; |
||||
node.SelectedImageIndex = columnIcon; |
||||
node.ImageIndex = columnIcon; |
||||
this.nodeParams.Nodes.Add (node); |
||||
} |
||||
} |
||||
|
||||
void SetFunctions(ReportSectionCollection collection){ |
||||
AbstractFieldsNode node; |
||||
this.nodeFunction.Nodes.Clear(); |
||||
foreach (SharpReport.ReportSection section in collection) { |
||||
foreach (BaseReportObject item in section.Items) { |
||||
BaseFunction func = item as BaseFunction; |
||||
if (func != null) { |
||||
node = new ColumnsTreeNode (ResourceService.GetString(func.LocalisedName)); |
||||
// No ContextMenu for Functions included in the Report
|
||||
node.ContextmenuAddinTreePath = String.Empty; |
||||
node.SelectedImageIndex = functionIcon; |
||||
node.ImageIndex = functionIcon; |
||||
this.nodeFunction.Nodes.Add(node); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public void FillTree (ReportModel model) { |
||||
this.BeginUpdate(); |
||||
try { |
||||
SetAvailableFields(model); |
||||
SetGroupFields(model.ReportSettings.GroupColumnsCollection); |
||||
SetSortFields(model.ReportSettings.SortColumnCollection); |
||||
SetParamFields (model.ReportSettings.SqlParametersCollection); |
||||
SetFunctions(model.SectionCollection); |
||||
this.EndUpdate(); |
||||
} catch (Exception ) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Build Basic Tree
|
||||
|
||||
private void BuildNodes() { |
||||
BeginUpdate(); |
||||
this.Nodes.Clear(); |
||||
this.nodeRoot = new SectionTreeNode("Report"); |
||||
|
||||
this.nodeModel = new SectionTreeNode("Model"); |
||||
|
||||
nodeAvailableFields = new SectionTreeNode(ResourceService.GetString("SharpReport.FieldsExplorer.AvailableFields")); |
||||
nodeAvailableFields.ImageIndex = folderClosed; |
||||
nodeAvailableFields.SelectedImageIndex = folderOpen; |
||||
// we don't like a ContextMenu here
|
||||
nodeAvailableFields.ContextmenuAddinTreePath = ""; |
||||
this.nodeModel.Nodes.Add(this.nodeAvailableFields); |
||||
|
||||
|
||||
nodeSorting = new SectionTreeNode (ResourceService.GetString("SharpReport.FieldsExplorer.Sorting")); |
||||
nodeSorting.ImageIndex = folderClosed; |
||||
nodeSorting.SelectedImageIndex = folderOpen; |
||||
this.nodeModel.Nodes.Add(this.nodeSorting); |
||||
|
||||
nodeGrouping = new SectionTreeNode (ResourceService.GetString("SharpReport.FieldsExplorer.Grouping")); |
||||
nodeGrouping.ImageIndex = folderClosed; |
||||
nodeGrouping.SelectedImageIndex = folderOpen; |
||||
this.nodeModel.Nodes.Add(this.nodeGrouping); |
||||
|
||||
nodeFunction = new TreeNode(ResourceService.GetString("SharpReport.FieldsExplorer.Functions")); |
||||
nodeFunction.ImageIndex = folderClosed; |
||||
nodeFunction.SelectedImageIndex = folderOpen; |
||||
this.nodeModel.Nodes.Add(this.nodeFunction); |
||||
|
||||
nodeParams = new TreeNode(ResourceService.GetString("SharpReport.FieldsExplorer.Parameters")); |
||||
nodeParams.ImageIndex = folderClosed; |
||||
nodeParams.SelectedImageIndex = folderOpen; |
||||
|
||||
|
||||
|
||||
this.nodeModel.Nodes.Add(this.nodeParams); |
||||
|
||||
this.nodeRoot.Nodes.Add(nodeModel); |
||||
|
||||
|
||||
this.nodeLayout = new SectionTreeNode("Layout"); |
||||
|
||||
this.nodeRoot.Nodes.Add(nodeLayout); |
||||
Nodes.Add (this.nodeRoot); |
||||
this.EndUpdate(); |
||||
} |
||||
|
||||
void InitImageList() { |
||||
ImageList imageList = new ImageList(); |
||||
imageList.ColorDepth = ColorDepth.Depth32Bit; |
||||
imageList.ImageSize = new System.Drawing.Size(16, 16); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap")); |
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap")); |
||||
imageList.Images.Add(new Bitmap(1, 1)); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SelectionArrow")); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpReport.Ascending")); |
||||
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpReport.Descending")); |
||||
//Table's or procedure
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Table")); |
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Procedure")); |
||||
|
||||
//Parameters
|
||||
imageList.Images.Add(IconService.GetBitmap("Icons.16x16.SharpQuery.Column")); |
||||
|
||||
//Function
|
||||
imageList.Images.Add(ResourceService.GetIcon("Icons.16x16.SharpReport.Function")); |
||||
this.ImageList = imageList; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,193 +0,0 @@
@@ -1,193 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 01.08.2006 |
||||
* Time: 13:09 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using SharpReportCore; |
||||
|
||||
namespace SharpReportAddin |
||||
{ |
||||
/// <summary>
|
||||
/// Description of the pad content
|
||||
/// </summary>
|
||||
public class ReportExplorer : AbstractPadContent{ |
||||
|
||||
Panel contentPanel = new Panel(); |
||||
ExplorerTree treeView = new ExplorerTree(); |
||||
|
||||
/// <summary>
|
||||
/// Creates a new ReportExplorer object
|
||||
/// </summary>
|
||||
|
||||
public ReportExplorer():base(){ |
||||
this.contentPanel.Controls.Add(this.treeView); |
||||
this.treeView.ItemDrag += TreeViewItemDrag; |
||||
this.treeView.DragDrop += TreeViewDragDrop; |
||||
this.treeView.DragOver += TreeViewDragOver; |
||||
} |
||||
|
||||
#region DragDrop
|
||||
|
||||
void TreeViewItemDrag (object sender,ItemDragEventArgs e) { |
||||
ColumnsTreeNode node = (ColumnsTreeNode)e.Item; |
||||
if (node != null) { |
||||
if (node.ImageIndex == this.treeView.ColumnIcon) { |
||||
this.treeView.SelectedNode = node; |
||||
if (node != null) { |
||||
this.treeView.DoDragDrop(node.DragDropDataObject, |
||||
DragDropEffects.Copy | DragDropEffects.Scroll); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
void TreeViewDragOver (object sender,DragEventArgs e) { |
||||
|
||||
TreeNode node = this.treeView.GetNodeAt(this.treeView.PointToClient(new Point (e.X,e.Y))); |
||||
|
||||
node.EnsureVisible(); |
||||
if (node.Nodes.Count > 0) { |
||||
node.Expand(); |
||||
} |
||||
if(e.Data.GetDataPresent("SharpReportAddin.ColumnsTreeNode", false)){ |
||||
//If we are in the AvailableFields Section we can't drop
|
||||
if (node is SectionTreeNode){ |
||||
e.Effect = DragDropEffects.Copy | DragDropEffects.Scroll; |
||||
} else { |
||||
e.Effect = DragDropEffects.None; |
||||
} |
||||
} else { |
||||
e.Effect = DragDropEffects.None; |
||||
} |
||||
} |
||||
|
||||
|
||||
void TreeViewDragDrop (object sender,DragEventArgs e) { |
||||
|
||||
if(e.Data.GetDataPresent("SharpReportAddin.ColumnsTreeNode", false)){ |
||||
Point pt = this.treeView.PointToClient (new Point( e.X,e.Y)); |
||||
|
||||
SectionTreeNode node = this.treeView.GetNodeAt (pt) as SectionTreeNode; |
||||
|
||||
if (node != null) { |
||||
// If we dragdrop to GroupNode, remove all subnods in SortNode
|
||||
if (this.treeView.IsGroupNode(node)) { |
||||
this.treeView.ClearSortNode(); |
||||
} |
||||
|
||||
ColumnsTreeNode t = (ColumnsTreeNode)e.Data.GetData("SharpReportAddin.ColumnsTreeNode", true); |
||||
ColumnsTreeNode dest = new ColumnsTreeNode (t.Text); |
||||
|
||||
// Useless to add a node twice
|
||||
if (!ExplorerTree.CheckForExist (node,dest)) { |
||||
dest.SortDirection = ListSortDirection.Ascending; |
||||
dest.ImageIndex = this.treeView.AscendingIcon; |
||||
dest.SelectedImageIndex = this.treeView.AscendingIcon; |
||||
this.treeView.SelectedNode = (TreeNode)dest; |
||||
this.treeView.CheckNode (dest); |
||||
node.Nodes.Add(dest); |
||||
NotifyReportView(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region publics for Commands
|
||||
|
||||
// These public methods are all called from ExplorerCommands
|
||||
public void ClearAndRebuildTree() { |
||||
this.treeView.ClearAndFill(); |
||||
} |
||||
|
||||
public void ClearNodes () { |
||||
if (this.treeView.SelectedNode is SectionTreeNode) { |
||||
if (this.treeView.SelectedNode.Nodes.Count > 0) { |
||||
this.treeView.SelectedNode.Nodes.Clear(); |
||||
NotifyReportView(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
public void ToggleOrder () { |
||||
this.treeView.ToggleOrder(); |
||||
this.NotifyReportView(); |
||||
} |
||||
|
||||
public void RemoveNode() { |
||||
if (this.treeView.SelectedNode != null) { |
||||
TreeNode parent = this.treeView.SelectedNode.Parent; |
||||
this.treeView.SelectedNode.Remove(); |
||||
this.treeView.SelectedNode = parent; |
||||
NotifyReportView(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void NotifyReportView() { |
||||
if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent is SharpReportView) { |
||||
WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.IsDirty = true; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
public void Update (ReportModel model){ |
||||
this.treeView.CollectModel(model); |
||||
} |
||||
|
||||
|
||||
#region properties
|
||||
|
||||
public ReportModel ReportModel { |
||||
set { |
||||
this.treeView.FillTree(value); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region AbstractPadContent
|
||||
/// <summary>
|
||||
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
|
||||
/// </summary>
|
||||
public override Control Control { |
||||
get { |
||||
return this.contentPanel; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Refreshes the pad
|
||||
/// </summary>
|
||||
public override void RedrawContent(){ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Cleans up all used resources
|
||||
/// </summary>
|
||||
public override void Dispose(){ |
||||
this.contentPanel.Dispose(); |
||||
} |
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
/// <summary>
|
||||
/// This Node represents a sections in the FieldsExplorer
|
||||
/// like AvailableFields, Sorting etc.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 05.06.2005 18:40:31
|
||||
/// </remarks>
|
||||
namespace SharpReportAddin { |
||||
internal class SectionTreeNode : SharpReportAddin.AbstractFieldsNode { |
||||
|
||||
public SectionTreeNode(string nodeName) { |
||||
this.Text = nodeName; |
||||
base.ContextmenuAddinTreePath = "/SharpReport/ContextMenu/ContextMenu/FieldsExplorer/SectionTreeNode"; |
||||
} |
||||
|
||||
public override string ContextmenuAddinTreePath { |
||||
get { |
||||
return base.ContextmenuAddinTreePath; |
||||
} |
||||
set { |
||||
base.ContextmenuAddinTreePath = value; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Generates a Drag & Drop data object. If this property returns null
|
||||
/// the node indicates that it can't be dragged.
|
||||
/// </summary>
|
||||
public override DataObject DragDropDataObject { |
||||
get { |
||||
return new DataObject(this); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,56 +0,0 @@
@@ -1,56 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using SharpQuery.Gui.DataView; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// This Form, derived from SharpQuery.SqlParameterInput handles the Input of
|
||||
/// Parameter's needed for Query's
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 25.06.2005 17:22:13
|
||||
/// </remarks>
|
||||
namespace SharpReportAddin { |
||||
public class ParameterInput : SQLParameterInput { |
||||
|
||||
|
||||
private AbstractParametersCollection parametersCollection; |
||||
private string reportName; |
||||
|
||||
|
||||
public ParameterInput(string reportName, |
||||
AbstractParametersCollection parametersCollection ){ |
||||
this.parametersCollection = parametersCollection; |
||||
this.reportName = reportName; |
||||
|
||||
base.dataGrid.CaptionVisible = true; |
||||
base.dataGrid.CaptionText = reportName; |
||||
FillParameters(); |
||||
} |
||||
|
||||
void FillParameters() { |
||||
SqlParameter par = null; |
||||
for (int i = 0; i < this.parametersCollection.Count; i ++) { |
||||
par = (SqlParameter)this.parametersCollection[i]; |
||||
if (par.ParameterDirection == ParameterDirection.ReturnValue) { |
||||
i--; |
||||
this.parametersCollection.Remove( par ); |
||||
} |
||||
} |
||||
base.dataGrid.DataSource = this.parametersCollection; |
||||
base.dataGrid.DataMember = null; |
||||
} |
||||
} |
||||
} |
@ -1,106 +0,0 @@
@@ -1,106 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>SharpReportAddin</RootNamespace> |
||||
<AssemblyName>SharpReportAddin</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{35D002D7-C78B-44FB-92AA-104BEB431678}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>125829120</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\SharpReport\</OutputPath> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
||||
<Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
<Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Commands\AbstractCommand\AbstractExplorerCommand.cs" /> |
||||
<Compile Include="Commands\AbstractCommand\AbstractSharpReportCommand.cs" /> |
||||
<Compile Include="Commands\ExplorerCommands.cs" /> |
||||
<Compile Include="Commands\ItemContextCommands.cs" /> |
||||
<Compile Include="Commands\SectionContextCommands.cs" /> |
||||
<Compile Include="FieldsExplorer\AbstractFieldsNode.cs" /> |
||||
<Compile Include="FieldsExplorer\ColumnsTreeNode.cs" /> |
||||
<Compile Include="FieldsExplorer\SectionTreeNode.cs" /> |
||||
<Compile Include="ParameterInput.cs" /> |
||||
<Compile Include="SharpReportDisplayBinding.cs" /> |
||||
<Compile Include="SharpReportView.cs" /> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<None Include="SharpReportAddin.addin"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<Compile Include="Commands\ViewCommands.cs" /> |
||||
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs"> |
||||
<Link>Configuration\GlobalAssemblyInfo.cs</Link> |
||||
</Compile> |
||||
<Compile Include="FieldsExplorer\ReportExplorer.cs" /> |
||||
<Compile Include="FieldsExplorer\ExplorerTree.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Folder Include="Commands" /> |
||||
<Folder Include="Commands\AbstractCommand" /> |
||||
<Folder Include="FieldsExplorer" /> |
||||
<Folder Include="Configuration" /> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\SharpReportWizard\ReportGenerator.csproj"> |
||||
<Project>{0F784A65-33B4-43EB-A49A-50A15EEF9829}</Project> |
||||
<Name>ReportGenerator</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\SharpReport\SharpReport.csproj"> |
||||
<Project>{F5563727-8309-4AC3-BACA-EB28EFD8A1D0}</Project> |
||||
<Name>SharpReport</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\SharpReportCore\SharpReportCore.csproj"> |
||||
<Project>{4B2239FF-8FD6-431D-9D22-1B8049BA6917}</Project> |
||||
<Name>SharpReportCore</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\SharpQuery\SharpQuery.csproj"> |
||||
<Project>{BDD03ECD-42AE-4B50-9805-9C19090A264F}</Project> |
||||
<Name>SharpQuery</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj"> |
||||
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project> |
||||
<Name>ICSharpCode.SharpDevelop.Widgets</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -1,110 +0,0 @@
@@ -1,110 +0,0 @@
|
||||
|
||||
// one line to give the program's name and an idea of what it does.
|
||||
// Copyright (C) 2005 peter.forstmeier@t-online.de
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using ICSharpCode.SharpDevelop; |
||||
using SharpReportAddin.Commands; |
||||
using SharpReportCore; |
||||
|
||||
/// <summary>
|
||||
/// Displaybinding for SharpReport
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 11.04.2005 23:36:45
|
||||
/// </remarks>
|
||||
namespace SharpReportAddin { |
||||
public class SharpReportDisplayBinding : IDisplayBinding { |
||||
|
||||
public SharpReportDisplayBinding() { |
||||
} |
||||
public virtual ICSharpCode.SharpDevelop.Gui.IViewContent CreateContentForLanguage(string languageName, string content) { |
||||
SharpReportView view = new SharpReportView(); |
||||
if (view != null) { |
||||
try { |
||||
ReportGenerator.CreateReport cmd = new ReportGenerator.CreateReport(view.DesignerControl.ReportModel); |
||||
cmd.Run(); |
||||
cmd = null; |
||||
view.FileName = view.DesignerControl.ReportModel.ReportSettings.FileName; |
||||
view.UpdateView(true); |
||||
view.Selected(); |
||||
view.ShowReportSettings(); |
||||
System.Console.WriteLine("Call Command"); |
||||
ShowAndFillExplorer se = new ShowAndFillExplorer(); |
||||
se.ReportModel = view.DesignerControl.ReportModel; |
||||
se.Run(); |
||||
return view; |
||||
} catch (SharpReportException) { |
||||
if (view != null) { |
||||
view.Dispose(); |
||||
} |
||||
return null; |
||||
} catch (Exception) { |
||||
if (view != null) { |
||||
view.Dispose(); |
||||
} |
||||
throw; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// We allways have to check for an installed printer
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <returns></returns>
|
||||
public virtual bool CanCreateContentForLanguage(string languageName) { |
||||
// .addin file already does the language name check
|
||||
return GlobalValues.IsValidPrinter(); |
||||
} |
||||
|
||||
public virtual ICSharpCode.SharpDevelop.Gui.IViewContent CreateContentForFile(string fileName) { |
||||
if (GlobalValues.IsValidPrinter() == true) { |
||||
SharpReportView view = new SharpReportView(); |
||||
try { |
||||
|
||||
StatusBarService.SetMessage (String.Format(CultureInfo.CurrentCulture, |
||||
"File : {0}",fileName)); |
||||
|
||||
view.Load (fileName); |
||||
view.UpdateView (false); |
||||
view.Selected(); |
||||
view.DesignerControl.ReportModel.ReportSettings.InitDone = true; |
||||
view.RegisterPropertyChangedEvents(); |
||||
return view; |
||||
} catch (Exception) { |
||||
return new SharpReportView(); |
||||
} |
||||
} else { |
||||
return null; |
||||
} |
||||
} |
||||
/// <summary>
|
||||
/// We allways have to check for an installed printer
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <returns></returns>
|
||||
public virtual bool CanCreateContentForFile(string fileName) { |
||||
// .addin file already does the language name check
|
||||
return GlobalValues.IsValidPrinter(); |
||||
} |
||||
} |
||||
} |
@ -1,653 +0,0 @@
@@ -1,653 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 10.01.2005 |
||||
* Time: 10:04 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
// one line to give the program's name and an idea of what it does.
|
||||
// Copyright (C) 2005 peter.forstmeier@t-online.de
|
||||
|
||||
using System; |
||||
using System.Data; |
||||
using System.Globalization; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using SharpReport; |
||||
using SharpReport.Designer; |
||||
using SharpReportAddin.Commands; |
||||
using SharpReportCore; |
||||
using ICSharpCode.SharpDevelop.Widgets.SideBar; |
||||
|
||||
namespace SharpReportAddin{ |
||||
/// <summary>
|
||||
/// Description of the view content
|
||||
/// </summary>
|
||||
public class SharpReportView : AbstractViewContent,IPrintable,IDisposable |
||||
{ |
||||
|
||||
private SharpReportManager reportManager; |
||||
|
||||
private BaseDesignerControl designerControl; |
||||
private SharpReportCore.ReportViewer.PreviewControl reportViewer; |
||||
private TabControl tabControl; |
||||
|
||||
|
||||
// SideBar
|
||||
private SideTab sideTabItem = null; |
||||
private SideTab sideTabFunctions = null; |
||||
private Panel panel; |
||||
|
||||
private bool disposed; |
||||
|
||||
#region privates
|
||||
|
||||
void InitView() { |
||||
try { |
||||
reportManager = new SharpReportManager(); |
||||
panel = new Panel(); |
||||
panel.AutoScroll = true; |
||||
panel.Dock = DockStyle.Fill; |
||||
CreateTabControl(); |
||||
SharpReportView.BuildToolBarItems(); |
||||
if (PropertyPad.Grid != null) { |
||||
PropertyPad.Grid.SelectedObject = designerControl.ReportModel.ReportSettings; |
||||
PropertyPad.Grid.Refresh(); |
||||
} |
||||
|
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
|
||||
// when the model is build, grap these events, otherwise we get permanent
|
||||
// changes of IsDirty
|
||||
|
||||
private void SetOnPropertyChangedEvents () { |
||||
try { |
||||
ReportModel model = designerControl.ReportModel; |
||||
|
||||
model.ReportSettings.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
model.ReportHeader.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
model.PageHeader.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
model.DetailSection.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
model.PageFooter.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
model.ReportFooter.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
//watch for FileName change from Reportsettings as well
|
||||
model.ReportSettings.FileNameChanged += new EventHandler(OnModelFileNameChanged); |
||||
} catch (Exception) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Control
|
||||
|
||||
private BaseDesignerControl CreateDesignerControl() { |
||||
BaseDesignerControl ctrl = reportManager.BaseDesignControl; |
||||
ctrl.SuspendLayout(); |
||||
ctrl.ReportControl.Width = ctrl.ReportModel.ReportSettings.PageSettings.Bounds.Width; |
||||
ctrl.ReportControl.ObjectSelected +=new EventHandler <EventArgs>(OnObjectSelected); |
||||
ctrl.ReportControl.DesignViewChanged += new ItemDragDropEventHandler (OnItemDragDrop); |
||||
ctrl.DesignerDirty += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged); |
||||
ctrl.ResumeLayout(); |
||||
return ctrl; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region SideBar Handling
|
||||
|
||||
private static bool SharpReportIsRunning () { |
||||
|
||||
foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) { |
||||
SharpReportView view = content as SharpReportView; |
||||
if (view != null) { |
||||
return true; |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
private static SharpDevelopSideBar GetSideBar () { |
||||
SideBarView v = (SideBarView)WorkbenchSingleton.Workbench.GetPad (typeof(SideBarView)).PadContent; |
||||
SharpDevelopSideBar sb =(SharpDevelopSideBar) v.Control; |
||||
return sb; |
||||
} |
||||
|
||||
private static void BuildToolBarItems() { |
||||
|
||||
SharpDevelopSideBar sideBar = SharpReportView.GetSideBar(); |
||||
|
||||
if (!SharpReportView.SharpReportIsRunning()) { |
||||
SharpReport.BuildSideTab buildSideTab = new SharpReport.BuildSideTab (sideBar); |
||||
buildSideTab.CreateSidetabs(); |
||||
sideBar.Refresh(); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void RemoveSideBarItem() { |
||||
|
||||
if (!SharpReportView.SharpReportIsRunning()) { |
||||
if (sideTabItem != null) { |
||||
SharpDevelopSideBar sideBar = SharpReportView.GetSideBar(); |
||||
sideBar.Tabs.Remove (sideTabItem); |
||||
} |
||||
|
||||
if (this.sideTabFunctions != null) { |
||||
SharpDevelopSideBar sideBar = GetSideBar(); |
||||
sideBar.Tabs.Remove(this.sideTabFunctions); |
||||
} |
||||
SideBarView v = (SideBarView)WorkbenchSingleton.Workbench.GetPad (typeof(SideBarView)).PadContent; |
||||
SharpDevelopSideBar sb =(SharpDevelopSideBar) v.Control; |
||||
|
||||
SideTab s; |
||||
for (int i = SideBarView.sideBar.Tabs.Count -1; i > 0;i -- ) { |
||||
s = SideBarView.sideBar.Tabs[i]; |
||||
#warning Users can add custom tools to tabs with name of their choice - and they might include "Report" in the name
|
||||
if (s.Name.IndexOf("Report") > 0) { |
||||
SideBarView.sideBar.Tabs.Remove(s); |
||||
} |
||||
} |
||||
sb.Refresh(); |
||||
} |
||||
} |
||||
|
||||
|
||||
void ShutDownView (object sender,ViewContentEventArgs e) { |
||||
|
||||
if (e.Content is SharpReportView) { |
||||
WorkbenchSingleton.Workbench.ViewClosed -= new ViewContentEventHandler(ShutDownView); |
||||
} |
||||
|
||||
//Allways hide the pad
|
||||
|
||||
HideExplorer he = new HideExplorer(); |
||||
he.Run(); |
||||
|
||||
ClearAndRebuildExplorer cmd = new ClearAndRebuildExplorer(); |
||||
cmd.Run(); |
||||
|
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region TabControl including Events
|
||||
|
||||
void CreateTabControl() { |
||||
|
||||
this.tabControl = BuildDesignerTab.BuildTabControl(); |
||||
|
||||
this.tabControl.SelectedIndexChanged += new EventHandler (OnTabPageChanged); |
||||
this.tabControl.Selecting += new TabControlCancelEventHandler(OnTabPageSelecting); |
||||
|
||||
this.designerControl = CreateDesignerControl(); |
||||
this.tabControl.TabPages[0].Controls.Add (this.designerControl); |
||||
|
||||
this.panel.Controls.Add (this.tabControl); |
||||
SetHeadLines(); |
||||
} |
||||
|
||||
//We set all captions in one method, so we can react much easier on changing of lanuages
|
||||
void SetHeadLines(){ |
||||
this.tabControl.TabPages[0].Text = ResourceService.GetString("SharpReport.Design"); |
||||
this.tabControl.TabPages[1].Text = ResourceService.GetString("SharpReport.Preview"); |
||||
this.tabControl.TabPages[2].Text = "ReportViewer"; |
||||
this.OnTabPageChanged (this,EventArgs.Empty); |
||||
this.designerControl.Localise(); |
||||
} |
||||
void SetTabTitel (string name) { |
||||
base.TitleName = String.Format(CultureInfo.CurrentCulture, |
||||
"{0} [{1}]",name,this.tabControl.SelectedTab.Text); |
||||
} |
||||
|
||||
private void OnTabPageSelecting (object sender,TabControlCancelEventArgs e) { |
||||
switch (e.TabPageIndex) { |
||||
case 0: |
||||
break; |
||||
case 1: |
||||
if (e.TabPage.Controls.Count == 0) { |
||||
e.TabPage.Controls.Add(reportManager.PreviewControl); |
||||
} |
||||
break; |
||||
case 2: |
||||
if (e.TabPage.Controls.Count == 0) { |
||||
this.reportViewer = new SharpReportCore.ReportViewer.PreviewControl(); |
||||
this.reportViewer.Dock = DockStyle.Fill; |
||||
this.reportViewer.PageSettings = new System.Drawing.Printing.PageSettings(); |
||||
e.TabPage.Controls.Add(this.reportViewer); |
||||
|
||||
} |
||||
break; |
||||
} |
||||
} |
||||
|
||||
private void OnTabPageChanged (object sender, EventArgs e) { |
||||
|
||||
string name; |
||||
if (String.IsNullOrEmpty(base.FileName)) { |
||||
base.UntitledName = GlobalValues.SharpReportPlainFileName; |
||||
base.TitleName = GlobalValues.SharpReportPlainFileName; |
||||
base.FileName = GlobalValues.SharpReportPlainFileName; |
||||
name = base.TitleName; |
||||
} else { |
||||
name = Path.GetFileName (base.FileName); |
||||
} |
||||
SetTabTitel (name); |
||||
switch (tabControl.SelectedIndex) { |
||||
case 0 : |
||||
break; |
||||
case 1: |
||||
RunPreview(true); |
||||
this.tabControl.SelectedTab.Visible = true; |
||||
break; |
||||
case 2: |
||||
FillReportViewer(); |
||||
break; |
||||
default: |
||||
|
||||
break; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Preview handling
|
||||
|
||||
private void RunPreview(bool standAlone) { |
||||
base.OnSaving(EventArgs.Empty); |
||||
this.UpdateModelFromExplorer(); |
||||
try { |
||||
switch (designerControl.ReportModel.DataModel) { |
||||
case GlobalEnums.PushPullModel.FormSheet : { |
||||
PreviewStandartReport(standAlone); |
||||
break; |
||||
} |
||||
case GlobalEnums.PushPullModel.PullData:{ |
||||
PreviewStandartReport(standAlone); |
||||
break; |
||||
} |
||||
case GlobalEnums.PushPullModel.PushData:{ |
||||
PreviewPushReport (standAlone); |
||||
break; |
||||
} |
||||
default: |
||||
throw new SharpReportException("Wrong ReportType"); |
||||
|
||||
} |
||||
} catch (Exception e) { |
||||
MessageService.ShowError(e); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
private void PreviewPushReport (bool standAlone){ |
||||
try { |
||||
DataSetFromXSDCommand cmd = new DataSetFromXSDCommand (); |
||||
cmd.Run(); |
||||
DataSet ds = cmd.DataSet; |
||||
reportManager.ReportPreviewPushData(designerControl.ReportModel, |
||||
ds, |
||||
standAlone); |
||||
}catch (Exception e){ |
||||
MessageService.ShowError (e,e.Message); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void PreviewStandartReport(bool standAlone){ |
||||
reportManager.ParametersRequest -= new EventHandler<SharpReportParametersEventArgs> (OnParametersRequest); |
||||
reportManager.ParametersRequest += new EventHandler<SharpReportParametersEventArgs>(OnParametersRequest); |
||||
|
||||
reportManager.ReportPreview (designerControl.ReportModel, standAlone); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region ReportViewer
|
||||
|
||||
private void FillReportViewer() { |
||||
System.Console.WriteLine("FillReportViewer"); |
||||
// System.Console.WriteLine("\tsetup pagebuilder{0}",DateTime.Now);
|
||||
SharpReportCore.Exporters.PageBuilder pb = reportManager.CreatePageBuilder (designerControl.ReportModel); |
||||
// System.Console.WriteLine("\tstart createreport{0}",DateTime.Now);
|
||||
|
||||
pb.BuildExportList(); |
||||
// System.Console.WriteLine("\treport created {0}",DateTime.Now);
|
||||
SharpReportCore.Exporters.SinglePage sp= pb.FirstPage; |
||||
// System.Console.WriteLine("\tPages {0} SinglePage : Items {0}",pb.Pages.Count,sp.Items.Count);
|
||||
|
||||
this.reportViewer.SetPages (pb.Pages); |
||||
|
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region Events
|
||||
|
||||
///<summary>This Event is called if the Report need's Parameters to run a Query,
|
||||
/// you can take this as an example how to react to an request for Parameters
|
||||
/// The other posibillity is, to fill/change the ParametersCollection by Code or
|
||||
/// just write an small Dialog to enter the Parameter values
|
||||
/// </summary>
|
||||
|
||||
private void OnParametersRequest (object sender,SharpReportParametersEventArgs e) { |
||||
SqlParametersCollection collection = e.SqlParametersCollection; |
||||
if (collection != null && collection.Count > 0) { |
||||
using (ParameterDialog dlg = new ParameterDialog(e.SqlParametersCollection)){ |
||||
DialogResult result = dlg.ShowDialog(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
//Something was dropped on the designer
|
||||
|
||||
private void OnItemDragDrop (object sender,ItemDragDropEventArgs e) { |
||||
base.IsDirty = true; |
||||
this.OnPropertyChanged (this,new System.ComponentModel.PropertyChangedEventArgs("Item Dragged")); |
||||
} |
||||
|
||||
private void OnPropertyChanged (object sender, |
||||
System.ComponentModel.PropertyChangedEventArgs e) { |
||||
base.IsDirty = true; |
||||
OnObjectSelected (this,EventArgs.Empty); |
||||
} |
||||
|
||||
private void OnModelFileNameChanged (object sender,EventArgs e) { |
||||
base.FileName = designerControl.ReportModel.ReportSettings.FileName; |
||||
if (designerControl.ReportModel.ReportSettings.InitDone) { |
||||
base.IsDirty = true; |
||||
this.OnFileNameChanged(e); |
||||
this.SetTabTitel(Path.GetFileName (base.FileName)); |
||||
} |
||||
} |
||||
|
||||
|
||||
private void OnObjectSelected (object sender,EventArgs e) { |
||||
|
||||
if (designerControl.ReportControl.SelectedObject != null) { |
||||
BaseReportObject newobj = designerControl.ReportControl.SelectedObject; |
||||
newobj.ResumeLayout(); |
||||
|
||||
if (PropertyPad.Grid != null) { |
||||
PropertyPad.Grid.SelectedObject = designerControl.ReportControl.SelectedObject; |
||||
} |
||||
} |
||||
} |
||||
|
||||
private void UpdateModelFromExplorer () { |
||||
ReportExplorer re = (SharpReportAddin.ReportExplorer)WorkbenchSingleton.Workbench.GetPad(typeof(ReportExplorer)).PadContent; |
||||
re.Update(designerControl.ReportModel); |
||||
} |
||||
#endregion
|
||||
|
||||
#region Calls from outside commands
|
||||
|
||||
/// <summary>
|
||||
/// Set PropertyGrid to ReportSettings
|
||||
/// </summary>
|
||||
public void ShowReportSettings () { |
||||
if (PropertyPad.Grid != null) { |
||||
PropertyPad.Grid.SelectedObject = designerControl.ReportControl.ReportSettings; |
||||
PropertyPad.Grid.Refresh(); |
||||
} |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Show's Report in PreviewControl
|
||||
/// </summary>
|
||||
|
||||
public void OnPreviewClick () { |
||||
reportManager.ParametersRequest -= new EventHandler<SharpReportParametersEventArgs> (OnParametersRequest); |
||||
reportManager.ParametersRequest += new EventHandler<SharpReportParametersEventArgs>(OnParametersRequest); |
||||
|
||||
base.OnSaving(EventArgs.Empty); |
||||
this.RunPreview(false); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Remove the selected Item from <see cref="BaseDesignerControl"></see>
|
||||
/// </summary>
|
||||
|
||||
public void RemoveSelectedItem () { |
||||
this.designerControl.RemoveSelectedItem (); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This Method is called after something has changed like Load a new report
|
||||
/// Change Sorting or Grouping etc. to update the View and set the DirtyFlag
|
||||
/// </summary>
|
||||
/// <param name="setViewDirty">If true, set the DirtyFlag and Fire the PropertyChanged Event</param>
|
||||
|
||||
public void UpdateView(bool setViewDirty) { |
||||
this.tabControl.SelectedIndex = 0; |
||||
this.OnTabPageChanged(this,EventArgs.Empty); |
||||
if (setViewDirty) { |
||||
this.OnPropertyChanged (this,new System.ComponentModel.PropertyChangedEventArgs("Fired from UpdateView")); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Tells the <see cref="BaseDesignerControl"></see> to fire an Event if
|
||||
/// something in the report layout changes
|
||||
/// </summary>
|
||||
|
||||
public void RegisterPropertyChangedEvents () { |
||||
SetOnPropertyChangedEvents(); |
||||
this.designerControl.RegisterEvents(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Propertys
|
||||
/// <summary>
|
||||
/// Returns the complete Designer
|
||||
/// </summary>
|
||||
|
||||
public BaseDesignerControl DesignerControl { |
||||
get { |
||||
return designerControl; |
||||
} |
||||
} |
||||
|
||||
///<summary>
|
||||
/// returns a ReportManager
|
||||
/// </summary>
|
||||
|
||||
public SharpReportManager ReportManager { |
||||
get { |
||||
return reportManager; |
||||
} |
||||
} |
||||
|
||||
public bool Disposed { |
||||
get { |
||||
return disposed; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
#region AbstractViewContent requirements
|
||||
/// <summary>
|
||||
/// The <see cref="System.Windows.Forms.Control"/> representing the view
|
||||
/// </summary>
|
||||
public override Control Control { |
||||
get { |
||||
return panel; |
||||
} |
||||
} |
||||
|
||||
public override void RedrawContent() { |
||||
|
||||
SetHeadLines(); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Save's the Report
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
public override void Save(string fileName) { |
||||
try { |
||||
UpdateModelFromExplorer (); |
||||
designerControl.ReportModel.ReportSettings.FileName = fileName; |
||||
|
||||
if (FileUtility.IsValidFileName(fileName)) { |
||||
OnSaving(EventArgs.Empty); |
||||
reportManager.SaveToFile (fileName); |
||||
base.IsDirty = false; |
||||
OnSaved(new SaveEventArgs(true)); |
||||
} else { |
||||
MessageService.ShowError ("<" + fileName + "> invalid Filename"); |
||||
base.IsDirty = true; |
||||
} |
||||
} catch (Exception e) { |
||||
MessageService.ShowError(e,"SharpReportView:Save"); |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
|
||||
public override void Save() { |
||||
this.Save (designerControl.ReportModel.ReportSettings.FileName); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Creates a new SharpReportView object
|
||||
/// </summary>
|
||||
public SharpReportView():base() { |
||||
if (GlobalValues.IsValidPrinter()) { |
||||
InitView(); |
||||
this.UpdateView(false); |
||||
|
||||
if (!SharpReportView.SharpReportIsRunning()) { |
||||
WorkbenchSingleton.Workbench.ViewClosed += new ViewContentEventHandler(ShutDownView); |
||||
} |
||||
|
||||
} else { |
||||
MessageService.ShowError(ResourceService.GetString("Sharpreport.Error.NoPrinter")); |
||||
} |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Loads a new file into View
|
||||
/// </summary>
|
||||
/// <param name="fileName">A valid Filename</param>
|
||||
public override void Load(string fileName){ |
||||
|
||||
try { |
||||
designerControl.ReportControl.ObjectSelected -= new EventHandler <EventArgs>(OnObjectSelected); |
||||
reportManager.LoadFromFile (fileName); |
||||
base.FileName = fileName; |
||||
designerControl.ReportModel.ReportSettings.FileName = fileName; |
||||
designerControl.ReportControl.ObjectSelected += new EventHandler <EventArgs>(OnObjectSelected); |
||||
if (PropertyPad.Grid != null) { |
||||
PropertyPad.Grid.SelectedObject = designerControl.ReportModel.ReportSettings; |
||||
PropertyPad.Grid.Refresh(); |
||||
} |
||||
|
||||
this.designerControl.ReportModel.ReportSettings.AvailableFieldsCollection = reportManager.AvailableFieldsCollection; |
||||
ShowAndFillExplorer se = new ShowAndFillExplorer(); |
||||
se.ReportModel = this.designerControl.ReportModel; |
||||
se.Run(); |
||||
|
||||
} catch (Exception e) { |
||||
MessageService.ShowError(e,"SharpReportView:Load"); |
||||
throw ; |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region ICSharpCode.SharpDevelop.Gui.IPrintable interface implementation
|
||||
|
||||
public System.Drawing.Printing.PrintDocument PrintDocument { |
||||
get { |
||||
AbstractRenderer renderer; |
||||
if (this.designerControl.ReportModel.DataModel == GlobalEnums.PushPullModel.PushData) { |
||||
DataSetFromXSDCommand cmd = new DataSetFromXSDCommand(); |
||||
cmd.Run(); |
||||
DataSet dataSet = cmd.DataSet; |
||||
renderer = reportManager.GetRendererForPushDataReports(this.designerControl.ReportModel, |
||||
dataSet); |
||||
|
||||
} else { |
||||
try { |
||||
renderer = reportManager.GetRendererForStandartReports(this.designerControl.ReportModel); |
||||
} catch (Exception e) { |
||||
MessageService.ShowError (e,"SharpReportManager:ReportPreview"); |
||||
return null; |
||||
} |
||||
} |
||||
return renderer.ReportDocument; |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable
|
||||
|
||||
public override void Dispose(){ |
||||
if (PropertyPad.Grid != null) { |
||||
PropertyPad.Grid.SelectedObject = null; |
||||
} |
||||
|
||||
this.disposed = true; |
||||
RemoveSideBarItem(); |
||||
this.Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~SharpReportView(){ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected void Dispose(bool disposing){ |
||||
if (disposing) { |
||||
// Free other state (managed objects).
|
||||
if (this.reportManager != null) { |
||||
this.reportManager.Dispose(); |
||||
} |
||||
if (this.designerControl != null) { |
||||
this.designerControl.Dispose(); |
||||
} |
||||
|
||||
if (this.reportViewer != null) { |
||||
this.reportViewer.Dispose(); |
||||
} |
||||
|
||||
if (this.tabControl != null) { |
||||
this.tabControl.Dispose(); |
||||
} |
||||
if (this.panel != null) { |
||||
this.panel.Dispose(); |
||||
} |
||||
} |
||||
|
||||
// Release unmanaged resources.
|
||||
// Set large fields to null.
|
||||
// Call Dispose on your base class.
|
||||
base.Dispose(); |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
|
||||
} |
@ -1,59 +0,0 @@
@@ -1,59 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
|
||||
/// <summary>
|
||||
/// This class is used as an Abtract Class for all Columns like, AvailableFields,Sorting,Grouping etc.
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 26.05.2005 16:19:45
|
||||
/// </remarks>
|
||||
///
|
||||
namespace SharpReportCore { |
||||
public class AbstractColumn : object { |
||||
|
||||
string columnName; |
||||
Type dataType; |
||||
|
||||
|
||||
public AbstractColumn() { |
||||
} |
||||
|
||||
public AbstractColumn(string columnName){ |
||||
this.columnName = columnName; |
||||
this.dataType = typeof(System.String); |
||||
} |
||||
|
||||
public AbstractColumn(string columnName, Type dataType){ |
||||
this.columnName = columnName; |
||||
this.dataType = dataType; |
||||
} |
||||
|
||||
public string ColumnName { |
||||
get { |
||||
return columnName; |
||||
} |
||||
set { |
||||
columnName = value; |
||||
} |
||||
} |
||||
public Type DataType { |
||||
get { |
||||
return dataType; |
||||
} |
||||
set { |
||||
dataType = value; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,44 +0,0 @@
@@ -1,44 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SharpReportCore { |
||||
using System; |
||||
|
||||
|
||||
/// <summary>
|
||||
/// This Class is an AbstractParameter
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 30.06.2005 10:23:42
|
||||
/// </remarks>
|
||||
public class AbstractParameter : object { |
||||
|
||||
string parameterName; |
||||
|
||||
public AbstractParameter() { |
||||
} |
||||
|
||||
|
||||
/// <summary>
|
||||
/// Name of the Parameter
|
||||
/// </summary>
|
||||
///
|
||||
public string ParameterName { |
||||
get { |
||||
return parameterName; |
||||
} |
||||
set { |
||||
parameterName = value; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,83 +0,0 @@
@@ -1,83 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 27.06.2006 |
||||
* Time: 09:12 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
|
||||
namespace SharpReportCore |
||||
{ |
||||
/// <summary>
|
||||
/// Description of DataType.
|
||||
/// </summary>
|
||||
internal class DataTypeHelper{ |
||||
|
||||
//TODO why not use
|
||||
// TypeCode tc = Type.GetTypeCode( Type.GetType("System.String"));
|
||||
private DataTypeHelper () { |
||||
|
||||
} |
||||
internal static TypeCode TypeCodeFromString (string type) { |
||||
TypeCode tc; |
||||
|
||||
if (type == null) { |
||||
type = "System.String"; |
||||
} |
||||
|
||||
if (type.StartsWith("System.")){ |
||||
type = type.Substring(7); |
||||
} |
||||
|
||||
switch (type){ |
||||
case "DateTime": |
||||
tc = TypeCode.DateTime; |
||||
break; |
||||
|
||||
case "Boolean": |
||||
tc = TypeCode.Boolean; |
||||
break; |
||||
|
||||
|
||||
case "String": |
||||
case "Char": |
||||
tc = TypeCode.String; |
||||
break; |
||||
|
||||
case "Decimal": |
||||
tc = TypeCode.Decimal; |
||||
break; |
||||
case "Integer": |
||||
case "Int16": |
||||
case "Int32": |
||||
tc = TypeCode.Int32; |
||||
break; |
||||
case "Float": |
||||
case "Single": |
||||
case "Double": |
||||
tc = TypeCode.Double; |
||||
break; |
||||
|
||||
default: |
||||
tc = TypeCode.Object; |
||||
break; |
||||
} |
||||
return tc; |
||||
} |
||||
|
||||
internal static bool IsNumber(TypeCode tc){ |
||||
|
||||
switch (tc){ |
||||
case TypeCode.Int32: |
||||
case TypeCode.Double: |
||||
case TypeCode.Decimal: |
||||
return true; |
||||
default: // user error
|
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,48 +0,0 @@
@@ -1,48 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SharpReportCore { |
||||
using System; |
||||
using System.ComponentModel; |
||||
|
||||
/// <summary>
|
||||
/// This Class build an Grouping Item
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 05.05.2005 22:26:29
|
||||
/// </remarks>
|
||||
public class GroupColumn : SharpReportCore.SortColumn { |
||||
|
||||
int groupLevel; |
||||
|
||||
|
||||
public GroupColumn() { |
||||
} |
||||
|
||||
|
||||
public GroupColumn(string columnName,int groupLevel, ListSortDirection sortDirection):base(columnName,sortDirection) |
||||
{ |
||||
this.groupLevel = groupLevel; |
||||
base.SortDirection = sortDirection; |
||||
} |
||||
|
||||
|
||||
public int GroupLevel { |
||||
get { |
||||
return groupLevel; |
||||
} |
||||
set { |
||||
groupLevel = value; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,71 +0,0 @@
@@ -1,71 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SharpReportCore { |
||||
using System; |
||||
using System.ComponentModel; |
||||
|
||||
/// <summary>
|
||||
/// This Class represents a Column to sort
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 18.05.2005 11:34:45
|
||||
/// </remarks>
|
||||
public class SortColumn : AbstractColumn { |
||||
ListSortDirection sortDirection = ListSortDirection.Ascending; |
||||
bool caseSensitive; |
||||
|
||||
|
||||
public SortColumn() { |
||||
} |
||||
|
||||
public SortColumn(string columnName,Type type ):this(columnName,ListSortDirection.Ascending,type,false){ |
||||
} |
||||
|
||||
|
||||
|
||||
public SortColumn(string columnName,ListSortDirection sortDirection) |
||||
:this(columnName,sortDirection,null,false){ |
||||
} |
||||
|
||||
public SortColumn(string columnName,ListSortDirection sortDirection,Type type) |
||||
:this(columnName,sortDirection,type,false){ |
||||
} |
||||
|
||||
public SortColumn(string columnName, ListSortDirection sortDirection, Type type,bool caseSensitive ):base (columnName,type) |
||||
{ |
||||
this.caseSensitive = caseSensitive; |
||||
this.sortDirection = sortDirection; |
||||
} |
||||
|
||||
#region propertie's
|
||||
|
||||
|
||||
public ListSortDirection SortDirection { |
||||
get { |
||||
return sortDirection; |
||||
} |
||||
set { |
||||
sortDirection = value; |
||||
} |
||||
} |
||||
public bool CaseSensitive { |
||||
get { |
||||
return caseSensitive; |
||||
} |
||||
set { |
||||
caseSensitive = value; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,206 +0,0 @@
@@ -1,206 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SharpReportCore { |
||||
using System; |
||||
using System.Data; |
||||
using System.Globalization; |
||||
|
||||
/// <summary>
|
||||
/// According to the definition in
|
||||
/// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsrdl/htm/rsp_ref_rdl_elements_qz_629g.asp
|
||||
///
|
||||
/// This Class definies a Reportparameter
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 30.05.2005 22:20:41
|
||||
/// </remarks>
|
||||
public class SqlParameter : AbstractParameter { |
||||
|
||||
DbType dataType; |
||||
object parameterValue; |
||||
|
||||
ParameterDirection parameterDirection = ParameterDirection.InputOutput; |
||||
|
||||
#region Constructor
|
||||
|
||||
public SqlParameter():base() { |
||||
} |
||||
|
||||
|
||||
|
||||
public SqlParameter(string parameterName, |
||||
DbType dataType, |
||||
object parameterValue) |
||||
:this(parameterName,dataType,parameterValue,ParameterDirection.Input){ |
||||
|
||||
} |
||||
|
||||
|
||||
public SqlParameter(string parameterName, |
||||
DbType dataType, |
||||
object parameterValue, |
||||
ParameterDirection parameterDirection):base(){ |
||||
|
||||
base.ParameterName = parameterName; |
||||
this.DataType = dataType; |
||||
this.parameterValue = parameterValue; |
||||
|
||||
this.parameterDirection = parameterDirection; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
private void SetValue (string value) { |
||||
switch( this.DataType ) |
||||
{ |
||||
//string type
|
||||
case DbType.Object : |
||||
case DbType.Binary : |
||||
case DbType.AnsiString : |
||||
case DbType.AnsiStringFixedLength : |
||||
case DbType.String : |
||||
case DbType.StringFixedLength : this.parameterValue = value; break; |
||||
|
||||
case DbType.Boolean : { |
||||
|
||||
this.parameterValue = bool.Parse( value); |
||||
break; |
||||
} |
||||
|
||||
|
||||
case DbType.SByte : { |
||||
this.parameterValue = sbyte.Parse( value, |
||||
CultureInfo.CurrentCulture ); |
||||
break; |
||||
} |
||||
case DbType.Byte :{ |
||||
this.parameterValue = byte.Parse( value , |
||||
CultureInfo.CurrentCulture ); |
||||
break; |
||||
} |
||||
case DbType.Int16 : { |
||||
this.parameterValue = short.Parse( value,CultureInfo.CurrentCulture ); break; |
||||
} |
||||
case DbType.Int32 : { |
||||
this.parameterValue = int.Parse( value,CultureInfo.CurrentCulture ); |
||||
break; |
||||
} |
||||
case DbType.Int64 : { |
||||
this.parameterValue = long.Parse( value,CultureInfo.CurrentCulture ); |
||||
break; |
||||
} |
||||
case DbType.UInt16 : this.parameterValue = ushort.Parse( value,CultureInfo.CurrentCulture ); break; |
||||
case DbType.UInt32 : this.parameterValue = uint.Parse( value,CultureInfo.CurrentCulture ); break; |
||||
case DbType.UInt64 : this.parameterValue = long.Parse( value,CultureInfo.CurrentCulture ); break; |
||||
|
||||
case DbType.Date : |
||||
case DbType.DateTime : |
||||
case DbType.Time : this.parameterValue = DateTime.Parse( value,CultureInfo.CurrentCulture ); break; |
||||
|
||||
case DbType.Decimal : this.parameterValue = decimal.Parse( value ,CultureInfo.CurrentCulture ); break; |
||||
case DbType.Currency : |
||||
case DbType.VarNumeric : |
||||
case DbType.Double : this.parameterValue = double.Parse( value ,CultureInfo.CurrentCulture ); break; |
||||
case DbType.Single : this.parameterValue = float.Parse( value,CultureInfo.CurrentCulture ); break; |
||||
|
||||
case DbType.Guid : this.parameterValue = new Guid( value ); break; |
||||
default : { |
||||
throw new ArgumentOutOfRangeException("value"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// DataType of the Parameter
|
||||
/// <see cref="System.Data.DbType">DbType</see>
|
||||
/// </summary>
|
||||
public DbType DataType { |
||||
get { |
||||
return dataType; |
||||
} |
||||
set { |
||||
|
||||
dataType = value; |
||||
|
||||
switch( value ){ |
||||
//string type
|
||||
case DbType.AnsiString : |
||||
case DbType.AnsiStringFixedLength : |
||||
case DbType.String : |
||||
case DbType.StringFixedLength :{ |
||||
this.parameterValue = new string( (char[])null ); |
||||
break; |
||||
} |
||||
//array type
|
||||
case DbType.Binary : this.parameterValue = new byte[8000]; break; |
||||
//bool type
|
||||
case DbType.Boolean : this.parameterValue = new bool(); break; |
||||
//interger type
|
||||
case DbType.SByte : this.parameterValue = new sbyte(); break; |
||||
case DbType.Byte : this.parameterValue = new byte(); break; |
||||
case DbType.Int16 : this.parameterValue = new short(); break; |
||||
case DbType.Int32 : this.parameterValue = new int(); break; |
||||
case DbType.Int64 : this.parameterValue = new long(); break; |
||||
case DbType.UInt16 : this.parameterValue = new ushort(); break; |
||||
case DbType.UInt32 : this.parameterValue = new uint(); break; |
||||
case DbType.UInt64 : this.parameterValue = new long(); break; |
||||
//Date type
|
||||
case DbType.Date : |
||||
case DbType.DateTime : |
||||
case DbType.Time :{ |
||||
this.parameterValue = new DateTime(); |
||||
break; |
||||
} |
||||
//float type
|
||||
case DbType.Decimal : this.parameterValue = new decimal(); break; |
||||
case DbType.Currency : |
||||
case DbType.VarNumeric : |
||||
case DbType.Double : this.parameterValue = new double(); break; |
||||
case DbType.Single : this.parameterValue = new float(); break; |
||||
//user defined
|
||||
case DbType.Object : this.parameterValue = new object(); break; |
||||
//Guid
|
||||
case DbType.Guid : this.parameterValue = new Guid(); break; |
||||
default : throw new ArgumentOutOfRangeException("value"); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
|
||||
public object ParameterValue { |
||||
get { |
||||
return parameterValue; |
||||
} |
||||
set{ |
||||
SetValue (value.ToString()); |
||||
} |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Direction of Parameter
|
||||
/// <see cref="System.Data.ParameterDirection">ParameterDirection</see>
|
||||
///</summary>
|
||||
|
||||
public ParameterDirection ParameterDirection { |
||||
get { |
||||
return parameterDirection; |
||||
} |
||||
set { |
||||
parameterDirection = value; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,186 +0,0 @@
@@ -1,186 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Xml.Serialization; |
||||
|
||||
using SharpReportCore.Exporters; |
||||
|
||||
/// <summary>
|
||||
/// This Class is used for Databased items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 22.08.2005 00:12:59
|
||||
/// </remarks>
|
||||
namespace SharpReportCore { |
||||
public class BaseDataItem : SharpReportCore.BaseTextItem,IItemRenderer, |
||||
IExportColumnBuilder { |
||||
|
||||
private string columnName; |
||||
private string baseTableName; |
||||
private string dbValue; |
||||
private string dataType; |
||||
private string nullValue; |
||||
|
||||
|
||||
#region Constructor
|
||||
|
||||
public BaseDataItem():base() { |
||||
this.dataType = "System.String"; |
||||
} |
||||
|
||||
public BaseDataItem(string columnName):base(){ |
||||
this.columnName = columnName; |
||||
this.dataType = "System.String"; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region privates
|
||||
|
||||
//TODO Need a much better handling for 'null' values
|
||||
|
||||
private string CheckForNullValue() { |
||||
if (String.IsNullOrEmpty(this.dbValue)) { |
||||
if (String.IsNullOrEmpty(this.nullValue)) { |
||||
return GlobalValues.UnboundName; |
||||
|
||||
} else |
||||
return this.nullValue; |
||||
} |
||||
return this.dbValue; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IExportColumnBuilder implementation
|
||||
public new BaseExportColumn CreateExportColumn(Graphics graphics){ |
||||
string toPrint = CheckForNullValue(); |
||||
TextStyleDecorator st = base.CreateItemStyle(graphics); |
||||
ExportText item = new ExportText(st,false); |
||||
item.Text = base.FormatOutput(toPrint, |
||||
this.FormatString, |
||||
DataTypeHelper.TypeCodeFromString (this.dataType), |
||||
this.nullValue); |
||||
return item; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
public override void Render(SharpReportCore.ReportPageEventArgs rpea) { |
||||
|
||||
// TypeCode tc = Type.GetTypeCode( Type.GetType(this.dataType));
|
||||
|
||||
// TODO this.DbValue should beformatted in the BeforePrintEvent
|
||||
|
||||
string toPrint = CheckForNullValue(); |
||||
|
||||
|
||||
base.Text = base.FormatOutput(toPrint, |
||||
this.FormatString, |
||||
DataTypeHelper.TypeCodeFromString (this.dataType), |
||||
this.nullValue); |
||||
base.Render (rpea); |
||||
|
||||
} |
||||
|
||||
public override string ToString() { |
||||
return "BaseDataItem"; |
||||
} |
||||
|
||||
#region Properies
|
||||
|
||||
[XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public virtual string DbValue { |
||||
get { |
||||
return dbValue; |
||||
} |
||||
set { |
||||
dbValue = value; |
||||
} |
||||
} |
||||
|
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("Datatype of the underlying Column")] |
||||
|
||||
public virtual string ColumnName { |
||||
get { |
||||
if (String.IsNullOrEmpty(columnName)) { |
||||
this.columnName = GlobalValues.UnboundName; |
||||
} |
||||
return columnName; |
||||
} |
||||
set { |
||||
columnName = value; |
||||
this.Text = this.columnName; |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("Datatype of the underlying Column")] |
||||
public string DataType { |
||||
get { |
||||
return dataType; |
||||
} |
||||
set { |
||||
dataType = value; |
||||
} |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Mappingname to Datasource
|
||||
/// </summary>
|
||||
///
|
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("Mapping Name to DataTable")] |
||||
[XmlIgnoreAttribute] |
||||
public string MappingName { |
||||
get { |
||||
return baseTableName + "." + columnName; |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("TableName")] |
||||
public string BaseTableName { |
||||
get { |
||||
return baseTableName; |
||||
} |
||||
set { |
||||
baseTableName = value; |
||||
} |
||||
} |
||||
[Browsable(true), |
||||
Category("Databinding"), |
||||
Description("Display Value for empty Field")] |
||||
public string NullValue { |
||||
get { |
||||
return nullValue; |
||||
} |
||||
set { |
||||
nullValue = value; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,50 +0,0 @@
@@ -1,50 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SharpReportCore { |
||||
using System; |
||||
using System.ComponentModel; |
||||
|
||||
/// <summary>
|
||||
/// BaseClass for all Functions
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 05.09.2005 22:25:18
|
||||
/// </remarks>
|
||||
public class BaseFunction : SharpReportCore.BaseTextItem { |
||||
string localisedName; |
||||
|
||||
public BaseFunction():base() { |
||||
this.localisedName = "SharpReport.Toolbar.Functions"; |
||||
} |
||||
|
||||
public BaseFunction(string friendlyName) |
||||
{ |
||||
this.localisedName = friendlyName; |
||||
} |
||||
|
||||
public override string ToString() |
||||
{ |
||||
return "BaseFunction"; |
||||
} |
||||
|
||||
|
||||
#region properties
|
||||
[Browsable(false)] |
||||
public string LocalisedName { |
||||
get { |
||||
return localisedName; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,92 +0,0 @@
@@ -1,92 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Drawing.Drawing2D; |
||||
|
||||
using SharpReportCore.Exporters; |
||||
|
||||
namespace SharpReportCore { |
||||
/// <summary>
|
||||
/// Baseclass for all Graphical Items
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 31.08.2005 13:24:59
|
||||
/// </remarks>
|
||||
public class BaseGraphicItem : BaseReportItem,IItemRenderer { |
||||
|
||||
private int thickness = 1; |
||||
private DashStyle dashStyle = DashStyle.Solid; |
||||
|
||||
public BaseGraphicItem():base() { |
||||
} |
||||
|
||||
protected GraphicStyleDecorator CreateItemStyle (BaseShape shape) { |
||||
GraphicStyleDecorator style = new GraphicStyleDecorator(shape); |
||||
|
||||
style.Size = this.Size; |
||||
style.Location = this.Location; |
||||
style.BackColor = this.BackColor; |
||||
style.ForeColor = this.ForeColor; |
||||
|
||||
style.Thickness = this.thickness; |
||||
style.DashStyle = this.dashStyle; |
||||
return style; |
||||
} |
||||
|
||||
protected static SizeF MeasureReportItem (IItemRenderer item) { |
||||
if (item == null) { |
||||
throw new ArgumentNullException("item"); |
||||
} |
||||
return new SizeF (item.Size.Width,item.Size.Height); |
||||
} |
||||
|
||||
|
||||
#region property's
|
||||
/// <summary>
|
||||
/// Line Thickness of graphical Element
|
||||
/// </summary>
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Thickness of Line")] |
||||
|
||||
public int Thickness { |
||||
get { |
||||
return thickness; |
||||
} |
||||
set { |
||||
thickness = value; |
||||
base.NotifyPropertyChanged("FormatString"); |
||||
} |
||||
} |
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Linestyle")] |
||||
public DashStyle DashStyle { |
||||
get { |
||||
return dashStyle; |
||||
} |
||||
set { |
||||
dashStyle = value; |
||||
base.NotifyPropertyChanged("FormatString"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
} |
||||
} |
@ -1,168 +0,0 @@
@@ -1,168 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Xml.Serialization; |
||||
|
||||
/// <summary>
|
||||
/// This Class is the BaseClass for <see cref="BaseTextItem"></see>
|
||||
/// and <see cref="BaseGraphicItem"></see>
|
||||
/// </summary>
|
||||
namespace SharpReportCore { |
||||
public class BaseReportItem : SharpReportCore.BaseReportObject, |
||||
IItemRenderer{ |
||||
|
||||
private int xOffset; |
||||
private bool drawBorder; |
||||
private Color foreColor; |
||||
|
||||
private Font font; |
||||
|
||||
public event EventHandler<BeforePrintEventArgs> ItemPrinting; |
||||
public event EventHandler<AfterPrintEventArgs> ItemPrinted; |
||||
|
||||
public event EventHandler Disposed; |
||||
|
||||
public BaseReportItem() :base(){ |
||||
|
||||
} |
||||
|
||||
|
||||
#region EventHandling
|
||||
|
||||
protected void NotiyfyAfterPrint (PointF afterPrintLocation) { |
||||
// System.Console.WriteLine("\tNotiyfyAfterPrint");
|
||||
if (this.ItemPrinted != null) { |
||||
AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrintLocation); |
||||
ItemPrinted(this, rea); |
||||
} |
||||
} |
||||
|
||||
private void NotifyBeforePrint () { |
||||
// System.Console.WriteLine("\tNotifyBeforePrint");
|
||||
if (this.ItemPrinting != null) { |
||||
BeforePrintEventArgs ea = new BeforePrintEventArgs (); |
||||
ItemPrinting (this,ea); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region overrides
|
||||
public override void Render(ReportPageEventArgs rpea){ |
||||
base.Render(rpea); |
||||
this.NotifyBeforePrint(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region virtual method's
|
||||
protected RectangleF DrawingRectangle (SizeF measureSize) { |
||||
PointF upperLeft = new PointF (this.Location.X , |
||||
this.Location.Y + this.SectionOffset); |
||||
SizeF lowerRight = new SizeF(0,0); |
||||
|
||||
if ((this.CanGrow == true )||(this.CanShrink == true)){ |
||||
if (measureSize.Height > this.Size.Height ) { |
||||
lowerRight = new SizeF (this.Size.Width, |
||||
measureSize.Height); |
||||
|
||||
} |
||||
} else { |
||||
lowerRight = new SizeF (this.Size.Width, |
||||
this.Size.Height); |
||||
} |
||||
return new RectangleF (upperLeft,lowerRight); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
[XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public int XOffset { |
||||
get { |
||||
return xOffset; |
||||
} |
||||
set { |
||||
xOffset = value; |
||||
} |
||||
} |
||||
|
||||
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("Draw a Border around the Item")] |
||||
public bool DrawBorder { |
||||
get { |
||||
return drawBorder; |
||||
} |
||||
set { |
||||
drawBorder = value; |
||||
base.NotifyPropertyChanged ("DrawBorder"); |
||||
} |
||||
} |
||||
|
||||
[Category("Appearance")] |
||||
public virtual Color ForeColor { |
||||
get { |
||||
return foreColor; |
||||
} |
||||
set { |
||||
foreColor = value; |
||||
base.NotifyPropertyChanged ("ForeColor"); |
||||
} |
||||
} |
||||
|
||||
[Category("Appearance")] |
||||
public virtual Font Font { |
||||
get { |
||||
return this.font; |
||||
} |
||||
set { |
||||
|
||||
this.font = value; |
||||
NotifyPropertyChanged ("Font"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposeable
|
||||
public override void Dispose () { |
||||
Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
|
||||
protected override void Dispose(bool disposing) { |
||||
try { |
||||
if (disposing){ |
||||
if (this.font != null){ |
||||
this.font = null; |
||||
this.font.Dispose(); |
||||
} |
||||
} |
||||
} finally { |
||||
if (this.Disposed != null) { |
||||
this.Disposed (this,EventArgs.Empty); |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,206 +0,0 @@
@@ -1,206 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Xml.Serialization; |
||||
|
||||
/// <summary>
|
||||
/// This is the BaseClass for all
|
||||
/// <see cref="ReportItem"></see>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 18.08.2005 13:59:11
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReportCore { |
||||
public class BaseReportObject : IBaseRenderer,INotifyPropertyChanged, |
||||
IDisposable{ |
||||
|
||||
private string name; |
||||
private object parent; |
||||
private bool visible = true; |
||||
private bool canGrow ; |
||||
private bool canShrink ; |
||||
|
||||
|
||||
private bool suspend; |
||||
private Size size; |
||||
private Point location; |
||||
|
||||
private Color backColor; |
||||
private int sectionOffset; |
||||
|
||||
|
||||
#region SharpReportCore.IPropertyChange interface implementation
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged; |
||||
|
||||
#endregion
|
||||
|
||||
public BaseReportObject() { |
||||
this.suspend = true; |
||||
} |
||||
|
||||
|
||||
protected void NotifyPropertyChanged(string property) { |
||||
if (!suspend) { |
||||
if (this.PropertyChanged != null) { |
||||
this.PropertyChanged(this,new PropertyChangedEventArgs (property)); |
||||
} |
||||
} |
||||
} |
||||
public void SuspendLayout () { |
||||
suspend = true; |
||||
} |
||||
|
||||
public void ResumeLayout () { |
||||
suspend = false; |
||||
} |
||||
|
||||
#region properties
|
||||
|
||||
public virtual bool Visible { |
||||
get { |
||||
return visible; |
||||
} |
||||
set { |
||||
visible = value; |
||||
NotifyPropertyChanged ("Visible"); |
||||
} |
||||
} |
||||
|
||||
public virtual bool CanGrow { |
||||
get { |
||||
return canGrow; |
||||
} |
||||
set { |
||||
canGrow = value; |
||||
NotifyPropertyChanged ("CanGrow"); |
||||
} |
||||
} |
||||
public virtual bool CanShrink { |
||||
get { |
||||
return canShrink; |
||||
} |
||||
set { |
||||
canShrink = value; |
||||
NotifyPropertyChanged ("CanShrink"); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public virtual string Name { |
||||
get { |
||||
return name; |
||||
} |
||||
set { |
||||
name = value; |
||||
NotifyPropertyChanged ("Name"); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
public virtual Size Size { |
||||
get { |
||||
return size; |
||||
} |
||||
set { |
||||
size = value; |
||||
NotifyPropertyChanged ("Size"); |
||||
} |
||||
} |
||||
|
||||
public virtual Point Location { |
||||
get { |
||||
return location; |
||||
} |
||||
set { |
||||
location = value; |
||||
NotifyPropertyChanged ("Location"); |
||||
} |
||||
} |
||||
|
||||
[Category("Appearance")] |
||||
public virtual Color BackColor { |
||||
get { |
||||
return backColor; |
||||
} |
||||
set { |
||||
backColor = value; |
||||
NotifyPropertyChanged ("BackColor"); |
||||
} |
||||
} |
||||
|
||||
[XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public virtual int SectionOffset { |
||||
get { |
||||
return sectionOffset; |
||||
} |
||||
set { |
||||
sectionOffset = value; |
||||
} |
||||
} |
||||
|
||||
[Browsable(false)] |
||||
[XmlIgnoreAttribute] |
||||
public virtual object Parent { |
||||
get { |
||||
return parent; |
||||
} |
||||
set { |
||||
parent = value; |
||||
} |
||||
} |
||||
|
||||
[XmlIgnoreAttribute] |
||||
[Browsable(false)] |
||||
public bool Suspend { |
||||
get { |
||||
return suspend; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region SharpReportCore.IBaseRenderer interface implementation
|
||||
public virtual void Render(ReportPageEventArgs rpea) { |
||||
|
||||
} |
||||
#endregion
|
||||
|
||||
#region IDisposable
|
||||
|
||||
public virtual void Dispose () { |
||||
Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~BaseReportObject(){ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected virtual void Dispose(bool disposing) { |
||||
if (disposing){ |
||||
|
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,137 +0,0 @@
@@ -1,137 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using System.ComponentModel; |
||||
|
||||
/// <summary>
|
||||
/// This Class is the BaseClass for <see cref="ReportSection"></see>
|
||||
/// </summary>
|
||||
|
||||
|
||||
namespace SharpReportCore { |
||||
public class BaseSection : SharpReportCore.BaseReportObject { |
||||
|
||||
private int sectionMargin; |
||||
// private bool pageBreakBefore;
|
||||
private bool pageBreakAfter; |
||||
|
||||
private ReportItemCollection items; |
||||
|
||||
public event EventHandler<SectionEventArgs> SectionPrinting; |
||||
public event EventHandler<SectionEventArgs> SectionPrinted; |
||||
|
||||
|
||||
#region Constructors
|
||||
|
||||
public BaseSection(): base() { |
||||
base.Name = String.Empty; |
||||
} |
||||
|
||||
public BaseSection (string sectionName) :base(){ |
||||
base.Name = sectionName; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region Rendering
|
||||
|
||||
public override void Render(ReportPageEventArgs rpea){ |
||||
this.NotifyPrinting(); |
||||
base.Render(rpea); |
||||
this.NotifyPrinted(); |
||||
} |
||||
|
||||
private void NotifyPrinting () { |
||||
if (this.SectionPrinting != null) { |
||||
SectionEventArgs ea = new SectionEventArgs (this); |
||||
SectionPrinting (this,ea); |
||||
} |
||||
} |
||||
|
||||
private void NotifyPrinted () { |
||||
if (this.SectionPrinted != null) { |
||||
SectionEventArgs ea = new SectionEventArgs (this); |
||||
SectionPrinted (this,ea); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region properties
|
||||
|
||||
|
||||
public int SectionMargin { |
||||
get { |
||||
return this.sectionMargin; |
||||
} |
||||
set { |
||||
this.sectionMargin = value; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
[Browsable(false)] |
||||
public ReportItemCollection Items{ |
||||
get { |
||||
if (this.items == null) { |
||||
items = new ReportItemCollection(); |
||||
} |
||||
return items; |
||||
} |
||||
} |
||||
|
||||
/* |
||||
public virtual bool PageBreakBefore { |
||||
get { |
||||
return pageBreakBefore; |
||||
} |
||||
set { |
||||
pageBreakBefore = value; |
||||
NotifyPropertyChanged ("PageBreakBefore"); |
||||
} |
||||
} |
||||
*/ |
||||
public virtual bool PageBreakAfter { |
||||
get { |
||||
return pageBreakAfter; |
||||
} |
||||
set { |
||||
pageBreakAfter = value; |
||||
NotifyPropertyChanged ("PageBreakAfter"); |
||||
} |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region System.IDisposable interface implementation
|
||||
public override void Dispose () { |
||||
Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
|
||||
protected override void Dispose(bool disposing) { |
||||
try { |
||||
if (disposing){ |
||||
if (this.items != null) { |
||||
this.items.Clear(); |
||||
this.items = null; |
||||
} |
||||
} |
||||
} finally { |
||||
base.Dispose(disposing); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
} |
||||
} |
@ -1,231 +0,0 @@
@@ -1,231 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Xml.Serialization; |
||||
|
||||
using SharpReportCore.Exporters; |
||||
|
||||
/// <summary>
|
||||
/// This class is the BaseClass for all TextBased Items
|
||||
/// like <see cref="BaseDataItem"></see> etc.
|
||||
/// </summary>
|
||||
|
||||
|
||||
namespace SharpReportCore { |
||||
|
||||
public class BaseTextItem : SharpReportCore.BaseReportItem,IItemRenderer,IExportColumnBuilder { |
||||
private string text; |
||||
|
||||
private string formatString = String.Empty; |
||||
private StringFormat stringFormat; |
||||
private StringTrimming stringTrimming; |
||||
private ContentAlignment contentAlignment; |
||||
|
||||
private TextDrawer textDrawer; |
||||
|
||||
private RectangleShape shape = new RectangleShape(); |
||||
|
||||
#region Constructor
|
||||
|
||||
public BaseTextItem():base() { |
||||
this.stringFormat = StringFormat.GenericTypographic; |
||||
this.contentAlignment = ContentAlignment.MiddleLeft; |
||||
this.stringTrimming = StringTrimming.EllipsisCharacter; |
||||
this.textDrawer = new TextDrawer(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IExportColumnBuilder implementation
|
||||
|
||||
|
||||
public BaseExportColumn CreateExportColumn(Graphics graphics){ |
||||
TextStyleDecorator st = this.CreateItemStyle(graphics); |
||||
ExportText item = new ExportText(st,false); |
||||
|
||||
item.Text = this.text; |
||||
return item; |
||||
} |
||||
|
||||
protected TextStyleDecorator CreateItemStyle (Graphics g) { |
||||
TextStyleDecorator style = new TextStyleDecorator(); |
||||
SizeF measureSizeF = new SizeF (); |
||||
measureSizeF = g.MeasureString(text, |
||||
this.Font, |
||||
this.Size.Width, |
||||
this.stringFormat); |
||||
RectangleF rect = base.DrawingRectangle (measureSizeF); |
||||
|
||||
style.BackColor = this.BackColor; |
||||
style.Font = this.Font; |
||||
style.ForeColor = this.ForeColor; |
||||
style.Location = this.Location; |
||||
style.Size = this.Size; |
||||
style.DrawBorder = this.DrawBorder; |
||||
|
||||
style.StringFormat = this.stringFormat; |
||||
style.StringTrimming = this.stringTrimming; |
||||
style.ContentAlignment = this.contentAlignment; |
||||
return style; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
protected string FormatOutput(string valueToFormat,string format, |
||||
TypeCode typeCode, string nullValue ){ |
||||
|
||||
return StandardFormatter.FormatItem(valueToFormat,format, |
||||
typeCode,nullValue); |
||||
} |
||||
|
||||
|
||||
public override void Render(ReportPageEventArgs rpea) { |
||||
|
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
|
||||
base.Render(rpea); |
||||
RectangleF rect = PrepareRectangle (rpea,this.Text); |
||||
FillBackGround (rpea.PrintPageEventArgs.Graphics, |
||||
rect); |
||||
DrawFrame (rpea.PrintPageEventArgs.Graphics, |
||||
Rectangle.Ceiling (rect)); |
||||
PrintTheStuff (rpea,this.Text,rect); |
||||
base.NotiyfyAfterPrint (rpea.LocationAfterDraw); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return "BaseTextItem"; |
||||
} |
||||
|
||||
protected void FillBackGround (Graphics graphics,RectangleF rectangle) { |
||||
shape.FillShape(graphics, |
||||
new SolidFillPattern(this.BackColor), |
||||
rectangle); |
||||
} |
||||
|
||||
protected void DrawFrame (Graphics graphics,Rectangle rectangle) { |
||||
if (base.DrawBorder == true) { |
||||
shape.DrawShape (graphics, |
||||
new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1), |
||||
rectangle); |
||||
} |
||||
} |
||||
|
||||
protected RectangleF PrepareRectangle (ReportPageEventArgs rpea,string text) { |
||||
SizeF measureSize = MeasureReportItem (rpea,text); |
||||
RectangleF rect = base.DrawingRectangle (measureSize); |
||||
return rect; |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Measure the Size of the String rectangle
|
||||
/// </summary>
|
||||
|
||||
private SizeF MeasureReportItem (ReportPageEventArgs rpea,string text) { |
||||
SizeF measureSizeF = new SizeF (); |
||||
|
||||
measureSizeF = rpea.PrintPageEventArgs.Graphics.MeasureString(text, |
||||
this.Font, |
||||
this.Size.Width, |
||||
this.stringFormat); |
||||
return measureSizeF; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Standart Function to Draw Strings
|
||||
/// </summary>
|
||||
/// <param name="e">ReportpageEventArgs</param>
|
||||
/// <param name="toPrint">Formatted String toprint</param>
|
||||
/// <param name="rectangle">rectangle where to draw the string</param>
|
||||
|
||||
protected void PrintTheStuff (ReportPageEventArgs rpea, |
||||
string toPrint, |
||||
RectangleF rectangle ) { |
||||
|
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
|
||||
textDrawer.DrawString(rpea.PrintPageEventArgs.Graphics, |
||||
toPrint,this.Font, |
||||
new SolidBrush(this.ForeColor), |
||||
rectangle, |
||||
this.stringTrimming,this.contentAlignment); |
||||
|
||||
|
||||
rpea.LocationAfterDraw = new Point (this.Location.X + this.Size.Width, |
||||
this.Location.Y + this.Size.Height); |
||||
} |
||||
|
||||
|
||||
public virtual string Text { |
||||
get { |
||||
return text; |
||||
} |
||||
set { |
||||
text = value; |
||||
base.NotifyPropertyChanged("Text"); |
||||
} |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Formatstring like in MSDN
|
||||
/// </summary>
|
||||
[Browsable(true), |
||||
Category("Appearance"), |
||||
Description("String to format Number's Date's etc")] |
||||
|
||||
public virtual string FormatString { |
||||
get { |
||||
return formatString; |
||||
} |
||||
set { |
||||
formatString = value; |
||||
base.NotifyPropertyChanged("FormatString"); |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Appearance")] |
||||
public StringTrimming StringTrimming { |
||||
get { |
||||
return stringTrimming; |
||||
} |
||||
set { |
||||
stringTrimming = value; |
||||
base.NotifyPropertyChanged("StringTrimming"); |
||||
} |
||||
} |
||||
|
||||
[Category("Appearance")] |
||||
public virtual System.Drawing.ContentAlignment ContentAlignment { |
||||
get { |
||||
return this.contentAlignment; |
||||
} |
||||
set { |
||||
this.contentAlignment = value; |
||||
base.NotifyPropertyChanged("ContentAlignment"); |
||||
} |
||||
} |
||||
|
||||
[Browsable(false)] |
||||
[XmlIgnoreAttribute] |
||||
public virtual StringFormat StringFormat { |
||||
get { |
||||
return TextDrawer.BuildStringFormat (this.StringTrimming, |
||||
this.ContentAlignment); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Globalization; |
||||
|
||||
/// <summary>
|
||||
/// BaseClass for PageNumbers
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 12.09.2005 22:34:54
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReportCore { |
||||
public class BasePageNumber : BaseFunction { |
||||
static string fnName = "SharpReport.Toolbar.Functions.PageNumber"; |
||||
|
||||
public BasePageNumber():base(fnName) { |
||||
// System.Console.WriteLine("!! PageNr created with name {0}",this.Name);
|
||||
|
||||
} |
||||
|
||||
public override void Render(ReportPageEventArgs rpea) { |
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
base.Render(rpea); |
||||
|
||||
string formattedString = base.FormatOutput(rpea.PageNumber.ToString(CultureInfo.InvariantCulture), |
||||
this.FormatString, |
||||
TypeCode.Int32, |
||||
"xxxx"); |
||||
|
||||
RectangleF rect = base.PrepareRectangle (rpea,formattedString); |
||||
//Printout the textpart
|
||||
base.PrintTheStuff (rpea,this.Text,rect); |
||||
//here we print the functionpart
|
||||
StringFormat fmt = StringFormat; |
||||
|
||||
fmt.Alignment = StringAlignment.Far; |
||||
fmt.LineAlignment = StringAlignment.Center; |
||||
|
||||
rpea.PrintPageEventArgs.Graphics.DrawString(formattedString, |
||||
this.Font, |
||||
Brushes.Black, |
||||
rect, |
||||
fmt); |
||||
base.NotiyfyAfterPrint (rpea.LocationAfterDraw); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return "BasePageNumber"; |
||||
} |
||||
} |
||||
} |
@ -1,81 +0,0 @@
@@ -1,81 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Globalization; |
||||
|
||||
/// <summary>
|
||||
/// BaseClass for Today's Date
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 12.09.2005 22:48:04
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReportCore { |
||||
public class BaseToday : BaseFunction { |
||||
static string fnName = "SharpReport.Toolbar.Functions.TodaysDate"; |
||||
|
||||
public BaseToday():base(fnName) { |
||||
|
||||
} |
||||
|
||||
public override void Render(ReportPageEventArgs rpea) { |
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
base.Render(rpea); |
||||
|
||||
string f; |
||||
if (String.IsNullOrEmpty(this.FormatString)) { |
||||
f = "d"; |
||||
} else { |
||||
f = this.FormatString; |
||||
} |
||||
string formattedString = base.FormatOutput(System.DateTime.Now.ToString(CultureInfo.CurrentCulture), |
||||
f, |
||||
TypeCode.DateTime, |
||||
""); |
||||
RectangleF rect = base.PrepareRectangle (rpea,formattedString); |
||||
|
||||
//Printout the textPart
|
||||
base.PrintTheStuff (rpea,this.Text,rect); |
||||
|
||||
//here we print the functionpart allway's with Stringalignment.Far
|
||||
StringFormat fmt = StringFormat; |
||||
fmt.Alignment = StringAlignment.Far; |
||||
fmt.LineAlignment = StringAlignment.Center; |
||||
rpea.PrintPageEventArgs.Graphics.DrawString(formattedString, |
||||
this.Font, |
||||
Brushes.Black, |
||||
rect, |
||||
fmt); |
||||
|
||||
// goon
|
||||
base.NotiyfyAfterPrint (rpea.LocationAfterDraw); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return "BaseToday"; |
||||
} |
||||
|
||||
[Browsable(false)] |
||||
public override ContentAlignment ContentAlignment { |
||||
get { |
||||
return base.ContentAlignment; |
||||
} |
||||
set { |
||||
base.ContentAlignment = value; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,62 +0,0 @@
@@ -1,62 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using SharpReportCore.Exporters; |
||||
|
||||
/// <summary>
|
||||
///This class drwas a Circle
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 29.09.2005 11:54:19
|
||||
/// </remarks>
|
||||
namespace SharpReportCore { |
||||
public class BaseCircleItem : SharpReportCore.BaseGraphicItem,IExportColumnBuilder { |
||||
|
||||
EllipseShape shape = new EllipseShape(); |
||||
#region Constructor
|
||||
|
||||
public BaseCircleItem():base() { |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IExportColumnBuilder
|
||||
public BaseExportColumn CreateExportColumn(Graphics graphics){ |
||||
GraphicStyleDecorator style = base.CreateItemStyle(this.shape); |
||||
ExportGraphic item = new ExportGraphic(style,false); |
||||
return item as ExportGraphic; |
||||
} |
||||
|
||||
#endregion
|
||||
public override void Render(ReportPageEventArgs rpea) { |
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
base.Render (rpea); |
||||
RectangleF rect = base.DrawingRectangle (this.Size); |
||||
|
||||
shape.FillShape(rpea.PrintPageEventArgs.Graphics, |
||||
new SolidFillPattern(this.BackColor), |
||||
rect); |
||||
|
||||
shape.DrawShape (rpea.PrintPageEventArgs.Graphics, |
||||
new BaseLine (this.ForeColor,base.DashStyle,base.Thickness), |
||||
rect); |
||||
} |
||||
|
||||
public override string ToString() { |
||||
return "BaseCircleItem"; |
||||
} |
||||
|
||||
} |
||||
} |
@ -1,178 +0,0 @@
@@ -1,178 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Globalization; |
||||
|
||||
/// <summary>
|
||||
/// Handles the drawing of Images like Bitmap's and so on
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 04.10.2005 11:17:29
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReportCore { |
||||
|
||||
|
||||
public class BaseImageItem : SharpReportCore.BaseGraphicItem { |
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
|
||||
string fileName; |
||||
Image image; |
||||
bool scaleImageToSize; |
||||
GlobalEnums.ImageSource imageSource; |
||||
|
||||
public BaseImageItem():base() { |
||||
} |
||||
|
||||
private void LoadImage (string fileName) { |
||||
if (String.IsNullOrEmpty(fileName)) { |
||||
throw new ArgumentNullException("fileName"); |
||||
} |
||||
try { |
||||
this.image = null; |
||||
this.image = Image.FromFile (fileName); |
||||
if (image == null) { |
||||
string str = String.Format(CultureInfo.InvariantCulture, |
||||
"Unable to Load {0}",fileName); |
||||
throw new SharpReportException(str); |
||||
} |
||||
|
||||
} catch (System.OutOfMemoryException) { |
||||
throw; |
||||
} catch (System.IO.FileNotFoundException) { |
||||
throw; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// ToolboxIcon for ReportRectangle
|
||||
/// </summary>
|
||||
/// <returns>Bitmap</returns>
|
||||
|
||||
private static Bitmap ErrorBitmap(Rectangle rect) { |
||||
Bitmap b = new Bitmap (rect.Width,rect.Height); |
||||
using (Graphics g = Graphics.FromImage (b)){ |
||||
g.DrawRectangle (new Pen(Color.Black, 1), |
||||
1,1,rect.Width -2,rect.Height -2); |
||||
g.DrawString("Image",new Font("Microsoft Sans Serif", |
||||
8), |
||||
new SolidBrush(Color.Gray), |
||||
new RectangleF(1,1,rect.Width,rect.Height) ); |
||||
|
||||
} |
||||
return b; |
||||
} |
||||
|
||||
#region overrides
|
||||
|
||||
public override void Render(ReportPageEventArgs rpea) { |
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
base.Render(rpea); |
||||
Graphics g = rpea.PrintPageEventArgs.Graphics; |
||||
|
||||
if (this.scaleImageToSize) { |
||||
g.DrawImageUnscaled(this.Image,0,0); |
||||
rpea.LocationAfterDraw = new Point (this.Location.X + this.Image.Width, |
||||
this.Location.Y + this.Image.Height); |
||||
} else { |
||||
SizeF measureSize = BaseGraphicItem.MeasureReportItem (this); |
||||
RectangleF rect = base.DrawingRectangle (measureSize); |
||||
g.DrawImage(this.Image, |
||||
rect); |
||||
rpea.LocationAfterDraw = new Point (this.Location.X + (int)rect.Width, |
||||
this.Location.Y + (int)rect.Height); |
||||
} |
||||
} |
||||
|
||||
// public override void Dispose() {
|
||||
// base.Dispose();
|
||||
// this.image = null;
|
||||
// }
|
||||
|
||||
public override string ToString() { |
||||
return "BaseImageItem"; |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region properties
|
||||
|
||||
public virtual string FileName { |
||||
get { |
||||
return fileName; |
||||
} |
||||
set { |
||||
fileName = value; |
||||
this.image = null; |
||||
this.imageSource = GlobalEnums.ImageSource.File; |
||||
LoadImage (fileName); |
||||
base.NotifyPropertyChanged("FileName"); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// The Image
|
||||
/// </summary>
|
||||
public virtual Image Image { |
||||
get { |
||||
if (this.image != null) { |
||||
return image; |
||||
} else { |
||||
return BaseImageItem.ErrorBitmap(new Rectangle(0,0,this.Size.Width,this.Size.Height)); |
||||
} |
||||
|
||||
} |
||||
set { |
||||
this.fileName = String.Empty; |
||||
this.image = value; |
||||
this.imageSource = GlobalEnums.ImageSource.External; |
||||
base.NotifyPropertyChanged("Image"); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Where did the image come from
|
||||
/// </summary>
|
||||
///
|
||||
public GlobalEnums.ImageSource ImageSource { |
||||
get { |
||||
return imageSource; |
||||
} |
||||
} |
||||
|
||||
///<summary>
|
||||
/// enlarge / Shrink the Controls Size
|
||||
/// </summary>
|
||||
public bool ScaleImageToSize { |
||||
get { |
||||
return scaleImageToSize; |
||||
} |
||||
set { |
||||
scaleImageToSize = value; |
||||
base.NotifyPropertyChanged("ScaleImageToSize"); |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
} |
||||
} |
@ -1,61 +0,0 @@
@@ -1,61 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using SharpReportCore.Exporters; |
||||
/// <summary>
|
||||
/// This Class handles Lines
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 28.09.2005 23:46:19
|
||||
/// </remarks>
|
||||
namespace SharpReportCore { |
||||
|
||||
public class BaseLineItem : SharpReportCore.BaseGraphicItem,IExportColumnBuilder { |
||||
|
||||
LineShape shape = new LineShape(); |
||||
|
||||
#region Constructor
|
||||
|
||||
public BaseLineItem():base() { |
||||
|
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IExportColumnBuilder implementation
|
||||
|
||||
public BaseExportColumn CreateExportColumn(Graphics graphics){ |
||||
GraphicStyleDecorator style = base.CreateItemStyle(this.shape); |
||||
ExportGraphic item = new ExportGraphic(style,false); |
||||
return item as ExportGraphic; |
||||
} |
||||
|
||||
#endregion
|
||||
public override void Render(ReportPageEventArgs rpea) { |
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
base.Render (rpea); |
||||
RectangleF rect = base.DrawingRectangle (this.Size); |
||||
shape.DrawShape (rpea.PrintPageEventArgs.Graphics, |
||||
new BaseLine (this.ForeColor,base.DashStyle,base.Thickness), |
||||
rect); |
||||
|
||||
} |
||||
|
||||
public override string ToString() { |
||||
return "BaseLineItem"; |
||||
} |
||||
} |
||||
} |
@ -1,79 +0,0 @@
@@ -1,79 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using SharpReportCore.Exporters; |
||||
/// <summary>
|
||||
/// This class draws a Rectangle
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 29.09.2005 11:57:30
|
||||
/// </remarks>
|
||||
namespace SharpReportCore { |
||||
public class BaseRectangleItem : SharpReportCore.BaseGraphicItem,IExportColumnBuilder { |
||||
|
||||
RectangleShape shape = new RectangleShape(); |
||||
|
||||
#region Constructor
|
||||
|
||||
public BaseRectangleItem() { |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IExportColumnBuilder
|
||||
|
||||
public BaseExportColumn CreateExportColumn(Graphics graphics){ |
||||
GraphicStyleDecorator style = base.CreateItemStyle(this.shape); |
||||
ExportGraphic item = new ExportGraphic(style,false); |
||||
return item as ExportGraphic; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
public override void Render(ReportPageEventArgs rpea) { |
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
base.Render(rpea); |
||||
RectangleF rect = base.DrawingRectangle (this.Size); |
||||
|
||||
shape.FillShape(rpea.PrintPageEventArgs.Graphics, |
||||
new SolidFillPattern(this.BackColor), |
||||
rect); |
||||
|
||||
shape.DrawShape (rpea.PrintPageEventArgs.Graphics, |
||||
new BaseLine (this.ForeColor,base.DashStyle,base.Thickness), |
||||
rect); |
||||
} |
||||
|
||||
|
||||
public override string ToString() { |
||||
return "BaseRectangleItem"; |
||||
} |
||||
|
||||
|
||||
#region System.IDisposable interface implementation
|
||||
// public override void Dispose() {
|
||||
// base.Dispose();
|
||||
// for (int i = 0; i < arrayList.Count;i ++ ) {
|
||||
// IComponent curObj = (IComponent)arrayList[i];
|
||||
// curObj.Dispose();
|
||||
// }
|
||||
// arrayList = null;
|
||||
// }
|
||||
#endregion
|
||||
|
||||
|
||||
} |
||||
} |
@ -1,206 +0,0 @@
@@ -1,206 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 03.03.2006 |
||||
* Time: 09:00 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using SharpReportCore.Exporters; |
||||
|
||||
namespace SharpReportCore{ |
||||
/// <summary>
|
||||
/// Description of BaseRowItem.
|
||||
/// </summary>
|
||||
|
||||
public class RowItem:BaseReportItem,IContainerItem,IExportColumnBuilder{ |
||||
private string tableName; |
||||
|
||||
private ReportItemCollection items; |
||||
private Padding padding; |
||||
private Color alternateBackColor; |
||||
private int changeBackColorEveryNRow; |
||||
private RectangleShape shape = new RectangleShape(); |
||||
|
||||
|
||||
public RowItem():this (String.Empty){ |
||||
} |
||||
|
||||
|
||||
public RowItem(string tableName){ |
||||
this.tableName = tableName; |
||||
this.padding = new Padding(5); |
||||
} |
||||
|
||||
|
||||
#region IExportColumnBuilder implementation
|
||||
|
||||
public BaseExportColumn CreateExportColumn(Graphics graphics){ |
||||
BaseStyleDecorator st = this.CreateItemStyle(graphics); |
||||
|
||||
ExportContainer item = new ExportContainer(st); |
||||
return item; |
||||
} |
||||
|
||||
protected BaseStyleDecorator CreateItemStyle (Graphics g) { |
||||
BaseStyleDecorator style = new BaseStyleDecorator(); |
||||
|
||||
style.BackColor = this.BackColor; |
||||
style.ForeColor = this.ForeColor; |
||||
style.Location = this.Location; |
||||
style.Size = this.Size; |
||||
style.DrawBorder = this.DrawBorder; |
||||
return style; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region overrides
|
||||
|
||||
|
||||
|
||||
protected RectangleF PrepareRectangle () { |
||||
SizeF measureSize = new SizeF ((SizeF)this.Size); |
||||
RectangleF rect = base.DrawingRectangle (measureSize); |
||||
return rect; |
||||
} |
||||
|
||||
|
||||
public override void Render(ReportPageEventArgs rpea){ |
||||
|
||||
if (rpea == null) { |
||||
throw new ArgumentNullException("rpea"); |
||||
} |
||||
|
||||
base.Render(rpea); |
||||
RectangleF rect = PrepareRectangle (); |
||||
|
||||
shape.FillShape(rpea.PrintPageEventArgs.Graphics, |
||||
new SolidFillPattern(this.BackColor), |
||||
rect); |
||||
|
||||
if (base.DrawBorder == true) { |
||||
shape.DrawShape (rpea.PrintPageEventArgs.Graphics, |
||||
new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1), |
||||
rect); |
||||
} |
||||
|
||||
|
||||
foreach (BaseReportItem childItem in this.items) { |
||||
Point loc = new Point (childItem.Location.X,childItem.Location.Y); |
||||
|
||||
childItem.Location = new Point(this.Location.X + childItem.Location.X, |
||||
this.SectionOffset + childItem.Location.Y); |
||||
|
||||
childItem.Render (rpea); |
||||
childItem.Location = new Point(loc.X,loc.Y); |
||||
} |
||||
// System.Console.WriteLine("--End of RowItem");
|
||||
// System.Console.WriteLine("");
|
||||
base.NotiyfyAfterPrint (rpea.LocationAfterDraw); |
||||
} |
||||
|
||||
public override string ToString(){ |
||||
return this.GetType().Name; |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region properties
|
||||
|
||||
|
||||
|
||||
[Category("Appearance"), |
||||
Description("Change the Backcolor on every 'N' Row")] |
||||
public Color AlternateBackColor { |
||||
get { |
||||
return this.alternateBackColor; |
||||
} |
||||
set { |
||||
this.alternateBackColor = value; |
||||
base.NotifyPropertyChanged("SecondaryBackColor"); |
||||
} |
||||
} |
||||
|
||||
[Category("Appearance")] |
||||
public int ChangeBackColorEveryNRow { |
||||
get { |
||||
return changeBackColorEveryNRow; |
||||
} |
||||
set { |
||||
changeBackColorEveryNRow = value; |
||||
base.NotifyPropertyChanged("ChangeBackColorEveryNRow"); |
||||
|
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region IContainerControl
|
||||
|
||||
public Padding Padding { |
||||
get { |
||||
return padding; |
||||
} |
||||
set { |
||||
padding = value; |
||||
base.NotifyPropertyChanged("Padding"); |
||||
} |
||||
} |
||||
|
||||
public bool IsValidChild(BaseReportItem childControl){ |
||||
BaseReportItem bdi = childControl as BaseDataItem; |
||||
if (bdi != null) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
public ReportItemCollection Items{ |
||||
get { |
||||
if (this.items == null) { |
||||
this.items = new ReportItemCollection(); |
||||
} |
||||
return this.items; |
||||
} |
||||
} |
||||
#endregion
|
||||
/* |
||||
#region IDisposable
|
||||
public override void Dispose(){ |
||||
this.Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~RowItem() |
||||
{ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected override void Dispose(bool disposing){ |
||||
try { |
||||
if (disposing) { |
||||
// Free other state (managed objects).
|
||||
if (this.baseDataItemCollection != null) { |
||||
this.BaseDataItemCollection.Clear(); |
||||
this.baseDataItemCollection = null; |
||||
} |
||||
} |
||||
} finally { |
||||
base.Dispose(); |
||||
} |
||||
} |
||||
#endregion
|
||||
*/ |
||||
|
||||
} |
||||
} |
@ -1,78 +0,0 @@
@@ -1,78 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 17.04.2006 |
||||
* Time: 15:35 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReportCore { |
||||
/// <summary>
|
||||
/// Description of TableItem.
|
||||
/// </summary>
|
||||
public class TableItem :BaseReportItem,IContainerItem{ |
||||
private Padding padding; |
||||
private string tableName; |
||||
private ReportItemCollection items; |
||||
|
||||
public TableItem():this (GlobalValues.UnboundName){ |
||||
} |
||||
|
||||
public TableItem(string tableName){ |
||||
this.tableName = tableName; |
||||
} |
||||
|
||||
#region overrides
|
||||
|
||||
public override string ToString(){ |
||||
return this.GetType().Name; |
||||
} |
||||
#endregion
|
||||
|
||||
|
||||
/* |
||||
[Category("Databinding")] |
||||
public string TableName { |
||||
get { |
||||
return tableName; |
||||
} |
||||
// set {
|
||||
// tableName = value;
|
||||
// }
|
||||
} |
||||
*/ |
||||
|
||||
|
||||
#region Interface implementation of 'IContainerItem'
|
||||
|
||||
public System.Windows.Forms.Padding Padding { |
||||
get { |
||||
return this.padding; |
||||
} |
||||
set { |
||||
this.padding = value; |
||||
base.NotifyPropertyChanged("Padding"); |
||||
} |
||||
} |
||||
|
||||
public ReportItemCollection Items { |
||||
get { |
||||
if (this.items == null) { |
||||
this.items = new ReportItemCollection(); |
||||
} |
||||
return this.items; |
||||
} |
||||
} |
||||
|
||||
public bool IsValidChild(BaseReportItem childControl){ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,270 +0,0 @@
@@ -1,270 +0,0 @@
|
||||
//
|
||||
// SharpDevelop ReportEditor
|
||||
//
|
||||
// Copyright (C) 2005 Peter Forstmeier
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// Peter Forstmeier (Peter.Forstmeier@t-online.de)
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Drawing; |
||||
using System.Drawing.Printing; |
||||
using System.Windows.Forms; |
||||
using System.Xml.Serialization; |
||||
|
||||
/// <summary>
|
||||
/// BaseClass for all ...Settings
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 07.10.2005 22:50:43
|
||||
/// </remarks>
|
||||
namespace SharpReportCore { |
||||
public class BaseSettings : INotifyPropertyChanged{ |
||||
private const string defaultReportName = "SharpReport1"; |
||||
|
||||
|
||||
private string reportName; |
||||
private string fileName; |
||||
private PageSettings pageSettings; |
||||
|
||||
private bool useStandartPrinter; |
||||
|
||||
//if file is read, supress events
|
||||
private bool initDone; |
||||
|
||||
private GraphicsUnit graphicsUnit; |
||||
private Margins defaultMargins = new Margins (50,50,50,50); |
||||
private Size gridSize; |
||||
private Padding padding; |
||||
|
||||
public event EventHandler FileNameChanged; |
||||
|
||||
#region SharpReportCore.IPropertyChange interface implementation
|
||||
public event PropertyChangedEventHandler PropertyChanged; |
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
public BaseSettings():this(new PageSettings(),"","") { |
||||
BaseValues(); |
||||
} |
||||
|
||||
public BaseSettings(PageSettings pageSettings , string reportName,string fileName){ |
||||
if (pageSettings == null) { |
||||
throw new ArgumentNullException("pageSettings"); |
||||
} |
||||
|
||||
if (String.IsNullOrEmpty(reportName)) { |
||||
this.reportName = GlobalValues.SharpReportStandartFileName; |
||||
} else { |
||||
this.reportName = reportName; |
||||
} |
||||
|
||||
if (String.IsNullOrEmpty(fileName)) { |
||||
this.fileName = GlobalValues.SharpReportPlainFileName; |
||||
} else { |
||||
this.fileName = MakePoperFilename(fileName); |
||||
} |
||||
|
||||
this.pageSettings = pageSettings; |
||||
BaseValues(); |
||||
} |
||||
|
||||
void BaseValues() { |
||||
this.useStandartPrinter = true; |
||||
this.graphicsUnit = GraphicsUnit.Millimeter; |
||||
this.gridSize = GlobalValues.GridSize; |
||||
this.padding = new Padding(5); |
||||
} |
||||
|
||||
private static string MakePoperFilename (string file) { |
||||
|
||||
if (file.EndsWith (GlobalValues.SharpReportExtension)) { |
||||
return file; |
||||
} else { |
||||
if (file.IndexOf('.') > 0) { |
||||
string [] s1 = file.Split('.'); |
||||
return s1[0] + GlobalValues.SharpReportExtension; |
||||
} else { |
||||
return file + GlobalValues.SharpReportExtension; |
||||
} |
||||
|
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
protected void NotifyPropertyChanged(string info) { |
||||
if (this.initDone) { |
||||
if (PropertyChanged != null) { |
||||
PropertyChanged (this,new PropertyChangedEventArgs (info)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#region Properties
|
||||
protected static string DefaultReportName { |
||||
get { |
||||
return defaultReportName; |
||||
} |
||||
} |
||||
|
||||
protected static string DefaultFileName { |
||||
get { |
||||
return GlobalValues.SharpReportPlainFileName; |
||||
} |
||||
} |
||||
|
||||
[Browsable(false)] |
||||
[XmlIgnoreAttribute] |
||||
public bool InitDone { |
||||
get { |
||||
return initDone; |
||||
} |
||||
set { |
||||
initDone = value; |
||||
} |
||||
} |
||||
|
||||
[Category("Base Settings")] |
||||
[DefaultValueAttribute ("")] |
||||
public string ReportName { |
||||
get { |
||||
if (reportName.Length == 0) { |
||||
reportName = defaultReportName; |
||||
} |
||||
return reportName; |
||||
} |
||||
set { |
||||
if (reportName != value) { |
||||
reportName = value; |
||||
this.NotifyPropertyChanged("ReportName"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Base Settings")] |
||||
[DefaultValueAttribute ("")] |
||||
[XmlIgnoreAttribute] |
||||
public string FileName { |
||||
get { |
||||
if (fileName.Length == 0) { |
||||
fileName = GlobalValues.SharpReportPlainFileName; |
||||
} |
||||
return fileName; |
||||
} |
||||
set { |
||||
if (fileName != value) { |
||||
fileName = value; |
||||
this.NotifyPropertyChanged("FileName"); |
||||
if (FileNameChanged != null ){ |
||||
FileNameChanged (this,EventArgs.Empty); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Output Settings")] |
||||
[DefaultValueAttribute (true)] |
||||
public bool UseStandartPrinter { |
||||
get { |
||||
return useStandartPrinter; |
||||
} |
||||
set { |
||||
if (useStandartPrinter != value) { |
||||
useStandartPrinter = value; |
||||
this.NotifyPropertyChanged("UseStandrtPrinter"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
[Category("Output Settings")] |
||||
[XmlIgnoreAttribute] |
||||
public System.Drawing.Printing.PageSettings PageSettings { |
||||
get { |
||||
return pageSettings; |
||||
} |
||||
set { |
||||
this.pageSettings = value; |
||||
this.NotifyPropertyChanged("PageSettings"); |
||||
} |
||||
} |
||||
|
||||
[Category("Output Settings")] |
||||
public System.Drawing.Printing.Margins DefaultMargins { |
||||
get { |
||||
return defaultMargins; |
||||
|
||||
} |
||||
set { |
||||
if (defaultMargins != value) { |
||||
defaultMargins = value; |
||||
PageSettings.Margins = defaultMargins; |
||||
this.NotifyPropertyChanged("DefaultMargins"); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
#region DesignerSettings
|
||||
[Category("Designer Settings")] |
||||
[DefaultValueAttribute (System.Drawing.GraphicsUnit.Millimeter)] |
||||
public System.Drawing.GraphicsUnit GraphicsUnit { |
||||
get { |
||||
return graphicsUnit; |
||||
} |
||||
set { |
||||
if (graphicsUnit != value) { |
||||
graphicsUnit = value; |
||||
this.NotifyPropertyChanged("GraphicsUnit"); |
||||
} |
||||
} |
||||
} |
||||
[Category("Designer Settings")] |
||||
public Size GridSize { |
||||
get { |
||||
return gridSize; |
||||
} |
||||
set { |
||||
if (this.gridSize != value) { |
||||
this.gridSize = value; |
||||
this.NotifyPropertyChanged("GridSize"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
[Category("Designer Settings")] |
||||
public Padding Padding { |
||||
get { |
||||
return padding; |
||||
} |
||||
set { |
||||
if (this.padding != value) { |
||||
this.padding = value; |
||||
this.NotifyPropertyChanged("Padding"); |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,243 +0,0 @@
@@ -1,243 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 30.12.2005 |
||||
* Time: 11:05 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Globalization; |
||||
|
||||
namespace SharpReportCore{ |
||||
|
||||
public class CollectionItemEventArgs<T> : EventArgs |
||||
{ |
||||
T item; |
||||
|
||||
public T Item { |
||||
get { |
||||
return item; |
||||
} |
||||
} |
||||
|
||||
public CollectionItemEventArgs(T item) |
||||
{ |
||||
this.item = item; |
||||
} |
||||
} |
||||
///<summary>
|
||||
/// Comparer to Sort the <see cref="IItemRendererCollection"></see>
|
||||
/// by System.Drawing.Location.Y, so we have the IItemRenderers in the Order we use them
|
||||
/// (Line by Line)
|
||||
/// </summary>
|
||||
public class LocationSorter : IComparer<IItemRenderer> { |
||||
public int Compare(IItemRenderer x, IItemRenderer y){ |
||||
if (x == null){ |
||||
if (y == null){ |
||||
return 0; |
||||
} |
||||
return -1; |
||||
} |
||||
if (y == null){ |
||||
return 1; |
||||
} |
||||
|
||||
if (x.Location.Y == y.Location.Y){ |
||||
return x.Location.X - y.Location.X; |
||||
} |
||||
return x.Location.Y - y.Location.Y; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
///<summary>
|
||||
/// A collection that holds <see cref='IItemRenderer'/> objects.
|
||||
///</summary>
|
||||
|
||||
public class ReportItemCollection: List<IItemRenderer>{ |
||||
|
||||
public event EventHandler<CollectionItemEventArgs<IItemRenderer>> Added; |
||||
public event EventHandler<CollectionItemEventArgs<IItemRenderer>> Removed; |
||||
|
||||
public void SortByLocation () { |
||||
if (this.Count > 1) { |
||||
this.Sort(new LocationSorter()); |
||||
} |
||||
} |
||||
|
||||
public IItemRenderer Find (string itemName) { |
||||
if (String.IsNullOrEmpty(itemName)) { |
||||
throw new ArgumentNullException("itemName"); |
||||
} |
||||
for (int i = 0;i < this.Count ; i ++) { |
||||
IItemRenderer col = this[i]; |
||||
if (String.Compare(col.Name.ToLower(CultureInfo.CurrentCulture), |
||||
itemName.ToLower(CultureInfo.CurrentCulture))== 0){ |
||||
return col; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
public new void Add(IItemRenderer item){ |
||||
base.Add(item); |
||||
this.SortByLocation(); |
||||
this.OnAdded (item); |
||||
} |
||||
|
||||
|
||||
|
||||
public new bool Remove(IItemRenderer item) |
||||
{ |
||||
if (base.Remove (item)) { |
||||
this.SortByLocation(); |
||||
this.OnRemoved(item); |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
|
||||
|
||||
void OnAdded(IItemRenderer item){ |
||||
if (Added != null) |
||||
Added(this, new CollectionItemEventArgs<IItemRenderer>(item)); |
||||
} |
||||
|
||||
void OnRemoved( IItemRenderer item){ |
||||
if (Removed != null) |
||||
Removed(this, new CollectionItemEventArgs<IItemRenderer>(item)); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This class holds all the available Sections of an Report
|
||||
/// </summary>
|
||||
public class ReportSectionCollection: List<BaseReportObject>{ |
||||
|
||||
public BaseReportObject Find (string columnName) { |
||||
if (String.IsNullOrEmpty(columnName)) { |
||||
throw new ArgumentNullException("columnName"); |
||||
} |
||||
for (int i = 0;i < this.Count ; i ++) { |
||||
BaseReportObject col = this[i]; |
||||
if (String.Compare(col.Name.ToLower(CultureInfo.CurrentCulture), |
||||
columnName.ToLower(CultureInfo.CurrentCulture))== 0){ |
||||
return col; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This class holds all the available Sections of an Report
|
||||
/// </summary>
|
||||
public class BaseDataItemCollection: List<BaseDataItem>{ |
||||
public event EventHandler<CollectionItemEventArgs<BaseDataItem>> Added; |
||||
public event EventHandler<CollectionItemEventArgs<BaseDataItem>> Removed; |
||||
|
||||
public BaseDataItem Find (string columnName) { |
||||
if (String.IsNullOrEmpty(columnName)) { |
||||
throw new ArgumentNullException("columnName"); |
||||
} |
||||
for (int i = 0;i < this.Count ; i ++) { |
||||
BaseDataItem col = this[i]; |
||||
if (String.Compare(col.Name.ToLower(CultureInfo.CurrentCulture), |
||||
columnName.ToLower(CultureInfo.CurrentCulture))== 0){ |
||||
return col; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public new void Add(BaseDataItem item){ |
||||
base.Add(item); |
||||
this.OnAdded (item); |
||||
} |
||||
|
||||
|
||||
|
||||
public new bool Remove(BaseDataItem item) |
||||
{ |
||||
if (base.Remove (item)) { |
||||
this.OnRemoved(item); |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
void OnAdded(BaseDataItem item){ |
||||
if (Added != null) |
||||
Added(this, new CollectionItemEventArgs<BaseDataItem>(item)); |
||||
} |
||||
|
||||
void OnRemoved( BaseDataItem item){ |
||||
if (Removed != null) |
||||
Removed(this, new CollectionItemEventArgs<BaseDataItem>(item)); |
||||
} |
||||
} |
||||
|
||||
[Serializable()] |
||||
public class ColumnCollection: List<AbstractColumn>{ |
||||
private System.Globalization.CultureInfo culture; |
||||
|
||||
public ColumnCollection(){ |
||||
culture = CultureInfo.CurrentCulture; |
||||
} |
||||
|
||||
|
||||
public AbstractColumn Find (string columnName) { |
||||
if (String.IsNullOrEmpty(columnName)){ |
||||
throw new ArgumentNullException("columnName"); |
||||
} |
||||
for (int i = 0;i < this.Count ; i ++) { |
||||
AbstractColumn col = (AbstractColumn)this[i]; |
||||
if (String.Compare(col.ColumnName.ToLower(CultureInfo.CurrentCulture), |
||||
columnName.ToLower(CultureInfo.CurrentCulture))== 0){ |
||||
return col; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// The Culture is used for rirect String Comparison
|
||||
/// </summary>
|
||||
|
||||
public CultureInfo Culture |
||||
{ |
||||
get { return culture; } |
||||
} |
||||
} |
||||
|
||||
|
||||
public class AbstractParametersCollection: List<AbstractParameter>{ |
||||
public AbstractParameter Find (string parameterName) { |
||||
for (int i = 0;i < this.Count ; i ++) { |
||||
AbstractParameter par = this[i]; |
||||
if (String.Compare(par.ParameterName,parameterName)== 0){ |
||||
return par; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
public class SqlParametersCollection: List<SqlParameter>{ |
||||
public SqlParameter Find (string parameterName) { |
||||
|
||||
foreach (SqlParameter par in this){ |
||||
if (String.Compare(par.ParameterName,parameterName)== 0){ |
||||
return par; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
using System.Reflection; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
@ -1,92 +0,0 @@
@@ -1,92 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using System.Data; |
||||
using System.Data.OleDb; |
||||
|
||||
/// <summary>
|
||||
/// This class handles the connection to a DataBase
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 17.10.2005 22:59:39
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReportCore { |
||||
public class ConnectionObject : object,IDisposable { |
||||
IDbConnection connection; |
||||
OleDbConnectionStringBuilder oleDbConnectionStringBuilder; |
||||
string connectionString; |
||||
|
||||
|
||||
public ConnectionObject(string connectionString) { |
||||
if (String.IsNullOrEmpty(connectionString)) { |
||||
throw new ArgumentNullException("connectionString"); |
||||
} |
||||
this.connectionString = connectionString; |
||||
this.connection = new OleDbConnection (this.connectionString); |
||||
} |
||||
|
||||
public ConnectionObject( OleDbConnectionStringBuilder oleDbConnectionStringBuilder){ |
||||
if (oleDbConnectionStringBuilder == null) { |
||||
throw new ArgumentNullException("oleDbConnectionStringBuilder"); |
||||
} |
||||
this.oleDbConnectionStringBuilder = oleDbConnectionStringBuilder; |
||||
try { |
||||
this.connection = new OleDbConnection (this.oleDbConnectionStringBuilder.ConnectionString); |
||||
} catch (Exception ) { |
||||
throw; |
||||
} |
||||
} |
||||
|
||||
public ConnectionObject(IDbConnection connection){ |
||||
if (connection == null) { |
||||
throw new ArgumentNullException("connection"); |
||||
} |
||||
this.connection = connection; |
||||
this.connectionString = this.connection.ConnectionString; |
||||
} |
||||
|
||||
public IDbConnection Connection { |
||||
get { |
||||
return connection; |
||||
} |
||||
|
||||
} |
||||
#region IDisposeable
|
||||
public void Dispose () { |
||||
Dispose(true); |
||||
GC.SuppressFinalize(this); |
||||
} |
||||
|
||||
~ConnectionObject(){ |
||||
Dispose(false); |
||||
} |
||||
|
||||
protected virtual void Dispose(bool disposing) { |
||||
try{ |
||||
if (disposing){ |
||||
if (this.connection != null){ |
||||
if (this.connection.State == ConnectionState.Open) { |
||||
this.connection.Close(); |
||||
} |
||||
this.connection.Dispose(); |
||||
} |
||||
} |
||||
} |
||||
finally{ |
||||
connection = null; |
||||
} |
||||
} |
||||
|
||||
#endregion
|
||||
|
||||
} |
||||
} |
@ -1,98 +0,0 @@
@@ -1,98 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
|
||||
/// <summary>
|
||||
/// This Class is the BaseClass for all Comparers
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 10.11.2005 23:41:04
|
||||
/// </remarks>
|
||||
namespace SharpReportCore { |
||||
public class BaseComparer : object, System.IComparable { |
||||
|
||||
private int listIndex; |
||||
private object[] objectArray; |
||||
private ColumnCollection columnCollection; |
||||
/// <summary>
|
||||
/// Default constructor - initializes all fields to default values
|
||||
/// </summary>
|
||||
public BaseComparer(ColumnCollection owner, int listIndex, object[] values) { |
||||
this.columnCollection = owner; |
||||
this.listIndex = listIndex; |
||||
this.objectArray = values; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Interface method from IComparable
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Interface method from IComparable
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name='obj'>a <see cref="BaseComparer"></see></param>
|
||||
public virtual int CompareTo(object obj) { |
||||
return 0; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Ausgeben der Werte als Pseudo-CSV
|
||||
/// </summary>
|
||||
public override string ToString() |
||||
{ |
||||
System.Text.StringBuilder builder = new System.Text.StringBuilder(); |
||||
builder.AppendFormat("{0};", this.listIndex); |
||||
foreach (object value in objectArray) |
||||
{ |
||||
if (value == null || value == DBNull.Value) |
||||
{ |
||||
builder.AppendFormat("<NULL>"); |
||||
} |
||||
else if (value.GetType() == typeof(string)) |
||||
{ |
||||
builder.AppendFormat("\"{0}\"", (string)value); |
||||
} |
||||
else if (value is IFormattable) |
||||
{ |
||||
builder.AppendFormat("{0}", ((IFormattable)value).ToString("g", System.Globalization.CultureInfo.InvariantCulture)); |
||||
} |
||||
else |
||||
{ |
||||
builder.AppendFormat("[{0}]", value.ToString()); |
||||
} |
||||
builder.Append(';'); |
||||
} |
||||
return builder.ToString(); |
||||
} |
||||
|
||||
|
||||
public int ListIndex { |
||||
get { |
||||
return listIndex; |
||||
} |
||||
} |
||||
|
||||
public object[] ObjectArray { |
||||
get { |
||||
return objectArray; |
||||
} |
||||
} |
||||
public ColumnCollection ColumnCollection { |
||||
get { |
||||
return columnCollection; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
||||
} |
@ -1,188 +0,0 @@
@@ -1,188 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version: 1.1.4322.2032
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Globalization; |
||||
using System.Text; |
||||
|
||||
/// <summary>
|
||||
/// TODO - Add class summary
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// created by - Forstmeier Peter
|
||||
/// created on - 28.11.2005 13:43:22
|
||||
/// </remarks>
|
||||
|
||||
namespace SharpReportCore { |
||||
public class GroupSeperator : SharpReportCore.BaseComparer,IHierarchyData { |
||||
private string typeName = "GroupSeperator"; |
||||
|
||||
int groupLevel; |
||||
SharpIndexCollection childs ; |
||||
|
||||
public GroupSeperator(ColumnCollection owner, int listIndex, object[] values,int groupLevel): |
||||
base(owner,listIndex,values) { |
||||
this.groupLevel = groupLevel; |
||||
} |
||||
|
||||
|
||||
public int GroupLevel { |
||||
get { |
||||
return groupLevel; |
||||
} |
||||
} |
||||
|
||||
public SharpIndexCollection GetChildren { |
||||
get { |
||||
if (this.childs == null) { |
||||
this.childs = new SharpIndexCollection("ChildList"); |
||||
} |
||||
return childs; |
||||
|
||||
} |
||||
} |
||||
|
||||
#region Comparer
|
||||
internal int CompareTo(BaseComparer value) |
||||
{ |
||||
// we shouldn't get to this point
|
||||
if (value == null) |
||||
throw new ArgumentNullException("value"); |
||||
|
||||
if (value.ObjectArray.Length != base.ObjectArray.Length){ |
||||
string s = String.Format(CultureInfo.CurrentCulture, |
||||
"{0} {1} {2}", |
||||
this.GetType().ToString(), |
||||
value.ObjectArray.Length, |
||||
base.ObjectArray.Length); |
||||
throw new SharpReportException(s); |
||||
} |
||||
|
||||
|
||||
int compare = 0; |
||||
|
||||
for (int index = 0; index < base.ObjectArray.Length; index++) |
||||
{ |
||||
object leftValue = base.ObjectArray[index]; |
||||
object rightValue = value.ObjectArray[index]; |
||||
// Indizes sind hier deckungsgleich
|
||||
|
||||
GroupColumn groupColumn = (GroupColumn)base.ColumnCollection[index]; |
||||
|
||||
bool descending = (groupColumn.SortDirection == ListSortDirection.Descending); |
||||
|
||||
// null means equl
|
||||
if (leftValue == null || leftValue == System.DBNull.Value) |
||||
{ |
||||
if (rightValue != null && rightValue != System.DBNull.Value) |
||||
{ |
||||
return (descending) ? 1 : -1; |
||||
} |
||||
|
||||
// Beide Null
|
||||
continue; |
||||
} |
||||
|
||||
if (rightValue == null || rightValue == System.DBNull.Value) |
||||
{ |
||||
return (descending) ? -1 : 1; |
||||
} |
||||
|
||||
|
||||
if (leftValue.GetType() != rightValue.GetType()){ |
||||
string s = String.Format(CultureInfo.CurrentCulture, |
||||
"{0} {1} {2}",this.GetType().ToString(), |
||||
leftValue.GetType().ToString(), |
||||
rightValue.GetType().ToString()); |
||||
|
||||
throw new SharpReportException(s); |
||||
} |
||||
|
||||
|
||||
if (leftValue.GetType() == typeof(string)) |
||||
{ |
||||
compare = String.Compare((string)leftValue, (string)rightValue, |
||||
!groupColumn.CaseSensitive, base.ColumnCollection.Culture); |
||||
} |
||||
else |
||||
{ |
||||
compare = ((IComparable)leftValue).CompareTo(rightValue); |
||||
} |
||||
|
||||
// Sind ungleich, tauschen je nach Richtung
|
||||
if (compare != 0) |
||||
{ |
||||
return (descending) ? -compare : compare; |
||||
} |
||||
} |
||||
|
||||
// Gleich Werte, dann Index bercksichtigen
|
||||
return this.ListIndex.CompareTo(value.ListIndex); |
||||
} |
||||
|
||||
|
||||
|
||||
public override int CompareTo(object obj) { |
||||
base.CompareTo(obj); |
||||
return this.CompareTo((BaseComparer)obj); |
||||
} |
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region SharpReportCore.IHierarchyData interface implementation
|
||||
|
||||
public virtual bool HasChildren { |
||||
get { |
||||
return (this.childs.Count > 0); |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
public object Item { |
||||
get { |
||||
return this; |
||||
} |
||||
} |
||||
|
||||
public string Path { |
||||
get { |
||||
StringBuilder sb = new StringBuilder(); |
||||
foreach (object o in base.ObjectArray) { |
||||
sb.Append(o.ToString() + ";"); |
||||
} |
||||
sb.Remove(sb.Length -1,1); |
||||
return sb.ToString(); |
||||
} |
||||
} |
||||
|
||||
public string Type { |
||||
get { |
||||
return this.typeName; |
||||
} |
||||
} |
||||
|
||||
// public IHierarchicalEnumerable GetChildren() {
|
||||
// return this.childs;
|
||||
// }
|
||||
//
|
||||
// public IHierarchyData GetParent() {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
#endregion
|
||||
|
||||
// public override string ToString (){
|
||||
// return this.typeName;
|
||||
// }
|
||||
} |
||||
} |
@ -1,98 +0,0 @@
@@ -1,98 +0,0 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Peter |
||||
* Date: 08.11.2005 |
||||
* Time: 22:17 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Globalization; |
||||
|
||||
namespace SharpReportCore { |
||||
|
||||
public class SortComparer : BaseComparer { |
||||
|
||||
public SortComparer(ColumnCollection owner, int listIndex, object[] values): |
||||
base(owner,listIndex,values){ |
||||
|
||||
} |
||||
|
||||
internal int CompareTo(SortComparer value) |
||||
{ |
||||
// we shouldn't get to this point
|
||||
if (value == null) |
||||
throw new ArgumentNullException("value"); |
||||
|
||||
if (value.ObjectArray.Length != base.ObjectArray.Length) |
||||
throw new InvalidOperationException(); |
||||
|
||||
int compare = 0; |
||||
|
||||
for (int index = 0; index < base.ObjectArray.Length; index++) |
||||
{ |
||||
object leftValue = base.ObjectArray[index]; |
||||
object rightValue = value.ObjectArray[index]; |
||||
// Indizes sind hier deckungsgleich
|
||||
|
||||
SortColumn sortColumn = (SortColumn)base.ColumnCollection[index]; |
||||
|
||||
bool descending = (sortColumn.SortDirection == ListSortDirection.Descending); |
||||
|
||||
// null means equl
|
||||
if (leftValue == null || leftValue == System.DBNull.Value) |
||||
{ |
||||
if (rightValue != null && rightValue != System.DBNull.Value) |
||||
{ |
||||
return (descending) ? 1 : -1; |
||||
} |
||||
|
||||
// Beide Null
|
||||
continue; |
||||
} |
||||
|
||||
if (rightValue == null || rightValue == System.DBNull.Value) |
||||
{ |
||||
return (descending) ? -1 : 1; |
||||
} |
||||
|
||||
|
||||
if (leftValue.GetType() != rightValue.GetType()){ |
||||
string s = String.Format(CultureInfo.CurrentCulture, |
||||
"{0} {1} {2}",this.GetType().ToString(), |
||||
leftValue.GetType().ToString(), |
||||
rightValue.GetType().ToString()); |
||||
|
||||
throw new SharpReportException(s); |
||||
} |
||||
if (leftValue.GetType() == typeof(string)) |
||||
{ |
||||
compare = String.Compare((string)leftValue, (string)rightValue, |
||||
!sortColumn.CaseSensitive, base.ColumnCollection.Culture); |
||||
} |
||||
else |
||||
{ |
||||
compare = ((IComparable)leftValue).CompareTo(rightValue); |
||||
} |
||||
|
||||
// Sind ungleich, tauschen je nach Richtung
|
||||
if (compare != 0) |
||||
{ |
||||
return (descending) ? -compare : compare; |
||||
} |
||||
} |
||||
|
||||
// Gleich Werte, dann Index bercksichtigen
|
||||
return this.ListIndex.CompareTo(value.ListIndex); |
||||
} |
||||
public override int CompareTo(object obj) { |
||||
base.CompareTo(obj); |
||||
return this.CompareTo((SortComparer)obj); |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue