Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 2a06007

Browse files
Update WizardPages
1 parent 1fbd200 commit 2a06007

8 files changed

Lines changed: 52 additions & 49 deletions

File tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
xmlns:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
77
Title="Base Settings"
88
Description="Basic Settings and Layout"
9-
PageType="Interior"
10-
Background="LightGray"
9+
PageType="Interior"
1110
CanFinish="true"
1211
CanSelectNextPage="false">
1312

14-
<xctk:WizardPage.ExteriorPanelContent >
15-
<Image Name="_image" Stretch="Fill"></Image>
16-
</xctk:WizardPage.ExteriorPanelContent>
13+
<!--<xctk:WizardPage.ExteriorPanelContent >
14+
<Image Name="_image" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
15+
</xctk:WizardPage.ExteriorPanelContent>-->
1716

1817
<xctk:WizardPage.Resources>
1918
<ObjectDataProvider x:Key="pushpullEnum" MethodName="GetValues"

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* To change this template use Tools | Options | Coding | Edit Standard Headers.
88
*/
99
using System;
10-
using System.Windows;
1110
using System.Windows.Controls;
1211
using ICSharpCode.Reporting.Globals;
1312
using Xceed.Wpf.Toolkit;
@@ -26,8 +25,7 @@ public BaseSettingsPage()
2625
{
2726
InitializeComponent();
2827
_DataModel.SelectedItem = PushPullModel.FormSheet;
29-
_ReportType.SelectedItem = ReportType.FormSheet;
30-
_image.Source = WizardHelper.GetWizardIcon();
28+
_ReportType.SelectedItem = ReportType.FormSheet;
3129
_Legal.IsChecked = true;
3230
this.context = new PageOneContext();
3331
}

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,14 @@
1414
PageChanged="_wizard_PageChanged"
1515
Next="_wizard_Next">
1616

17-
<local:WelcomePage ></local:WelcomePage>
17+
<local:WelcomePage x:Name="WelcomePage"></local:WelcomePage>
1818

19-
<local:BaseSettingsPage x:Name="BaseSettings"></local:BaseSettingsPage>
19+
<local:BaseSettingsPage x:Name="BaseSettingsPage" PreviousPage="{Binding ElementName=WelcomePage}" ></local:BaseSettingsPage>
2020

21-
<local:PushDataReport PreviousPage="{Binding ElementName=BaseSettings}"></local:PushDataReport>
21+
<local:PushDataReport PreviousPage="{Binding ElementName=BaseSettingsPage}"></local:PushDataReport>
2222

23-
<local:PullModelPage PreviousPage="{Binding ElementName=BaseSettings}"></local:PullModelPage>
23+
<local:PullModelPage PreviousPage="{Binding ElementName=BaseSettingsPage}"></local:PullModelPage>
2424

25-
<!--<xctk:WizardPage PageType="Interior"
26-
Title="dritte Seite"
27-
Description="this Page will guide you to creating an DataDriven Report"
28-
CanCancel="true"
29-
CanFinish="True"
30-
/>-->
3125
</xctk:Wizard>
3226

