Browse Source

PushDataWizard

pull/505/merge
Peter Forstmeier 11 years ago
parent
commit
a1fd70e664
  1. 11
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj
  2. 39
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml
  3. 31
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs
  4. 33
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml
  5. 32
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml
  6. 11
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/ReportWizard.xaml.cs
  7. 18
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml
  8. 25
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/WizardHelper.cs
  9. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/AbstractColumn.cs

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

@ -150,14 +150,23 @@ @@ -150,14 +150,23 @@
<DependentUpon>BaseSettingsPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="src\ReportWizard\Dialog\PushDataReport.xaml.cs">
<DependentUpon>PushDataReport.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\Dialog\WelcomePage.xaml.cs">
<DependentUpon>WelcomePage.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\ReportWizard\WizardHelper.cs" />
<Compile Include="src\Services\DefaultMemberRelationshipService.cs" />
<Compile Include="src\Services\DesignerSerializationService.cs" />
<Compile Include="src\Services\MenuCommandService.cs" />
@ -230,7 +239,9 @@ @@ -230,7 +239,9 @@
</ItemGroup>
<ItemGroup>
<Page Include="src\ReportWizard\Dialog\BaseSettingsPage.xaml" />
<Page Include="src\ReportWizard\Dialog\PushDataReport.xaml" />
<Page Include="src\ReportWizard\Dialog\ReportWizard.xaml" />
<Page Include="src\ReportWizard\Dialog\WelcomePage.xaml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

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

@ -4,11 +4,17 @@ @@ -4,11 +4,17 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
Name="Base"
Title="Base Settings"
Description="Basic Settings and Layout"
PageType="Interior"
Background="LightGray"
CanFinish="true">
CanFinish="true"
CanSelectNextPage="false">
<xctk:WizardPage.ExteriorPanelContent >
<Image Name="_image" Stretch="Fill"></Image>
</xctk:WizardPage.ExteriorPanelContent>
<xctk:WizardPage.Resources>
<ObjectDataProvider x:Key="pushpullEnum" MethodName="GetValues"
@ -26,7 +32,7 @@ @@ -26,7 +32,7 @@
</ObjectDataProvider>
</xctk:WizardPage.Resources>
<Grid >
<Grid ShowGridLines="True" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"> </RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
@ -40,34 +46,37 @@ @@ -40,34 +46,37 @@
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition MinWidth="80"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Content="DataModel :"></Label>
<Label Content="DataModel :" Grid.Column="1"></Label>
<ComboBox Name="_DataModel" Margin="10,5,0,5"
Grid.Column="1"
Grid.Column="2"
SelectionChanged="_DataModel_SelectionChanged"
ItemsSource="{Binding Source={StaticResource pushpullEnum}}">
</ComboBox>
<Label Content="ReportType :" Margin="0,5,0,5" Grid.Row="2"></Label>
<Label Content="ReportType :" Margin="0,5,0,5" Grid.Column="1" Grid.Row="2"></Label>
<ComboBox Name="_ReportType" Margin="10,5,0,5"
Grid.Row="2" Grid.Column="1"
Grid.Row="2" Grid.Column="2"
ItemsSource="{Binding Source={StaticResource reportTypeEnum}}">
</ComboBox>
<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="Report Name :" Margin="0,5,0,5" Grid.Column="1" Grid.Row="4"></Label>
<TextBox Name="_ReportName" Margin="10,5,0,5" Grid.Row="4" Grid.Column="2" 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="Filename :" Margin="0,5,0,5" Grid.Column="1" Grid.Row="5"></Label>
<TextBox Name="_Filename" Margin="10,5,0,5" Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="3"></TextBox>
<Label Content="Page Layout :" Grid.Row="6" Margin="0,5,0,5"></Label>
<RadioButton Name="_Legal" GroupName="PageLayout" Content="Legal" IsChecked="true" 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>
<Label Content="Page Layout :" Grid.Column="1" Grid.Row="6" Margin="0,5,0,5"></Label>
<RadioButton Name="_Legal" GroupName="PageLayout" Content="Legal" IsChecked="true" Grid.Column="1" Grid.Row="7" Margin="0,5,0,5" ></RadioButton>
<RadioButton Name="_Landscape" GroupName="PageLayout" Content="Landscape" Grid.Row="7" Grid.Column="2" Margin="0,5,0,5"></RadioButton>
</Grid>
</xctk:WizardPage>

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

