Browse Source

Remove GlobalEnums.cs, start work on Wizard

pull/520/merge
Peter Forstmeier 11 years ago
parent
commit
97677677c5
  1. 25
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj
  2. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs
  3. 23
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs
  4. 66
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml
  5. 63
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs
  6. 22
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/IHasContext.cs
  7. 33
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml
  8. 63
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs
  9. 31
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs
  10. 48
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportWizardCommand.cs
  11. 26
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/PageOneContext.cs
  12. 39
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/ReportWizardContext.cs
  13. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs
  14. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs
  15. 53
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs
  16. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs
  17. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/GeneralReportLoading.cs

25
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj

@ -73,9 +73,13 @@ @@ -73,9 +73,13 @@
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit">
<HintPath>..\..\..\..\Libraries\WPFExtendedToolkit\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Configuration" />
<Folder Include="src\New Folder" />
<Folder Include="src" />
<Folder Include="src\DesignerBinding" />
<Folder Include="src\Commands" />
@ -84,8 +88,10 @@ @@ -84,8 +88,10 @@
<Folder Include="src\DesignableItems" />
<Folder Include="src\Factory" />
<Folder Include="src\Dialogs" />
<Folder Include="src\ReportWizard\Dialog" />
<Folder Include="src\ReportWizard\ViewModels" />
<Folder Include="src\UndoRedo" />
<Folder Include="src\Wizard" />
<Folder Include="src\ReportWizard" />
<Folder Include="src\Toolbox" />
<Folder Include="src\TypeProvider" />
<Folder Include="src\XML" />
@ -140,6 +146,19 @@ @@ -140,6 +146,19 @@
<Compile Include="src\Globals\DesignerGlobals.cs" />
<Compile Include="src\Globals\GlobalLists.cs" />
<Compile Include="src\Globals\StringWriterWithEncoding.cs" />
<Compile Include="src\ReportWizard\Dialog\IHasContext.cs" />
<Compile Include="src\ReportWizard\Dialog\BaseSettingsPage.xaml.cs">
<DependentUpon>BaseSettingsPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="src\ReportWizard\Dialog\ReportWizard.xaml.cs">
<DependentUpon>ReportWizard.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="src\ReportWizard\ReportGenerator.cs" />
<Compile Include="src\ReportWizard\ReportWizardCommand.cs" />
<Compile Include="src\ReportWizard\ViewModels\PageOneContext.cs" />
<Compile Include="src\ReportWizard\ViewModels\ReportWizardContext.cs" />
<Compile Include="src\Services\DefaultMemberRelationshipService.cs" />
<Compile Include="src\Services\DesignerSerializationService.cs" />
<Compile Include="src\Services\MenuCommandService.cs" />
@ -210,5 +229,9 @@ @@ -210,5 +229,9 @@
<DependentUpon>EditorDialog.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Page Include="src\ReportWizard\Dialog\BaseSettingsPage.xaml" />
<Page Include="src\ReportWizard\Dialog\ReportWizard.xaml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs

@ -34,9 +34,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -34,9 +34,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
// this.GraphicsUnit = GraphicsUnit.Pixel;
// this.Padding = new Padding(5);
// this.DefaultFont = GlobalValues.DefaultFont;
this.ReportType = GlobalEnums.ReportType.FormSheet;
this.ReportType = ReportType.FormSheet;
//
this.DataModel = GlobalEnums.PushPullModel.FormSheet;
this.DataModel = PushPullModel.FormSheet;
//
// this.CommandType = System.Data.CommandType.Text;
// this.ConnectionString = String.Empty;
@ -130,11 +130,11 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -130,11 +130,11 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
public bool Landscape {get;set;}
// [Category("Data")]
public GlobalEnums.PushPullModel DataModel {get;set;}
public PushPullModel DataModel {get;set;}
// [Browsable(true), Category("Base Settings")]
public GlobalEnums.ReportType ReportType {get;set;}
public ReportType ReportType {get;set;}
// [Category("Parameters")]

23
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs

@ -13,10 +13,10 @@ using System.Xml; @@ -13,10 +13,10 @@ using System.Xml;
using ICSharpCode.Core;
using ICSharpCode.Reporting.Factories;
using ICSharpCode.Reporting.Items;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Workbench;
using ICSharpCode.Reporting.Addin.Commands;
using ICSharpCode.Reporting.Addin.Factory;
using ICSharpCode.Reporting.Addin.ReportWizard;
namespace ICSharpCode.Reporting.Addin.DesignerBinding {
@ -44,6 +44,21 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding { @@ -44,6 +44,21 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding {
public IViewContent CreateContentForFile(OpenedFile file)
{
if (file.IsDirty) {
var cmd = new ReportWizardCommand(file);
cmd.Run();
if (cmd.Canceled) {
LoggingService.Info("reportWizard canceled");
return null;
}
}
var viewCmd = new CreateDesignerCommand(file);
viewCmd.Run();
LoggingService.Info("return DesignerView");
return viewCmd.DesignerView;
/*
if (file.IsDirty) {
var reportModel = ReportModelFactory.Create();
@ -55,10 +70,8 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding { @@ -55,10 +70,8 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding {
file.SetData(ar);
}
var viewCmd = new CreateDesignerCommand(file);
viewCmd.Run();
LoggingService.Info("return DesignerView");
return viewCmd.DesignerView;
*/
}
static byte[] XmlToArray(XmlDocument doc)

66
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
<xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.BaseSettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:aa="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
xmlns:ics="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
Title="Base Settings"
Description="Basic Settings and Layout"
Background="LightGray">
<!-- Enter="WizardPage_Enter"
Leave="WizardPage_Leave"-->
<!-- !xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.PageWithContext"-->
<xctk:WizardPage.Resources>
<ObjectDataProvider x:Key="dataFromEnum" MethodName="GetValues"
ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="aa:PushPullModel"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</xctk:WizardPage.Resources>
<Grid ShowGridLines="true">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"> </RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Content="DataModel :"></Label>
<!--<RadioButton Name="_FormSheet" GroupName="DataModel" Content="FormSheet" Margin="0,5,0,5" Grid.Row="1" ></RadioButton>
<RadioButton Name="_PushModel" GroupName="DataModel" Content="PushModel" Margin="0,5,0,5" Grid.Row="1" Grid.Column="1"></RadioButton>
-->
<ComboBox ItemsSource="{Binding Source={StaticResource dataFromEnum}}" Grid.Column="1" ></ComboBox>
<Label Content="ReportType :" Margin="0,5,0,5" Grid.Row="2"></Label>
<RadioButton Name="_FormSheetType" GroupName="ReportType" Content="FormSheet" Margin="0,5,0,5" Grid.Row="3" ></RadioButton>
<RadioButton Name="_DataModelType" GroupName="ReportType" Content="PushModel" Margin="0,5,0,5" Grid.Row="3" Grid.Column="1"></RadioButton>
<Label Content="Report Name :" Margin="0,5,0,5" Grid.Row="4"></Label>
<TextBox Name="_ReportName" Margin="10,5,0,5" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3"></TextBox>
<Label Content="Filename :" Margin="0,5,0,5" Grid.Row="5"></Label>
<TextBox Name="_Filename" Margin="10,5,0,5" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3"></TextBox>
<Label Content="Page Layout :" Grid.Row="6" Margin="0,5,0,5"></Label>
<RadioButton Name="_Legal" GroupName="PageLayout" Content="Legal" Grid.Row="7" Margin="0,5,0,5" ></RadioButton>
<RadioButton Name="_Landscape" GroupName="PageLayout" Content="Landscape" Grid.Row="7" Grid.Column="1" Margin="0,5,0,5"></RadioButton>
</Grid>
</xctk:WizardPage>

63
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 08.07.2014
* Time: 20:26
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Windows;
using Xceed.Wpf.Toolkit;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{
/// <summary>
/// Interaction logic for PageOne.xamlWizardPage,IHasContext
/// </summary>
public partial class BaseSettingsPage : WizardPage,IHasContext
{
PageOneContext context;
public BaseSettingsPage()
{
InitializeComponent();
this.context = new PageOneContext();
}
public IWizardContext Context {
get{
UpdateContext();
return context;}
}
public int PageNumber {
get {return 1;}
}
void WizardPage_Enter(object sender, RoutedEventArgs e)
{
Console.Write("Create Context for PageOne");
}
void WizardPage_Leave(object sender, RoutedEventArgs e)
{
// NewMethod();
}
void UpdateContext()
{
// context.FormSheet = this._FormSheet.IsChecked == true;
// context.PushModel = this._PushModel.IsChecked == true;
context.ReportName = this._ReportName.Text;
context.FileName = this._Filename.Text;
context.Legal = _Legal.IsChecked == true;
;
context.Landscape = _Landscape.IsChecked == true;
}
}
}

22
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/IHasContext.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 16.07.2014
* Time: 20:41
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
{
/// <summary>
/// Description of IHasContext.
/// </summary>
public interface IHasContext
{
IWizardContext Context {get;}
int PageNumber {get;}
}
}

33
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
<Window x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:local="clr-namespace:ICSharpCode.Reporting.Addin.ReportWizard.Dialog"
Title="{Binding Title}"
Height="600" Width="600">
<xctk:Wizard x:Name="_wizard" FinishButtonClosesWindow="True"
Next="_wizard_Next"
PageChanged="_wizard_PageChanged"
Finish="_wizard_Finish"
CanHelp="False">
<xctk:WizardPage PageType="Exterior" Title="Welcome to Reporting Wizard"
Description="This Wizard will walk you though how to do something." />
<!-- ! <local:BaseSettingsPage ></local:BaseSettingsPage> -->
<xctk:WizardPage PageType="Interior"
Title="Page 1"
Description="This is the first page in the process." />
<xctk:WizardPage PageType="Interior"
Title="Page 2"
Description="This is the second page in the process" />
<xctk:WizardPage PageType="Interior"
Title="Last Page"
Description="This is the last page in the process"
CanFinish="True" />
</xctk:Wizard>
</Window>

63
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 07.07.2014
* Time: 20:18
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Windows;
using Xceed.Wpf.Toolkit;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
using System.Linq;
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class ReportWizard : Window
{
ReportWizardContext context;
BaseSettingsPage baseSettingsPage;
public ReportWizard(ReportWizardContext context)
{
InitializeComponent();
this.context = context;
baseSettingsPage = new BaseSettingsPage();
_wizard.Items.Insert(2,baseSettingsPage);
}
void _wizard_Next(object sender, Xceed.Wpf.Toolkit.Core.CancelRoutedEventArgs e)
{
}
void _wizard_PageChanged(object sender, RoutedEventArgs e)
{
}
void _wizard_Finish(object sender, RoutedEventArgs e)
{
var x = _wizard.Items;
foreach (var element in this._wizard.Items) {
var isHasContext = element is IHasContext;
if (isHasContext) {
var hasContext = (IHasContext) element;
Console.WriteLine(" {0} - {1}",hasContext.PageNumber,element.ToString());
}
}
context.PageOneContext = baseSettingsPage.Context;
}
}
}

31
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 22.07.2014
* Time: 19:37
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
namespace ICSharpCode.Reporting.Addin.ReportWizard
{
/// <summary>
/// Description of ReportGenerator.
/// </summary>
public class ReportGenerator
{
ReportWizardContext context;
public ReportGenerator(ReportWizardContext context)
{
if (context == null)
throw new ArgumentNullException("context");
this.context = context;
}
}
}

48
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportWizardCommand.cs

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 08.07.2014
* Time: 19:47
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using ICSharpCode.Core;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.SharpDevelop.Workbench;
using ICSharpCode.Reporting.Addin.ReportWizard.Dialog;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
namespace ICSharpCode.Reporting.Addin.ReportWizard
{
/// <summary>
/// Description of ReportWizardCommand.
/// </summary>
class ReportWizardCommand: AbstractMenuCommand
{
readonly OpenedFile file;
public ReportWizardCommand (OpenedFile file) {
if (file == null)
throw new ArgumentNullException("file");
this.file = file;
}
public override void Run()
{
var wizardViewModel = new ReportWizardContext();
var reportWizard = new ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard(wizardViewModel);
reportWizard.ShowDialog();
if (reportWizard.DialogResult.HasValue && reportWizard.DialogResult.Value){
LoggingService.Info("ReportWizard - CreateReport");
var rg = new ReportGenerator(wizardViewModel);
} else {
Canceled = true;
}
}
public bool Canceled {get; private set;}
}
}

26
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/PageOneContext.cs

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 07/12/2014
* Time: 18:20
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using Xceed.Wpf.Toolkit;
namespace ICSharpCode.Reporting.Addin.ReportWizard.ViewModels
{
/// <summary>
/// Description of PageOneViewModel.
/// </summary>
public class PageOneContext:IWizardContext
{
public bool FormSheet {get;set;}
public bool PushModel {get;set;}
public string ReportName {get;set;}
public string FileName {get;set;}
public bool Legal {get;set;}
public bool Landscape {get;set;}
}
}

39
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/ReportWizardContext.cs

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 07/12/2014
* Time: 18:10
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
namespace ICSharpCode.Reporting.Addin.ReportWizard.ViewModels
{
public interface IWizardContext {
}
/// <summary>
/// Description of ReportWizardViewModel.
/// </summary>
public class ReportWizardContext:IWizardContext
{
public string Title {
get{ return "das ist der Title";}
}
IWizardContext pageOneContext;
public IWizardContext PageOneContext {
get {
return pageOneContext;
}
set {
pageOneContext = value;
}
}
}
}

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs

@ -32,18 +32,18 @@ namespace ICSharpCode.Reporting.Factories @@ -32,18 +32,18 @@ namespace ICSharpCode.Reporting.Factories
{
IReportCreator reportCreator = null;
switch (reportModel.ReportSettings.DataModel) {
case GlobalEnums.PushPullModel.FormSheet:
case PushPullModel.FormSheet:
{
reportCreator = new FormPageBuilder(reportModel);
break;
}
case GlobalEnums.PushPullModel.PullData:
case PushPullModel.PullData:
{
break;
}
case GlobalEnums.PushPullModel.PushData:
case PushPullModel.PushData:
{
break;

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs

@ -22,7 +22,7 @@ namespace ICSharpCode.Reporting.Factories @@ -22,7 +22,7 @@ namespace ICSharpCode.Reporting.Factories
{
var reportModel = new ReportModel();
foreach (var section in Enum.GetValues(typeof(GlobalEnums.ReportSection))) {
foreach (var section in Enum.GetValues(typeof(ReportSection))) {
reportModel.SectionCollection.Add (SectionFactory.Create(section.ToString()));
}

53
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs

@ -23,12 +23,30 @@ namespace ICSharpCode.Reporting.Globals @@ -23,12 +23,30 @@ namespace ICSharpCode.Reporting.Globals
/// <summary>
/// Description of GlobalEnums.
/// </summary>
public sealed class GlobalEnums
{
private GlobalEnums() {
}
public enum ReportSection {
///<summary>Technics to get the data
/// Push : report get's a ready filld dataset or something tah implements IList
/// Pull : report has to fill data by themself
/// FormSheet : FormSheet report, just labels and images are allowed
/// </summary>
///
public enum PushPullModel {
PushData,
PullData,
FormSheet
}
/// <summary>
/// FormSheet means a blank form with Labels, Lines and Checkboxes
/// DataReport handles all Reports with Data
/// </summary>
public enum ReportType {
FormSheet,
DataReport,
}
public enum ReportSection {
ReportHeader,
ReportPageHeader,
ReportDetail,
@ -36,27 +54,34 @@ namespace ICSharpCode.Reporting.Globals @@ -36,27 +54,34 @@ namespace ICSharpCode.Reporting.Globals
ReportFooter
}
public sealed class GlobalEnums
{
private GlobalEnums() {
}
///<summary>Technics to get the data
/// Push : report get's a ready filld dataset or something tah implements IList
/// Pull : report has to fill data by themself
/// FormSheet : FormSheet report, just labels and images are allowed
/// </summary>
///
public enum PushPullModel {
PushData,
PullData,
FormSheet
}
// public enum PushPullModel {
// PushData,
// PullData,
// FormSheet
// }
/// <summary>
/// FormSheet means a blank form with Labels, Lines and Checkboxes
/// DataReport handles all Reports with Data
/// </summary>
public enum ReportType {
FormSheet,
DataReport,
}
// public enum ReportType {
// FormSheet,
// DataReport,
// }
}

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs

@ -65,9 +65,9 @@ namespace ICSharpCode.Reporting.Items @@ -65,9 +65,9 @@ namespace ICSharpCode.Reporting.Items
// this.GraphicsUnit = GraphicsUnit.Pixel;
// this.Padding = new Padding(5);
// this.DefaultFont = GlobalValues.DefaultFont;
ReportType = GlobalEnums.ReportType.FormSheet;
ReportType = ReportType.FormSheet;
//
this.DataModel = GlobalEnums.PushPullModel.FormSheet;
this.DataModel = PushPullModel.FormSheet;
//
// this.CommandType = System.Data.CommandType.Text;
// this.ConnectionString = String.Empty;
@ -125,11 +125,11 @@ namespace ICSharpCode.Reporting.Items @@ -125,11 +125,11 @@ namespace ICSharpCode.Reporting.Items
[Browsable(true), Category("Base Settings")]
public GlobalEnums.ReportType ReportType {get;set;}
public ReportType ReportType {get;set;}
[Browsable(true), Category("Base Settings")]
public GlobalEnums.PushPullModel DataModel {get;set;}
public PushPullModel DataModel {get;set;}
#endregion

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Reportingfactory/GeneralReportLoading.cs

@ -68,7 +68,7 @@ namespace ICSharpCode.Reporting.Test.Reportingfactory @@ -68,7 +68,7 @@ namespace ICSharpCode.Reporting.Test.Reportingfactory
{
var rf = new ReportingFactory();
var model = rf.LoadReportModel(stream);
Assert.That(model.ReportSettings.DataModel,Is.EqualTo(GlobalEnums.PushPullModel.FormSheet));
Assert.That(model.ReportSettings.DataModel,Is.EqualTo(PushPullModel.FormSheet));
}

Loading…
Cancel
Save