3327
</Window>

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
* To change this template use Tools | Options | Coding | Edit Standard Headers.
88
*/
99
using System;
10-
using System.Drawing;
11-
using System.Drawing.Imaging;
12-
using System.IO;
1310
using System.Windows;
14-
using System.Windows.Media.Imaging;
1511
using ICSharpCode.Reporting.Globals;
16-
using ICSharpCode.SharpDevelop;
1712
using Xceed.Wpf.Toolkit;
1813
using ICSharpCode.Reporting.Addin.ReportWizard.Dialog;
1914
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
@@ -85,10 +80,9 @@ void _wizard_Next(object sender, Xceed.Wpf.Toolkit.Core.CancelRoutedEventArgs e)
8580
}
8681
}
8782
}
88-
89-
Console.WriteLine("CurrentPage {0}",current.Name);
90-
9183
}
84+
85+
9286
void _wizard_PageChanged(object sender, RoutedEventArgs e)
9387
{
9488
var x = _wizard.CurrentPage;
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.WelcomePage"
1+
<xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.WelcomePage"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
@@ -7,15 +7,19 @@
77
xmlns:sdr="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
88
Name="Welcome"
99
Title="SharpDevelop Reporting"
10-
Description="Welcome to Sharpdevelop Reporting Wizard"
11-
PageType="Interior"
10+
PageType="Exterior"
1211
NextButtonVisibility="Visible"
1312
CancelButtonVisibility="Visible">
1413

15-
<Grid>
16-
<Border BorderThickness="3" Margin="10,10,10,10">
17-
<Image Name="_image" Margin="0,8,0,0" ></Image>
18-
</Border>
14+
<xctk:WizardPage.ExteriorPanelContent >
15+
<Image Name="_image" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
16+
</xctk:WizardPage.ExteriorPanelContent>
1917

18+
<Grid ShowGridLines="True">
19+
<Grid.RowDefinitions>
20+
<RowDefinition Height="Auto"></RowDefinition>
21+
</Grid.RowDefinitions>
22+
23+
<TextBlock Text="Welcome to SharpDevelop ReportWizard" FontSize="20"></TextBlock>
2024
</Grid>
2125
</xctk:WizardPage>

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

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,27 @@ public ReportGenerator()
3434
public void Generate(ReportWizardContext context) {
3535
if (context == null)
3636
throw new ArgumentNullException("context");
37+
38+
var poc = (PageOneContext)context.PageOneContext;
39+
if (IsDataReport(poc)) {
40+
CreateDataReport (context);
41+
} else {
42+
CreateFormSheetReport(context);
43+
}
44+
}
45+
46+
void CreateFormSheetReport(ReportWizardContext context)
47+
{
3748
GenerateBaseSettings(context);
38-
GeneratePushModel(context);
3949
CreateReportHeader(context);
4050
}
41-
51+
52+
void CreateDataReport(ReportWizardContext context)
53+
{
54+
GenerateBaseSettings(context);
55+
CreateReportHeader(context);
56+
GeneratePushModel(context);
57+
}
4258

4359
void GenerateBaseSettings (ReportWizardContext context) {
4460
var pageOneContext = (PageOneContext)context.PageOneContext;
@@ -51,6 +67,7 @@ void GenerateBaseSettings (ReportWizardContext context) {
5167
}
5268

5369

70+
5471
void GeneratePushModel(ReportWizardContext context){
5572
var pushModelContext = (PushModelContext)context.PushModelContext;
5673
var xLocation = 5;
@@ -83,14 +100,17 @@ void CreateReportHeader(ReportWizardContext context){
83100

84101
headerText.Size = GlobalValues.PreferedSize;
85102
var printableWith = ReportModel.ReportSettings.PageSize.Width - ReportModel.ReportSettings.LeftMargin - ReportModel.ReportSettings.RightMargin;
86-
var x = (int)(printableWith - headerText.Size.Width) / 2;
87103

104+
var x = (int)(printableWith - headerText.Size.Width) / 2;
88105
headerText.Location = new Point(x,4);
89106
ReportModel.ReportHeader.Items.Add(headerText);
90-
Console.WriteLine("");
91-
Console.WriteLine("Createreportheader Size {0}",ReportModel.ReportHeader.Size);
107+
108+
}
109+
110+
static bool IsDataReport(PageOneContext poc)
111+
{
112+
return poc.ReportType.Equals(ReportType.DataReport);
92113
}
93-
94114

95115
public IReportModel ReportModel {get;private set;}
96116
}

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ void BaseValues()
8282

8383
SortColumnsCollection = new SortColumnCollection();
8484
GroupColumnsCollection = new GroupColumnCollection();
85-
// this.sqlParameters = new SqlParameterCollection();
8685
ParameterCollection = new ParameterCollection();
86+
// this.sqlParameters = new SqlParameterCollection();
87+
8788
// this.NoDataMessage = "No Data for this Report";
8889
}
8990

9091
#region BaseSettings
9192

92-
private string reportName;
93+
string reportName;
9394

9495
[Category("Base Settings")]
9596
[DefaultValueAttribute ("")]
@@ -154,7 +155,7 @@ public string FileName
154155
public int RightMargin {get;set;}
155156

156157

157-
private Size pageSize;
158+
Size pageSize;
158159

159160
[Category("Page Settings")]
160161
public Size PageSize {
@@ -177,14 +178,8 @@ public Size PageSize {
177178

178179
#region
179180

180-
181181
// [Category("Data")]
182182

183-
184-
185-
186-
187-
188183
// [Category("Parameters")]
189184
// [EditorAttribute ( typeof(ParameterCollectionEditor),
190185
// typeof(System.Drawing.Design.UITypeEditor) )]

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public static FormattedText CreateFormattedText(ExportText exportText)
6464
{
6565
var culture = CultureInfo.CurrentCulture;
6666
var flowDirection = culture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
67-
6867
var emSize = ExtensionMethodes.ToPoints((int)exportText.Font.SizeInPoints +1);
6968

7069
var formattedText = new FormattedText(exportText.Text,

0 commit comments

Comments
 (0)