Browse Source

Work on Generic IEnumerable and fixes from FxCop

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1746 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 19 years ago
parent
commit
be4f643aea
  1. 8
      src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs
  2. 8
      src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportView.cs
  3. 3
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs
  4. 3
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs
  5. 8
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseImageItem.cs
  6. 29
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/Comparer/GroupSeperator.cs
  7. 12
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/Comparer/SortComparer.cs
  8. 12
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs
  9. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/BaseListStrategy.cs
  10. 12
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/CollectionStrategy.cs
  11. 14
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs
  12. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/Globals/GlobalEnums.cs
  13. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
  14. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs
  15. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/ReportModel.cs
  16. 26
      src/AddIns/Misc/SharpReport/SharpReportCore/ReportSettings.cs
  17. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs
  18. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs
  19. 8
      src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs
  20. 4
      src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GenerateFormSheetReport.cs
  21. 4
      src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GeneratePullDataReport.cs
  22. 4
      src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GeneratePushDataReport.cs
  23. 4
      src/AddIns/Misc/SharpReport/SharpReportWizard/ReportGenerator.cs
  24. 6
      src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs
  25. 13
      src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs

8
src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs

@ -73,20 +73,20 @@ namespace SharpReport{ @@ -73,20 +73,20 @@ namespace SharpReport{
private ColumnCollection ReadColumnCollection() {
ColumnCollection columnCollecion = new ColumnCollection();
switch (baseDesignerControl.ReportModel.DataModel) {
case GlobalEnums.PushPullModelEnum.FormSheet:
case GlobalEnums.PushPullModel.FormSheet:
//Plain FormSheet we do nothing for the moment
break;
case GlobalEnums.PushPullModelEnum.PushData:
case GlobalEnums.PushPullModel.PushData:
//PushData
columnCollecion = SharpReportEngine.CollectFieldsFromModel(this.baseDesignerControl.ReportModel);
break;
case GlobalEnums.PushPullModelEnum.PullData:
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.PushPullModelEnum.PullData)){
if (this.baseDesignerControl.ReportModel.DataModel.Equals(GlobalEnums.PushPullModel.PullData)){
try {
using (DataManager dataManager = new DataManager(base.ConnectionObject,
baseDesignerControl.ReportModel.ReportSettings)) {

8
src/AddIns/Misc/SharpReport/SharpReportAddin/SharpReportView.cs

@ -243,15 +243,15 @@ namespace SharpReportAddin{ @@ -243,15 +243,15 @@ namespace SharpReportAddin{
this.UpdateModelFromExplorer();
try {
switch (designerControl.ReportModel.DataModel) {
case GlobalEnums.PushPullModelEnum.FormSheet : {
case GlobalEnums.PushPullModel.FormSheet : {
PreviewStandartReport(standAlone);
break;
}
case GlobalEnums.PushPullModelEnum.PullData:{
case GlobalEnums.PushPullModel.PullData:{
PreviewStandartReport(standAlone);
break;
}
case GlobalEnums.PushPullModelEnum.PushData:{
case GlobalEnums.PushPullModel.PushData:{
PreviewPushReport (standAlone);
break;
}
@ -565,7 +565,7 @@ namespace SharpReportAddin{ @@ -565,7 +565,7 @@ namespace SharpReportAddin{
public System.Drawing.Printing.PrintDocument PrintDocument {
get {
AbstractRenderer renderer;
if (this.designerControl.ReportModel.DataModel == GlobalEnums.PushPullModelEnum.PushData) {
if (this.designerControl.ReportModel.DataModel == GlobalEnums.PushPullModel.PushData) {
renderer = reportManager.GetRendererForPushDataReports(this.designerControl.ReportModel,
SharpReportView.DataSetFromFile());

3
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs

@ -145,9 +145,6 @@ namespace SharpReportCore { @@ -145,9 +145,6 @@ namespace SharpReportCore {
GC.SuppressFinalize(this);
}
~BaseReportItem(){
Dispose(false);
}
protected override void Dispose(bool disposing) {
try {

3
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseSection.cs

@ -120,9 +120,6 @@ namespace SharpReportCore { @@ -120,9 +120,6 @@ namespace SharpReportCore {
GC.SuppressFinalize(this);
}
~BaseSection(){
Dispose(false);
}
protected override void Dispose(bool disposing) {
try {

8
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Graphics/BaseImageItem.cs

@ -32,7 +32,7 @@ namespace SharpReportCore { @@ -32,7 +32,7 @@ namespace SharpReportCore {
string fileName;
Image image;
bool scaleImageToSize;
GlobalEnums.ImageSourceEnum imageSource;
GlobalEnums.ImageSource imageSource;
public BaseImageItem():base() {
}
@ -121,7 +121,7 @@ namespace SharpReportCore { @@ -121,7 +121,7 @@ namespace SharpReportCore {
set {
fileName = value;
this.image = null;
this.imageSource = GlobalEnums.ImageSourceEnum.File;
this.imageSource = GlobalEnums.ImageSource.File;
LoadImage (fileName);
base.NotifyPropertyChanged("FileName");
}
@ -142,7 +142,7 @@ namespace SharpReportCore { @@ -142,7 +142,7 @@ namespace SharpReportCore {
set {
this.fileName = String.Empty;
this.image = value;
this.imageSource = GlobalEnums.ImageSourceEnum.External;
this.imageSource = GlobalEnums.ImageSource.External;
base.NotifyPropertyChanged("Image");
}
}
@ -151,7 +151,7 @@ namespace SharpReportCore { @@ -151,7 +151,7 @@ namespace SharpReportCore {
/// Where did the image come from
/// </summary>
///
public GlobalEnums.ImageSourceEnum ImageSource {
public GlobalEnums.ImageSource ImageSource {
get {
return imageSource;
}

29
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/Comparer/GroupSeperator.cs

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
//------------------------------------------------------------------------------
using System;
using System.Text;
using System.Globalization;
using System.ComponentModel;
using SharpReportCore;
@ -57,8 +58,15 @@ namespace SharpReportCore { @@ -57,8 +58,15 @@ namespace SharpReportCore {
if (value == null)
throw new ArgumentNullException("value");
if (value.ObjectArray.Length != base.ObjectArray.Length)
throw new InvalidOperationException("Differnet size of compare data");
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;
@ -90,8 +98,15 @@ namespace SharpReportCore { @@ -90,8 +98,15 @@ namespace SharpReportCore {
}
if (leftValue.GetType() != rightValue.GetType())
throw new InvalidOperationException("Compare of different types is not supported");
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))
{
@ -168,8 +183,8 @@ namespace SharpReportCore { @@ -168,8 +183,8 @@ namespace SharpReportCore {
#endregion
public override string ToString (){
return this.typeName;
}
// public override string ToString (){
// return this.typeName;
// }
}
}

12
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/Comparer/SortComparer.cs

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
using System;
using System.ComponentModel;
using System.Globalization;
using System.Reflection;
using SharpReportCore;
@ -60,9 +61,14 @@ namespace SharpReportCore { @@ -60,9 +61,14 @@ namespace SharpReportCore {
}
if (leftValue.GetType() != rightValue.GetType())
throw new InvalidOperationException("Compare of different types is not supported");
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,

12
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/DataManager.cs

@ -125,7 +125,7 @@ namespace SharpReportCore { @@ -125,7 +125,7 @@ namespace SharpReportCore {
void CheckReportSettings(ReportSettings settings) {
try {
if (settings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
if (settings.DataModel != GlobalEnums.PushPullModel.PushData) {
SqlQueryChecker.Check(settings.CommandType,settings.CommandText);
}
@ -280,11 +280,11 @@ namespace SharpReportCore { @@ -280,11 +280,11 @@ namespace SharpReportCore {
this.ListChanged (this,e);
}
}
/*
private void NotifyGroupChanging () {
// if (this.GroupChanging!= null) {
// this.GroupChanging (this,EventArgs.Empty);
// }
if (this.GroupChanging!= null) {
this.GroupChanging (this,EventArgs.Empty);
}
}
@ -296,9 +296,11 @@ namespace SharpReportCore { @@ -296,9 +296,11 @@ namespace SharpReportCore {
}
}
private void OnGroupChange (object sender,GroupChangedEventArgs e) {
this.NotifyGroupChanging();
}
*/
#endregion
public string DataMember {

4
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/BaseListStrategy.cs

@ -22,9 +22,9 @@ using System.ComponentModel; @@ -22,9 +22,9 @@ using System.ComponentModel;
namespace SharpReportCore {
public delegate BaseComparer IndexerDelegate(ColumnCollection col,int i,object[] values);
public delegate BaseComparer IndexerBuilderEventHandler(ColumnCollection col,int i,object[] values);
public abstract class BaseListStrategy :IDataViewStrategy,IEnumerator {
internal abstract class BaseListStrategy :IDataViewStrategy,IEnumerator {
private bool isSorted;
private bool isFiltered;
private bool isGrouped;

12
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/CollectionStrategy.cs

@ -18,7 +18,7 @@ using System.Globalization; @@ -18,7 +18,7 @@ using System.Globalization;
/// </summary>
namespace SharpReportCore {
public class CollectionStrategy : BaseListStrategy {
internal class CollectionStrategy : BaseListStrategy {
// Holds the plain Data
private Type itemType;
@ -139,7 +139,7 @@ namespace SharpReportCore { @@ -139,7 +139,7 @@ namespace SharpReportCore {
// if we have no sorting, we build the indexlist as well, so we don't need to
private SharpIndexCollection IndexBuilder(IndexerDelegate indexer,ColumnCollection col) {
private SharpIndexCollection IndexBuilder(IndexerBuilderEventHandler indexer,ColumnCollection col) {
SharpIndexCollection arrayList = new SharpIndexCollection();
for (int rowIndex = 0; rowIndex < this.baseList.Count; rowIndex++){
object[] values = new object[1];
@ -197,7 +197,7 @@ namespace SharpReportCore { @@ -197,7 +197,7 @@ namespace SharpReportCore {
base.IsSorted = true;
// BaseListStrategy.CheckSortArray (base.IndexList,"TableStrategy - CheckSortArray");
} else {
SharpReportCore.IndexerDelegate t = new SharpReportCore.IndexerDelegate(BaseListStrategy.PlainIndexBuilder);
SharpReportCore.IndexerBuilderEventHandler t = new SharpReportCore.IndexerBuilderEventHandler(BaseListStrategy.PlainIndexBuilder);
base.IndexList = this.IndexBuilder(t,base.ReportSettings.SortColumnCollection);
base.IsSorted = false;
}
@ -263,9 +263,6 @@ namespace SharpReportCore { @@ -263,9 +263,6 @@ namespace SharpReportCore {
GC.SuppressFinalize(this);
}
~CollectionStrategy(){
Dispose(false);
}
protected override void Dispose(bool disposing){
try {
@ -274,6 +271,9 @@ namespace SharpReportCore { @@ -274,6 +271,9 @@ namespace SharpReportCore {
this.baseList.Clear();
this.baseList = null;
}
if (this.listProperties != null) {
this.listProperties = null;
}
}
} finally {
base.Dispose(disposing);

14
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/TableStrategy.cs

@ -21,8 +21,8 @@ using System.Data; @@ -21,8 +21,8 @@ using System.Data;
///</remarks>
namespace SharpReportCore {
// public delegate void IndexerDelegate(int i,object[] values);
public class TableStrategy : BaseListStrategy,IEnumerable<BaseComparer> {
internal sealed class TableStrategy : BaseListStrategy,IEnumerable<BaseComparer> {
DataTable table;
DataView view = new DataView();
@ -54,7 +54,7 @@ namespace SharpReportCore { @@ -54,7 +54,7 @@ namespace SharpReportCore {
if (value != null && value != DBNull.Value){
if (!(value is IComparable)){
throw new InvalidOperationException("ReportDataSource:BuildSortArray - > This type doesn't support IComparable." + value.ToString());
throw new InvalidOperationException(value.ToString());
}
values[criteriaIndex] = value;
@ -74,7 +74,7 @@ namespace SharpReportCore { @@ -74,7 +74,7 @@ namespace SharpReportCore {
// if we have no sorting, we build the indexlist as well
private SharpIndexCollection IndexBuilder(IndexerDelegate indexer,ColumnCollection col) {
private SharpIndexCollection IndexBuilder(IndexerBuilderEventHandler indexer,ColumnCollection col) {
SharpIndexCollection arrayList = new SharpIndexCollection();
for (int rowIndex = 0; rowIndex < this.view.Count; rowIndex++){
object[] values = new object[1];
@ -203,7 +203,7 @@ namespace SharpReportCore { @@ -203,7 +203,7 @@ namespace SharpReportCore {
// base.IndexList = this.IndexBuilder(sort,base.ReportSettings.SortColumnCollection);
base.IsSorted = true;
} else {
SharpReportCore.IndexerDelegate unsort = new SharpReportCore.IndexerDelegate(BaseListStrategy.PlainIndexBuilder);
SharpReportCore.IndexerBuilderEventHandler unsort = new SharpReportCore.IndexerBuilderEventHandler(BaseListStrategy.PlainIndexBuilder);
base.IndexList = this.IndexBuilder(unsort,base.ReportSettings.SortColumnCollection);
base.IsSorted = false;
}
@ -286,10 +286,6 @@ namespace SharpReportCore { @@ -286,10 +286,6 @@ namespace SharpReportCore {
GC.SuppressFinalize(this);
}
~TableStrategy(){
Dispose(false);
}
protected override void Dispose(bool disposing){
try {
if (disposing) {

6
src/AddIns/Misc/SharpReport/SharpReportCore/Globals/GlobalEnums.cs

@ -34,7 +34,7 @@ namespace SharpReportCore { @@ -34,7 +34,7 @@ namespace SharpReportCore {
/// FormSheet : FormSheet report, just labels and images are allowed
/// </summary>
///
public enum PushPullModelEnum {
public enum PushPullModel {
PushData,
PullData,
FormSheet
@ -80,14 +80,14 @@ namespace SharpReportCore { @@ -80,14 +80,14 @@ namespace SharpReportCore {
///Names of the different collections like Sorting,grouping etc
/// </summary>
public enum enmParamCollectionName{
public enum ParamCollectionName{
AvailableColumns,
SqlParams,
Sortings,
Groupings
}
public enum ImageSourceEnum{
public enum ImageSource{
File,
// DataBase,
External

2
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs

@ -36,7 +36,7 @@ namespace SharpReportCore { @@ -36,7 +36,7 @@ namespace SharpReportCore {
public event EventHandler<SectionRenderEventArgs> Rendering;
public event EventHandler<SectionRenderEventArgs> SectionRendered;
public Page page;
private Page page;
protected AbstractRenderer(ReportModel model){
if (model == null) {

2
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs

@ -162,7 +162,7 @@ namespace SharpReportCore { @@ -162,7 +162,7 @@ namespace SharpReportCore {
PrintNoDataMessage(rpea.PrintPageEventArgs);
}
base.CurrentSection.SectionOffset = (int)this.page.DetailStart.Y + AbstractRenderer.Gap;
base.CurrentSection.SectionOffset = (int)base.Page.DetailStart.Y + AbstractRenderer.Gap;
}

2
src/AddIns/Misc/SharpReport/SharpReportCore/ReportModel.cs

@ -106,7 +106,7 @@ namespace SharpReportCore { @@ -106,7 +106,7 @@ namespace SharpReportCore {
// this Property is only a shortcut,,otherwise we have
// to use 'ReportModel.reportSettings.DataModel'
public GlobalEnums.PushPullModelEnum DataModel {
public GlobalEnums.PushPullModel DataModel {
get {
return reportSettings.DataModel;
}

26
src/AddIns/Misc/SharpReport/SharpReportCore/ReportSettings.cs

@ -49,7 +49,7 @@ namespace SharpReportCore{ @@ -49,7 +49,7 @@ namespace SharpReportCore{
private GlobalEnums.ReportType reportType;
private GlobalEnums.PushPullModelEnum dataModel;
private GlobalEnums.PushPullModel dataModel;
private SqlParametersCollection reportParametersCollection;
private ColumnCollection availableFields;
@ -82,7 +82,7 @@ namespace SharpReportCore{ @@ -82,7 +82,7 @@ namespace SharpReportCore{
groupingsCollection = new ColumnCollection();
reportParametersCollection = new SqlParametersCollection();
this.reportType = GlobalEnums.ReportType.FormSheet;
this.dataModel = GlobalEnums.PushPullModelEnum.FormSheet;
this.dataModel = GlobalEnums.PushPullModel.FormSheet;
}
@ -155,9 +155,9 @@ namespace SharpReportCore{ @@ -155,9 +155,9 @@ namespace SharpReportCore{
return;
}
switch ((GlobalEnums.enmParamCollectionName)GlobalEnums.StringToEnum(typeof(GlobalEnums.enmParamCollectionName),xmlCol.Name)) {
switch ((GlobalEnums.ParamCollectionName)GlobalEnums.StringToEnum(typeof(GlobalEnums.ParamCollectionName),xmlCol.Name)) {
case GlobalEnums.enmParamCollectionName.AvailableColumns: {
case GlobalEnums.ParamCollectionName.AvailableColumns: {
XmlNodeList nodeList = xmlCol.ChildNodes;
this.availableFields.Clear();
foreach (XmlNode node in nodeList) {
@ -171,7 +171,7 @@ namespace SharpReportCore{ @@ -171,7 +171,7 @@ namespace SharpReportCore{
break;
}
case GlobalEnums.enmParamCollectionName.Sortings:{
case GlobalEnums.ParamCollectionName.Sortings:{
XmlNodeList nodeList = xmlCol.ChildNodes;
this.sortingCollection.Clear();
@ -186,7 +186,7 @@ namespace SharpReportCore{ @@ -186,7 +186,7 @@ namespace SharpReportCore{
break;
}
case GlobalEnums.enmParamCollectionName.Groupings:{
case GlobalEnums.ParamCollectionName.Groupings:{
XmlNodeList nodeList = xmlCol.ChildNodes;
this.groupingsCollection.Clear();
foreach (XmlNode node in nodeList) {
@ -200,7 +200,7 @@ namespace SharpReportCore{ @@ -200,7 +200,7 @@ namespace SharpReportCore{
break;
}
case GlobalEnums.enmParamCollectionName.SqlParams:{
case GlobalEnums.ParamCollectionName.SqlParams:{
XmlNodeList nodeList = xmlCol.ChildNodes;
this.reportParametersCollection.Clear();
foreach( XmlNode node in nodeList) {
@ -415,24 +415,24 @@ namespace SharpReportCore{ @@ -415,24 +415,24 @@ namespace SharpReportCore{
XmlElement section = doc.CreateElement ("section");
if (this.availableFields.Count > 0) {
XmlElement xmlAvailableFields = doc.CreateElement(GlobalEnums.enmParamCollectionName.AvailableColumns.ToString());
XmlElement xmlAvailableFields = doc.CreateElement(GlobalEnums.ParamCollectionName.AvailableColumns.ToString());
AvailableFieldsToXml (xmlAvailableFields);
section.AppendChild(xmlAvailableFields);
}
if (this.sortingCollection.Count > 0) {
XmlElement xmlSortColumns = doc.CreateElement (GlobalEnums.enmParamCollectionName.Sortings.ToString());
XmlElement xmlSortColumns = doc.CreateElement (GlobalEnums.ParamCollectionName.Sortings.ToString());
SortColumnsToXml (xmlSortColumns);
section.AppendChild(xmlSortColumns);
}
if (this.groupingsCollection.Count > 0){
XmlElement xmlGroupColumns = doc.CreateElement (GlobalEnums.enmParamCollectionName.Groupings.ToString());
XmlElement xmlGroupColumns = doc.CreateElement (GlobalEnums.ParamCollectionName.Groupings.ToString());
GroupColumnsToXml(xmlGroupColumns);
section.AppendChild(xmlGroupColumns);
}
if (reportParametersCollection.Count > 0) {
XmlElement xmlSqlParams = doc.CreateElement (GlobalEnums.enmParamCollectionName.SqlParams.ToString());
XmlElement xmlSqlParams = doc.CreateElement (GlobalEnums.ParamCollectionName.SqlParams.ToString());
SqlParamsToXml(xmlSqlParams);
section.AppendChild(xmlSqlParams);
}
@ -633,7 +633,7 @@ namespace SharpReportCore{ @@ -633,7 +633,7 @@ namespace SharpReportCore{
[Category("Data")]
public GlobalEnums.PushPullModelEnum DataModel {
public GlobalEnums.PushPullModel DataModel {
get {
return dataModel;
}
@ -641,7 +641,7 @@ namespace SharpReportCore{ @@ -641,7 +641,7 @@ namespace SharpReportCore{
if (dataModel != value) {
dataModel = value;
if (this.dataModel != GlobalEnums.PushPullModelEnum.FormSheet) {
if (this.dataModel != GlobalEnums.PushPullModel.FormSheet) {
this.reportType = GlobalEnums.ReportType.DataReport;
} else {
this.reportType = GlobalEnums.ReportType.FormSheet;

6
src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs

@ -110,7 +110,7 @@ namespace SharpReportCore { @@ -110,7 +110,7 @@ namespace SharpReportCore {
private static ReportModel ValidatePushModel (string fileName) {
ReportModel model = ModelFromFile (fileName);
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModel.PushData) {
throw new SharpReportException ("PrintPushdataReport: No valid ReportModel");
}
return model;
@ -213,7 +213,7 @@ namespace SharpReportCore { @@ -213,7 +213,7 @@ namespace SharpReportCore {
if (model.ReportSettings.ReportType != GlobalEnums.ReportType.DataReport) {
throw new ArgumentException("SetupPushDataRenderer <No valid ReportModel>");
}
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModel.PushData) {
throw new ArgumentException("SetupPushDataRenderer <No valid ReportType>");
}
@ -243,7 +243,7 @@ namespace SharpReportCore { @@ -243,7 +243,7 @@ namespace SharpReportCore {
if (model.ReportSettings.ReportType != GlobalEnums.ReportType.DataReport) {
throw new ArgumentException("SetupPushDataRenderer <No valid ReportModel>");
}
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModel.PushData) {
throw new ArgumentException("SetupPushDataRenderer <No valid ReportType>");
}

6
src/AddIns/Misc/SharpReport/SharpReportCore/Visitors/LoadModelVisitor.cs

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
using System;
using System.Globalization;
using System.Xml;
using System.Windows.Forms;
@ -70,7 +71,10 @@ namespace SharpReportCore { @@ -70,7 +71,10 @@ namespace SharpReportCore {
SetReportItems(baseSection,null,ctrlList);
}else {
throw new System.Xml.XmlException ("Report : SetSection Wrong Node in Report");
string s = String.Format(CultureInfo.CurrentCulture,
"{0} {1}",
this.GetType().ToString());
throw new SharpReportException(s);
}
}
}

8
src/AddIns/Misc/SharpReport/SharpReportWizard/GeneratorCommands.cs

@ -61,20 +61,20 @@ namespace ReportGenerator{ @@ -61,20 +61,20 @@ namespace ReportGenerator{
}
void DoCreate (ReportModel model) {
GlobalEnums.PushPullModelEnum dataModel;
GlobalEnums.PushPullModel dataModel;
dataModel = model.DataModel;
switch (dataModel) {
case GlobalEnums.PushPullModelEnum.PullData:
case GlobalEnums.PushPullModel.PullData:
customizer.Set("DataRow",GlobalEnums.ReportItemType.ReportRowItem);
GeneratePullDataReport generatePullDataReport = new GeneratePullDataReport(customizer,model);
generatePullDataReport.GenerateReport();
break;
case GlobalEnums.PushPullModelEnum.PushData:
case GlobalEnums.PushPullModel.PushData:
customizer.Set("DataRow",GlobalEnums.ReportItemType.ReportRowItem);
GeneratePushDataReport generatePushDataReport = new GeneratePushDataReport(customizer,model);
generatePushDataReport.GenerateReport();
break;
case GlobalEnums.PushPullModelEnum.FormSheet:
case GlobalEnums.PushPullModel.FormSheet:
GenerateFormSheetReport generateFormSheetReport = new GenerateFormSheetReport (customizer,model);
generateFormSheetReport.GenerateReport();
break;

4
src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GenerateFormSheetReport.cs

@ -28,7 +28,7 @@ namespace ReportGenerator @@ -28,7 +28,7 @@ namespace ReportGenerator
if (reportModel == null) {
throw new ArgumentException("reportModel");
}
if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.FormSheet) {
if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModel.FormSheet) {
throw new ArgumentException ("Wrong DataModel in GeneratePullDataReport");
}
base.ReportItemCollection.Clear();
@ -36,7 +36,7 @@ namespace ReportGenerator @@ -36,7 +36,7 @@ namespace ReportGenerator
public override void GenerateReport() {
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.FormSheet;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModelEnum.FormSheet;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModel.FormSheet;
base.GenerateReport();
base.AdjustAllNames();
}

4
src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GeneratePullDataReport.cs

@ -36,7 +36,7 @@ namespace ReportGenerator { @@ -36,7 +36,7 @@ namespace ReportGenerator {
throw new ArgumentException("reportModel");
}
if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PullData) {
if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModel.PullData) {
throw new ArgumentException ("Wrong DataModel in GeneratePullDataReport");
}
base.ReportItemCollection.Clear();
@ -47,7 +47,7 @@ namespace ReportGenerator { @@ -47,7 +47,7 @@ namespace ReportGenerator {
public override void GenerateReport() {
try {
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.DataReport;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModelEnum.PullData;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModel.PullData;
this.ReportModel.ReportSettings.AvailableFieldsCollection =
(ColumnCollection)base.Customizer.Get ("ColumnCollection");;

4
src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GeneratePushDataReport.cs

@ -38,7 +38,7 @@ namespace ReportGenerator { @@ -38,7 +38,7 @@ namespace ReportGenerator {
if (reportModel == null) {
throw new ArgumentException("reportModel");
}
if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
if (base.ReportModel.ReportSettings.DataModel != GlobalEnums.PushPullModel.PushData) {
throw new ArgumentException ("Wrong DataModel in GeneratePushReport");
}
//we can't use the customizer here
@ -49,7 +49,7 @@ namespace ReportGenerator { @@ -49,7 +49,7 @@ namespace ReportGenerator {
public override void GenerateReport() {
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.DataReport;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModelEnum.PushData;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModel.PushData;
base.ReportModel.ReportSettings.AvailableFieldsCollection = base.ReportGenerator.ColumnCollection;

4
src/AddIns/Misc/SharpReport/SharpReportWizard/ReportGenerator.cs

@ -37,7 +37,7 @@ namespace ReportGenerator { @@ -37,7 +37,7 @@ namespace ReportGenerator {
private GraphicsUnit graphicsUnit;
//Database
private GlobalEnums.PushPullModelEnum dataModel;
private GlobalEnums.PushPullModel dataModel;
private string connectionString;
private string catalogName;
@ -154,7 +154,7 @@ namespace ReportGenerator { @@ -154,7 +154,7 @@ namespace ReportGenerator {
}
}
public SharpReportCore.GlobalEnums.PushPullModelEnum DataModel {
public SharpReportCore.GlobalEnums.PushPullModel DataModel {
get {
return dataModel;
}

6
src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/BaseSettingsPanel.cs

@ -149,14 +149,14 @@ namespace ReportGenerator{ @@ -149,14 +149,14 @@ namespace ReportGenerator{
if (initDone) {
if (this.radioPullModell.Checked == true) {
base.NextWizardPanelID = "PullModel";
generator.DataModel = GlobalEnums.PushPullModelEnum.PullData;
generator.DataModel = GlobalEnums.PushPullModel.PullData;
GoOn();
} else if (this.radioPushModell.Checked == true){
base.NextWizardPanelID = "PushModel";
generator.DataModel = GlobalEnums.PushPullModelEnum.PushData;
generator.DataModel = GlobalEnums.PushPullModel.PushData;
GoOn();
} else if (this.radioFormSheet.Checked == true){
generator.DataModel = GlobalEnums.PushPullModelEnum.FormSheet;
generator.DataModel = GlobalEnums.PushPullModel.FormSheet;
base.EnableNext = false;
base.IsLastPanel = true;
}

13
src/AddIns/Misc/SharpReport/SharpReportWizard/WizardPanels/ResultPanel.cs

@ -8,25 +8,20 @@ @@ -8,25 +8,20 @@
*/
using System;
using System.Globalization;
using System.Data;
using System.Data.OleDb;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Windows.Forms;
using System.Xml;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using SharpQuery.Collections;
using SharpQuery.SchemaClass;
using SharpReport;
using SharpReportCore;
using ICSharpCode.SharpDevelop.Gui;
using SharpQuery.SchemaClass;
using SharpQuery.Connection;
using SharpQuery.Gui.DataView;
using SharpQuery.Collections;
namespace ReportGenerator{
/// <summary>

Loading…
Cancel
Save