@ -7,8 +7,14 @@ @@ -7,8 +7,14 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using ICSharpCode.Reporting.Globals;
using ICSharpCode.SharpDevelop;
using Xceed.Wpf.Toolkit;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
@ -26,9 +32,11 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ @@ -26,9 +32,11 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{
InitializeComponent();
_DataModel.SelectedItem = PushPullModel.FormSheet;
_ReportType.SelectedItem = ReportType.FormSheet;
this.context = new PageOneContext();
this.context = new PageOneContext();
this._DataModel.SelectedItem = PushPullModel.FormSheet;
_image.Source = WizardHelper.GetWizardIcon();
}
public IWizardContext Context {
get{
@ -41,16 +49,29 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ @@ -41,16 +49,29 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{
}
void UpdateContext()
{
void UpdateContext(){
context.DataModel = (PushPullModel) _DataModel.SelectedItem;
context.ReportType = (ReportType) _ReportType.SelectedItem;
context.ReportName = this._ReportName.Text;
context.FileName = this._Filename.Text;
context.Legal = _Legal.IsChecked == true;
;
context.Landscape = _Landscape.IsChecked == true;
}
void _DataModel_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e){
var cbo = (ComboBox) sender;
if (((PushPullModel)cbo.SelectedItem) == PushPullModel.FormSheet) {
this.CanFinish = true;
this.CanSelectNextPage = false;
this._ReportType.SelectedItem = ReportType.FormSheet;
} else {
this._ReportType.SelectedItem = ReportType.DataReport;
this.CanFinish = false;
this.CanSelectNextPage = true;
}
}
}
}

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

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
<xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.PushDataReport"
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:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
Name="PushData"
Title="SharpDevelop Reporting"
Description="Welcome to Sharpdevelop Reporting Wizard"
PageType="Interior"
NextButtonVisibility="Visible"
CancelButtonVisibility="Visible">
<Grid ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="200"></RowDefinition>
</Grid.RowDefinitions>
<DataGrid Name="_DataGrid"
ItemsSource="{Binding}"
CanUserAddRows="True"
CanUserDeleteRows="True"
AutoGenerateColumns="False" Grid.Row="1" Margin="30,10,30,5">
<DataGrid.Columns>
<DataGridTextColumn Header="ColumnName" Binding="{Binding ColumnName}" Width="150"></DataGridTextColumn>
<DataGridTextColumn Header="DataType" Binding="{Binding DataTypeName}" Width="150"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</xctk:WizardPage>

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

@ -4,25 +4,41 @@ @@ -4,25 +4,41 @@
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">
Height="600" Width="800">
<xctk:Wizard x:Name="_wizard" FinishButtonClosesWindow="True"
Next="_wizard_Next"
NextButtonVisibility="Visible"
CancelButtonVisibility="Visible"
PageChanged="_wizard_PageChanged"
Finish="_wizard_Finish"
CanHelp="False">
<local:WelcomePage></local:WelcomePage>
<local:BaseSettingsPage></local:BaseSettingsPage>
<local:PushDataReport></local:PushDataReport>
<!--<xctk:WizardPage PageType="Interior"
Title="dritte Seite"
Description="this Page will guide you to creating an DataDriven Report"
CanCancel="true"
CanFinish="True"
/>-->
<!--
<xctk:WizardPage PageType="Exterior" Title="Welcome to Reporting Wizard"
Description="This Wizard will walk you though how to do something." />
Description="This Wizard will walk you though how to do something.">
<!-- ! <local:BaseSettingsPage ></local:BaseSettingsPage> -->
<Image Name="_image"></Image>
</xctk:WizardPage>-->
<!-- ! <local:BaseSettingsPage ></local:BaseSettingsPage> -->
<xctk:WizardPage PageType="Interior"
Title="Page 1"
Description="This is the first page in the process."
CanFinish="True" />
<!-- <xctk:WizardPage PageType="Interior"
<!-- <xctk:WizardPage PageType="Interior"
Title="Page 2"
Description="This is the second page in the process" />
<xctk:WizardPage PageType="Interior"

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

@ -7,7 +7,12 @@ @@ -7,7 +7,12 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows;
using System.Windows.Media.Imaging;
using ICSharpCode.SharpDevelop;
using Xceed.Wpf.Toolkit;
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
using System.Linq;
@ -27,18 +32,18 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog @@ -27,18 +32,18 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
InitializeComponent();
this.context = context;
baseSettingsPage = new BaseSettingsPage();
_wizard.Items.Insert(1,baseSettingsPage);
}
void _wizard_Next(object sender, Xceed.Wpf.Toolkit.Core.CancelRoutedEventArgs e)
{
Console.WriteLine(" _wizard_Next {0}",((Wizard)sender).CurrentPage.Name);
}
void _wizard_PageChanged(object sender, RoutedEventArgs e)
{
Console.WriteLine("_wizard_PageChanged {0}",((Wizard)sender).CurrentPage.Name);
}
void _wizard_Finish(object sender, RoutedEventArgs e)
@ -46,6 +51,6 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog @@ -46,6 +51,6 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
context.PageOneContext = baseSettingsPage.Context;
}
}
}

18
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/WelcomePage.xaml

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
<xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.WelcomePage"
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:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
Name="Welcome"
Title="SharpDevelop Reporting"
Description="Welcome to Sharpdevelop Reporting Wizard"
PageType="Interior"
NextButtonVisibility="Visible"
CancelButtonVisibility="Visible">
<Grid>
<Image Name="_image" Margin="0,8,0,0" ></Image>
</Grid>
</xctk:WizardPage>

25
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/WizardHelper.cs

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 05.08.2014
* Time: 20:08
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Windows.Media;
using ICSharpCode.SharpDevelop;
namespace ICSharpCode.Reporting.Addin.ReportWizard
{
/// <summary>
/// Description of WizardHelper.
/// </summary>
class WizardHelper
{
public static ImageSource GetWizardIcon () {
return IconService.GetImageSource("GeneralWizardBackground");
}
}
}

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/BaseClasses/AbstractColumn.cs

@ -26,8 +26,8 @@ namespace ICSharpCode.Reporting.BaseClasses @@ -26,8 +26,8 @@ namespace ICSharpCode.Reporting.BaseClasses
/// </summary>
public class AbstractColumn
{
private Type dataType;
private string dataTypeName;
Type dataType;
string dataTypeName;
public AbstractColumn() {
this.dataType = typeof(System.String);
@ -53,7 +53,7 @@ namespace ICSharpCode.Reporting.BaseClasses @@ -53,7 +53,7 @@ namespace ICSharpCode.Reporting.BaseClasses
}
}
[XmlIgnoreAttribute]
// [XmlIgnoreAttribute]
public Type DataType {
get {
return dataType;

Loading…
Cancel
Save