diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx index 0623b77162..038df8e959 100644 --- a/data/resources/StringResources.resx +++ b/data/resources/StringResources.resx @@ -8294,4 +8294,7 @@ a line break Page Layout + + No project selected, please enter FieldNames + \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs index ff04752a03..5901018a50 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/ReportSettings.cs @@ -34,7 +34,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems // this.GraphicsUnit = GraphicsUnit.Pixel; // this.Padding = new Padding(5); // this.DefaultFont = GlobalValues.DefaultFont; - this.ReportType = ReportType.FormSheet; +// this.ReportType = ReportType.FormSheet; // this.DataModel = PushPullModel.FormSheet; // @@ -93,9 +93,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems } - [Browsable(true), Category("Base Settings")] - public ReportType ReportType {get;set;} - +// [Browsable(true), Category("Base Settings")] +// public ReportType ReportType {get;set;} +// [Category("Page Settings")] public int BottomMargin {get;set;} diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml index 58c6d29606..c29ed94b53 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml @@ -19,12 +19,12 @@ - - + --> @@ -54,11 +54,11 @@ ItemsSource="{Binding Source={StaticResource pushpullEnum}}"> - + diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs index 2061e2316f..e031a1eea1 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs @@ -25,7 +25,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ { InitializeComponent(); _DataModel.SelectedItem = PushPullModel.FormSheet; - _ReportType.SelectedItem = ReportType.FormSheet; +// _ReportType.SelectedItem = ReportType.FormSheet; _Legal.IsChecked = true; this.context = new PageOneContext(); } @@ -44,7 +44,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ void UpdateContext(){ context.DataModel = (PushPullModel) _DataModel.SelectedItem; - context.ReportType = (ReportType) _ReportType.SelectedItem; +// context.ReportType = (ReportType) _ReportType.SelectedItem; context.ReportName = this._ReportName.Text; context.FileName = this._Filename.Text; context.Legal = _Legal.IsChecked == true; @@ -59,7 +59,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ switch (pushPullModel) { case PushPullModel.PushData: { - this._ReportType.SelectedItem = ReportType.DataReport; +// this._ReportType.SelectedItem = ReportType.DataReport; this.CanFinish = false; this.CanSelectNextPage = true; break; @@ -74,7 +74,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{ case PushPullModel.FormSheet: { this.CanFinish = true; CanSelectNextPage = false; - this._ReportType.SelectedItem = ReportType.FormSheet; +// this._ReportType.SelectedItem = ReportType.FormSheet; break; } } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml index 74813c661a..27cc0b7627 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml @@ -12,7 +12,7 @@ CanSelectPreviousPage="true" CanSelectNextPage="false"> - + @@ -23,12 +23,13 @@ + + - - + - + (); _DataGrid.ItemsSource = items; this.context = new PushModelContext(); - var data = new AbstractColumn("MyColumn",typeof(string)); - items.Add(data); cboType.ItemsSource = GlobalLists.DataTypeList(); - var definitions = GetTypeDefinitions(); - if (definitions != null) { + var definitions = GetTypeDefinitions(); + if (definitions.Any()) { _cboTypes.Visibility = System.Windows.Visibility.Visible; + _availTxt.Visibility = System.Windows.Visibility.Visible; _cboTypes.ItemsSource = definitions; _cboTypes.SelectedIndex = 0; + } else { + var data = new AbstractColumn("MyColumn", typeof(string)); + items.Add(data); + _projTxt.Text = ResourceService.GetString("SharpReport.Wizard.PushModel.NoProject"); } - } static IEnumerable GetTypeDefinitions() @@ -57,15 +60,16 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog void _cboTypes_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e){ - var s = (ITypeDefinition)e.AddedItems[0]; - var l = CreateItemsSource(s); - if (l.Count > 0) { - _DataGrid.ItemsSource = l; + var typeDefinition = (ITypeDefinition)e.AddedItems[0]; + var itemsList = CreateItemsSource(typeDefinition); + if (itemsList.Count > 0) { + _DataGrid.ItemsSource = itemsList; } } - static List CreateItemsSource(ITypeDefinition s){ - return s.Properties.Select(p => new AbstractColumn(){ + + static List CreateItemsSource(ITypeDefinition typeDefinitions){ + return typeDefinitions.Properties.Select(p => new AbstractColumn(){ ColumnName = p.Name, DataTypeName = p.ReturnType.ReflectionName }).ToList(); @@ -90,44 +94,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog get {return WizardPageType.PushModelPage;} } - - #endregion } - /* - private void PopulateTestItems() - { - TestItems = new ObservableCollection(); - for (int i = 0; i < 5; i++) - { - TestItem ti = new TestItem(); - ti.Name = "TestItem" + i; - ti.IsSelected = true; - TestItems.Add(ti); - } - } - - private bool _AllSelected; - public bool AllSelected - { - get { return _AllSelected; } - set - { - _AllSelected = value; - TestItems.ToList().ForEach(x => x.IsSelected = value); - NotifyPropertyChanged(m => m.AllSelected); - } - } - - private ObservableCollection _TestItems; - public ObservableCollection TestItems - { - get { return _TestItems; } - set - { - _TestItems = value; - NotifyPropertyChanged(m => m.TestItems); - } - }*/ } \ No newline at end of file diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs index b2b09e3812..7c69893561 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard reportSettings.FileName = pageOneContext.FileName; reportSettings.Landscape = !pageOneContext.Legal; reportSettings.ReportName = pageOneContext.ReportName; - reportSettings.ReportType = pageOneContext.ReportType; +// reportSettings.ReportType = pageOneContext.ReportType; return reportSettings; } @@ -184,7 +184,8 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard static bool IsDataReport(ReportWizardContext context) { var poc = (PageOneContext)context.PageOneContext; - return poc.ReportType.Equals(ReportType.DataReport); +// return poc.ReportType.Equals(ReportType.DataReport); + return poc.DataModel != PushPullModel.FormSheet; } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/PageOneContext.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/PageOneContext.cs index c6fc2d92df..55da737288 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/PageOneContext.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/PageOneContext.cs @@ -18,7 +18,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.ViewModels public class PageOneContext:IWizardContext { public PushPullModel DataModel {get;set;} - public ReportType ReportType {get;set;} +// public ReportType ReportType {get;set;} public string ReportName {get;set;} public string FileName {get;set;} public bool Legal {get;set;} diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Toolbox/ToolboxProvider.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Toolbox/ToolboxProvider.cs index 43fb49c4a9..0e51df63d1 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Toolbox/ToolboxProvider.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Toolbox/ToolboxProvider.cs @@ -157,13 +157,13 @@ namespace ICSharpCode.Reporting.Addin.Toolbox /// Bitmap static Bitmap CircleBitmap() { - Bitmap b = new Bitmap (19,19); - using (Graphics g = Graphics.FromImage (b)){ + var bmp = new Bitmap (19,19); + using (var g = Graphics.FromImage (bmp)){ g.DrawEllipse (new Pen(Color.Black, 1), 1,1, 17,17); } - return b; + return bmp; } diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs index e3c34f027e..179c2ed4d3 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs @@ -37,12 +37,12 @@ namespace ICSharpCode.Reporting.Globals /// FormSheet means a blank form with Labels, Lines and Checkboxes /// DataReport handles all Reports with Data /// - public enum ReportType { + /*public enum ReportType { FormSheet, DataReport, } - + */ public enum ReportSection { ReportHeader, ReportPageHeader, diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs index 5f3bfe1f7d..264ca621a1 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs @@ -65,7 +65,7 @@ namespace ICSharpCode.Reporting.Items // this.GraphicsUnit = GraphicsUnit.Pixel; // this.Padding = new Padding(5); // this.DefaultFont = GlobalValues.DefaultFont; - ReportType = ReportType.FormSheet; +// ReportType = ReportType.FormSheet; // this.DataModel = PushPullModel.FormSheet; // @@ -124,10 +124,10 @@ namespace ICSharpCode.Reporting.Items } } - - [Browsable(true), Category("Base Settings")] - public ReportType ReportType {get;set;} - +// +// [Browsable(true), Category("Base Settings")] +// public ReportType ReportType {get;set;} +// [Browsable(true), Category("Base Settings")] public PushPullModel DataModel {get;set;}