Browse Source

Fixes from FxCop

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1716 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 19 years ago
parent
commit
bcf02e8ade
  1. 2
      src/AddIns/Misc/SharpReport/SharpReport/SharpReportManager.cs
  2. 9
      src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs
  3. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/ListStrategy/BaseListStrategy.cs
  4. 8
      src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs
  5. 22
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/IllegalFileFormat.cs
  6. 16
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/IllegalQueryException.cs
  7. 12
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/MissingDataSourceException.cs
  8. 11
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/MissingModelException.cs
  9. 15
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportException.cs
  10. 11
      src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportWrongItemException.cs
  11. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/Factories/RendererFactory.cs
  12. 7
      src/AddIns/Misc/SharpReport/SharpReportCore/Globals/GlobalEnums.cs
  13. 8
      src/AddIns/Misc/SharpReport/SharpReportCore/Globals/GlobalValues.cs
  14. 5
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
  15. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderFormSheetReport.cs
  16. 6
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/ReportDocument.cs
  17. 27
      src/AddIns/Misc/SharpReport/SharpReportCore/ReportSettings.cs
  18. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportEngine.cs
  19. 22
      src/AddIns/Misc/SharpReport/SharpReportCore/Xml/XmlFormReader.cs
  20. 2
      src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GenerateFormSheetReport.cs
  21. 2
      src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GeneratePullDataReport.cs
  22. 2
      src/AddIns/Misc/SharpReport/SharpReportWizard/Generators/GeneratePushDataReport.cs
  23. 4
      src/AddIns/Misc/SharpReport/SharpReportWizard/ReportGenerator.cs

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

@ -49,7 +49,7 @@ namespace SharpReport{ @@ -49,7 +49,7 @@ namespace SharpReport{
#region privates
private ConnectionObject BuildConnectionObject (ReportSettings settings) {
if (settings.ReportType == GlobalEnums.ReportTypeEnum.DataReport) {
if (settings.ReportType == GlobalEnums.ReportType.DataReport) {
try {
if (settings.ConnectionString.Length > 0) {
return new ConnectionObject(settings.ConnectionString);

9
src/AddIns/Misc/SharpReport/SharpReportCore/Collections/Collections.cs

@ -72,6 +72,9 @@ namespace SharpReportCore{ @@ -72,6 +72,9 @@ namespace SharpReportCore{
}
public IItemRenderer Find (string itemName) {
if (String.IsNullOrEmpty(itemName)) {
throw new ArgumentNullException("itemName");
}
for (int i = 0;i < this.Count ; i ++) {
IItemRenderer col = this[i];
if (String.Compare(col.Name.ToLower(CultureInfo.CurrentCulture),
@ -143,6 +146,9 @@ namespace SharpReportCore{ @@ -143,6 +146,9 @@ namespace SharpReportCore{
public event EventHandler<CollectionItemEventArgs<BaseDataItem>> Removed;
public BaseDataItem Find (string columnName) {
if (String.IsNullOrEmpty(columnName)) {
throw new ArgumentNullException("columnName");
}
for (int i = 0;i < this.Count ; i ++) {
BaseDataItem col = this[i];
if (String.Compare(col.Name.ToLower(CultureInfo.CurrentCulture),
@ -189,6 +195,9 @@ namespace SharpReportCore{ @@ -189,6 +195,9 @@ namespace SharpReportCore{
public AbstractColumn Find (string columnName) {
if (String.IsNullOrEmpty(columnName)){
throw new ArgumentNullException("columnName");
}
for (int i = 0;i < this.Count ; i ++) {
AbstractColumn col = (AbstractColumn)this[i];
if (String.Compare(col.ColumnName.ToLower(CultureInfo.CurrentCulture),

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

@ -82,7 +82,7 @@ namespace SharpReportCore { @@ -82,7 +82,7 @@ namespace SharpReportCore {
#region Building Groups
private static void WriteToIndexFile (SharpIndexCollection destination,BaseComparer comparer) {
SortComparer sc = comparer as SortComparer;
// SortComparer sc = comparer as SortComparer;
// if (sc != null) {
// System.Console.WriteLine("\t {0} - <{1}>",comparer.ListIndex, comparer.ObjectArray[0].ToString());
// } else {

8
src/AddIns/Misc/SharpReport/SharpReportCore/DataManager/SqlQueryChecker.cs

@ -21,12 +21,12 @@ namespace SharpReportCore{ @@ -21,12 +21,12 @@ namespace SharpReportCore{
private SqlQueryChecker () {
}
public static void Check (CommandType commandType,string queryString) {
public static void Check (CommandType commandType,string commandText) {
if (commandType == CommandType.Text) {
if (!String.IsNullOrEmpty(queryString)) {
queryString = queryString.ToUpper(CultureInfo.CurrentCulture);
if (!String.IsNullOrEmpty(commandText)) {
commandText = commandText.ToUpper(CultureInfo.CurrentCulture);
if (!queryString.StartsWith("SELECT")) {
if (!commandText.StartsWith("SELECT")) {
throw new SharpReportCore.IllegalQueryException();
}
}

22
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/IllegalFileFormat.cs

@ -10,7 +10,8 @@ @@ -10,7 +10,8 @@
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
/// <summary>
/// This exception is throw'n when something is wrong with the File Format
/// </summary>
@ -21,11 +22,11 @@ using System.Runtime.Serialization; @@ -21,11 +22,11 @@ using System.Runtime.Serialization;
namespace SharpReportCore {
[Serializable()]
public class IllegalFileFormatException : System.Exception {
static string errMess = "<aus code> Could not read file , file corrupt (SharpReportFile is improperly formatted)";
static string errorMessage = "<aus code> Could not read file , file corrupt (SharpReportFile is improperly formatted)";
private string localisedMessage = String.Empty;
public IllegalFileFormatException():base (errMess){
public IllegalFileFormatException():base (errorMessage){
}
public IllegalFileFormatException(string errorMessage,
@ -51,10 +52,21 @@ namespace SharpReportCore { @@ -51,10 +52,21 @@ namespace SharpReportCore {
}
public string ErrorMessage {
public static string ErrorMessage {
get {
return errMess;
return errorMessage;
}
}
[SecurityPermissionAttribute(SecurityAction.Demand,
SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context){
if (info == null) {
throw new ArgumentNullException("info");
}
info.AddValue("errorMessage", IllegalFileFormatException.errorMessage);
info.AddValue("localisedMessage", this.localisedMessage);
base.GetObjectData(info, context);
}
}
}

16
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/IllegalQueryException.cs

@ -9,12 +9,16 @@ @@ -9,12 +9,16 @@
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace SharpReportCore
{
/// <summary>
/// IllegalQueryException is thrown when a QueryString contains other statements as
/// Select. So it should not happen do alter a Database while doing a Query with SharpReport
/// </summary>
[SerializableAttribute]
public class IllegalQueryException: System.Exception{
private const string message = "Query should start with 'Select'";
@ -45,6 +49,16 @@ namespace SharpReportCore @@ -45,6 +49,16 @@ namespace SharpReportCore
}
}
}
[SecurityPermissionAttribute(SecurityAction.Demand,
SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context){
if (info == null) {
throw new ArgumentNullException("info");
}
info.AddValue("errorMessage", this.ErrorMessage);
base.GetObjectData(info, context);
}
}
}

12
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/MissingDataSourceException.cs

@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
/// <summary>
/// Throwen when no valid SharpReportCore is available or when SharpReportCore == null
/// </summary>
@ -48,5 +50,15 @@ namespace SharpReportCore { @@ -48,5 +50,15 @@ namespace SharpReportCore {
}
}
[SecurityPermissionAttribute(SecurityAction.Demand,
SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context){
if (info == null) {
throw new ArgumentNullException("info");
}
info.AddValue("errorMessage", this.errorMessage);
base.GetObjectData(info, context);
}
}
}

11
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/MissingModelException.cs

@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
/// <summary>
/// Description of MissingModelException.
/// </summary>
@ -33,5 +35,14 @@ namespace SharpReportCore{ @@ -33,5 +35,14 @@ namespace SharpReportCore{
StreamingContext context) : base(info, context){
// Implement type-specific serialization constructor logic.
}
[SecurityPermissionAttribute(SecurityAction.Demand,
SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
}
}

15
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportException.cs

@ -11,7 +11,8 @@ @@ -11,7 +11,8 @@
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
/// <summary>
/// This Class throws the Standart SharpReport Error
/// </summary>
@ -47,6 +48,18 @@ namespace SharpReportCore { @@ -47,6 +48,18 @@ namespace SharpReportCore {
return errorMessage;
}
}
[SecurityPermissionAttribute(SecurityAction.Demand,
SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context){
if (info == null) {
throw new ArgumentNullException("info");
}
info.AddValue("errorMessage", this.errorMessage);
base.GetObjectData(info, context);
}
}
}

11
src/AddIns/Misc/SharpReport/SharpReportCore/Exceptions/SharpReportWrongItemException.cs

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
//------------------------------------------------------------------------------
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
/// <summary>
/// This Exception is throw if an unknown Items should be created
@ -47,5 +48,15 @@ namespace SharpReportCore { @@ -47,5 +48,15 @@ namespace SharpReportCore {
}
}
[SecurityPermissionAttribute(SecurityAction.Demand,
SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context){
if (info == null) {
throw new ArgumentNullException("info");
}
info.AddValue("errorMessage", this.errorMessage);
base.GetObjectData(info, context);
}
}
}

4
src/AddIns/Misc/SharpReport/SharpReportCore/Factories/RendererFactory.cs

@ -34,10 +34,10 @@ namespace SharpReportCore { @@ -34,10 +34,10 @@ namespace SharpReportCore {
public AbstractRenderer Create(ReportModel model,DataManager container) {
if (model != null) {
switch (model.ReportSettings.ReportType) {
case GlobalEnums.ReportTypeEnum.FormSheet :{
case GlobalEnums.ReportType.FormSheet :{
return new RenderFormSheetReport(model);
}
case GlobalEnums.ReportTypeEnum.DataReport:{
case GlobalEnums.ReportType.DataReport:{
return new RenderDataReport(model,container);
}
}

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

@ -23,8 +23,11 @@ using System.Windows.Forms; @@ -23,8 +23,11 @@ using System.Windows.Forms;
/// </remarks>
///
namespace SharpReportCore {
public class GlobalEnums : object {
public sealed class GlobalEnums : object {
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
@ -56,7 +59,7 @@ namespace SharpReportCore { @@ -56,7 +59,7 @@ namespace SharpReportCore {
/// FormSheet means a blank form with Labels, Lines and Checkboxes
/// DataReport handles all Reports with Data
/// </summary>
public enum ReportTypeEnum {
public enum ReportType {
FormSheet,
DataReport,
}

8
src/AddIns/Misc/SharpReport/SharpReportCore/Globals/GlobalValues.cs

@ -26,7 +26,7 @@ using System.ServiceProcess; @@ -26,7 +26,7 @@ using System.ServiceProcess;
/// </remarks>
namespace SharpReportCore {
public class GlobalValues : object {
public sealed class GlobalValues : object {
private static string sharpReportString = "SharpReport";
private static string sharpReportExtension = ".srd";
@ -36,6 +36,12 @@ namespace SharpReportCore { @@ -36,6 +36,12 @@ namespace SharpReportCore {
private const string tableName = "Table";
private const int enlargeControl = 5;
private GlobalValues() {
}
#region some usefull functions and methodes

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

@ -174,7 +174,10 @@ namespace SharpReportCore { @@ -174,7 +174,10 @@ namespace SharpReportCore {
}
protected void PrintNoDataMessage(PrintPageEventArgs e){
e.Graphics.DrawString(this.reportSettings.NoDataMessage,
if (e == null) {
throw new ArgumentNullException("e");
}
e.Graphics.DrawString(this.reportSettings.NoDataMessage,
this.ReportSettings.DefaultFont,
new SolidBrush(Color.Black),
page.DetailArea);

4
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderFormSheetReport.cs

@ -34,7 +34,6 @@ using System.Drawing.Printing; @@ -34,7 +34,6 @@ using System.Drawing.Printing;
namespace SharpReportCore {
public class RenderFormSheetReport : AbstractRenderer {
private PointF currentPoint = new PointF (0,0);
#region Constructor
@ -71,9 +70,6 @@ namespace SharpReportCore { @@ -71,9 +70,6 @@ namespace SharpReportCore {
/// <param name="e"></param>
protected override void BodyStart (object sender,ReportPageEventArgs rpea) {
base.BodyStart (sender,rpea);
this.currentPoint = new PointF (base.CurrentSection.Location.X,
base.page.DetailStart.Y);
}
protected override void PrintDetail(object sender, ReportPageEventArgs rpea){

6
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/ReportDocument.cs

@ -142,12 +142,18 @@ namespace SharpReportCore { @@ -142,12 +142,18 @@ namespace SharpReportCore {
}
public bool DetailsDone {
get {
return this.detailsDone;
}
set {
detailsDone = value;
}
}
public bool ReportHasData {
get {
return this.reportHasData;
}
set {
reportHasData = value;
this.detailsDone = true;

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

@ -48,7 +48,7 @@ namespace SharpReportCore{ @@ -48,7 +48,7 @@ namespace SharpReportCore{
GraphicsUnit.Point);
private GlobalEnums.ReportTypeEnum reportType;
private GlobalEnums.ReportType reportType;
private GlobalEnums.PushPullModelEnum dataModel;
private SqlParametersCollection reportParametersCollection;
@ -81,7 +81,7 @@ namespace SharpReportCore{ @@ -81,7 +81,7 @@ namespace SharpReportCore{
sortingCollection = new ColumnCollection();
groupingsCollection = new ColumnCollection();
reportParametersCollection = new SqlParametersCollection();
this.reportType = GlobalEnums.ReportTypeEnum.FormSheet;
this.reportType = GlobalEnums.ReportType.FormSheet;
this.dataModel = GlobalEnums.PushPullModelEnum.FormSheet;
}
@ -93,7 +93,7 @@ namespace SharpReportCore{ @@ -93,7 +93,7 @@ namespace SharpReportCore{
/// <param name="reader">See XMLFormReader</param>
/// <param name="item">AbstractColumn</param>
/// <param name="ctrlElem">Element witch contains the values</param>
private void BuildAbstractColumn (XmlFormReader reader,
private static void BuildAbstractColumn (XmlFormReader reader,
XmlElement ctrlElem,
AbstractColumn item) {
@ -164,7 +164,7 @@ namespace SharpReportCore{ @@ -164,7 +164,7 @@ namespace SharpReportCore{
XmlElement elem = node as XmlElement;
if (elem != null) {
AbstractColumn abstr = new AbstractColumn();
BuildAbstractColumn (xmlReader,elem,abstr);
ReportSettings.BuildAbstractColumn (xmlReader,elem,abstr);
this.availableFields.Add(abstr);
}
}
@ -179,7 +179,7 @@ namespace SharpReportCore{ @@ -179,7 +179,7 @@ namespace SharpReportCore{
XmlElement elem = node as XmlElement;
if (elem != null) {
SortColumn sc = new SortColumn();
BuildAbstractColumn (xmlReader,elem,sc);
ReportSettings.BuildAbstractColumn (xmlReader,elem,sc);
sortingCollection.Add(sc);
}
}
@ -193,7 +193,7 @@ namespace SharpReportCore{ @@ -193,7 +193,7 @@ namespace SharpReportCore{
XmlElement elem = node as XmlElement;
if (elem != null) {
GroupColumn gc = new GroupColumn();
BuildAbstractColumn (xmlReader,elem,gc);
ReportSettings.BuildAbstractColumn (xmlReader,elem,gc);
groupingsCollection.Add(gc);
}
}
@ -315,7 +315,8 @@ namespace SharpReportCore{ @@ -315,7 +315,8 @@ namespace SharpReportCore{
}
else {
attPropValue = section.OwnerDocument.CreateAttribute ("value");
attPropValue.InnerText = Convert.ToString(prop.GetValue(this,null));
attPropValue.InnerText = Convert.ToString(prop.GetValue(this,null),
CultureInfo.InvariantCulture);
xmlProperty.Attributes.Append(attPropValue);
}
@ -330,7 +331,8 @@ namespace SharpReportCore{ @@ -330,7 +331,8 @@ namespace SharpReportCore{
if (p.CanWrite) {
xmlProperty = xmlSaveTo.OwnerDocument.CreateElement (p.Name);
attPropValue = xmlSaveTo.OwnerDocument.CreateAttribute ("value");
attPropValue.InnerText = Convert.ToString(p.GetValue(column,null));
attPropValue.InnerText = Convert.ToString(p.GetValue(column,null),
CultureInfo.InvariantCulture);
xmlProperty.Attributes.Append(attPropValue);
xmlSaveTo.AppendChild(xmlProperty);
}
@ -349,7 +351,8 @@ namespace SharpReportCore{ @@ -349,7 +351,8 @@ namespace SharpReportCore{
if (p.CanWrite) {
xmlProperty = xmlParam.OwnerDocument.CreateElement(p.Name);
attPropValue = xmlParam.OwnerDocument.CreateAttribute ("value");
attPropValue.InnerText = Convert.ToString(p.GetValue(rPar,null));
attPropValue.InnerText = Convert.ToString(p.GetValue(rPar,null),
CultureInfo.InvariantCulture);
xmlProperty.Attributes.Append(attPropValue);
xmlElem.AppendChild(xmlProperty);
}
@ -512,7 +515,7 @@ namespace SharpReportCore{ @@ -512,7 +515,7 @@ namespace SharpReportCore{
[Browsable(true), Category("Base Settings")]
public GlobalEnums.ReportTypeEnum ReportType {
public GlobalEnums.ReportType ReportType {
get {
return reportType;
}
@ -639,9 +642,9 @@ namespace SharpReportCore{ @@ -639,9 +642,9 @@ namespace SharpReportCore{
dataModel = value;
if (this.dataModel != GlobalEnums.PushPullModelEnum.FormSheet) {
this.reportType = GlobalEnums.ReportTypeEnum.DataReport;
this.reportType = GlobalEnums.ReportType.DataReport;
} else {
this.reportType = GlobalEnums.ReportTypeEnum.FormSheet;
this.reportType = GlobalEnums.ReportType.FormSheet;
}
this.NotifyPropertyChanged("DataModel");
}

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

@ -62,7 +62,7 @@ namespace SharpReportCore { @@ -62,7 +62,7 @@ namespace SharpReportCore {
#region ParameterHandling
private void UpdateSqlParameters (ReportModel model,
private static void UpdateSqlParameters (ReportModel model,
SqlParametersCollection sqlParameters) {
if (sqlParameters != null) {
foreach (SqlParameter sourcePar in sqlParameters) {
@ -107,7 +107,7 @@ namespace SharpReportCore { @@ -107,7 +107,7 @@ namespace SharpReportCore {
#region Setup for print/preview
private ReportModel ValidatePushModel (string fileName) {
private static ReportModel ValidatePushModel (string fileName) {
ReportModel model = ModelFromFile (fileName);
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
@ -117,7 +117,7 @@ namespace SharpReportCore { @@ -117,7 +117,7 @@ namespace SharpReportCore {
}
private void InitDataContainer (ReportSettings settings) {
if (settings.ReportType == GlobalEnums.ReportTypeEnum.DataReport) {
if (settings.ReportType == GlobalEnums.ReportType.DataReport) {
if (settings.CommandText != null) {
try {
GrapSqlParameters (settings);
@ -165,11 +165,11 @@ namespace SharpReportCore { @@ -165,11 +165,11 @@ namespace SharpReportCore {
try {
switch (model.ReportSettings.ReportType) {
//FormSheets reports
case GlobalEnums.ReportTypeEnum.FormSheet:
case GlobalEnums.ReportType.FormSheet:
abstr = new RendererFactory().Create (model,null);
break;
//Databased reports
case GlobalEnums.ReportTypeEnum.DataReport :
case GlobalEnums.ReportType.DataReport :
InitDataContainer (model.ReportSettings);
if (this.dataManager != null) {
if (this.dataManager.DataSource != null) {
@ -210,7 +210,7 @@ namespace SharpReportCore { @@ -210,7 +210,7 @@ namespace SharpReportCore {
if (model == null) {
throw new ArgumentNullException("model");
}
if (model.ReportSettings.ReportType != GlobalEnums.ReportTypeEnum.DataReport) {
if (model.ReportSettings.ReportType != GlobalEnums.ReportType.DataReport) {
throw new ArgumentException("SetupPushDataRenderer <No valid ReportModel>");
}
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
@ -240,7 +240,7 @@ namespace SharpReportCore { @@ -240,7 +240,7 @@ namespace SharpReportCore {
if (model == null) {
throw new ArgumentNullException("model");
}
if (model.ReportSettings.ReportType != GlobalEnums.ReportTypeEnum.DataReport) {
if (model.ReportSettings.ReportType != GlobalEnums.ReportType.DataReport) {
throw new ArgumentException("SetupPushDataRenderer <No valid ReportModel>");
}
if (model.ReportSettings.DataModel != GlobalEnums.PushPullModelEnum.PushData) {
@ -393,7 +393,7 @@ namespace SharpReportCore { @@ -393,7 +393,7 @@ namespace SharpReportCore {
AbstractRenderer renderer = null;
try {
ReportModel model = this.ValidatePushModel(fileName);
ReportModel model = SharpReportEngine.ValidatePushModel(fileName);
renderer = this.SetupPushDataRenderer (model,list);
@ -487,7 +487,7 @@ namespace SharpReportCore { @@ -487,7 +487,7 @@ namespace SharpReportCore {
AbstractRenderer renderer = null;
try {
ReportModel model = this.ValidatePushModel(fileName);
ReportModel model = SharpReportEngine.ValidatePushModel(fileName);
renderer = SetupPushDataRenderer (model,dataTable);
SharpReportEngine.ReportToPrinter(renderer,model);

22
src/AddIns/Misc/SharpReport/SharpReportCore/Xml/XmlFormReader.cs

@ -161,10 +161,10 @@ namespace SharpReportCore { @@ -161,10 +161,10 @@ namespace SharpReportCore {
/// Sets a property called propertyName in object <code>o</code> to <code>val</code>. This method performs
/// all neccessary casts.
/// </summary>
public void SetValue(object o, string propertyName, string value)
public void SetValue(object obj, string propertyName, string value)
{
try {
PropertyInfo propertyInfo = o.GetType().GetProperty(propertyName);
PropertyInfo propertyInfo = obj.GetType().GetProperty(propertyName);
if (value.StartsWith("{") && value.EndsWith("}")) {
value = value.Substring(1, value.Length - 2);
@ -172,10 +172,10 @@ namespace SharpReportCore { @@ -172,10 +172,10 @@ namespace SharpReportCore {
if (propertyInfo.CanWrite) {
Type type = propertyInfo.GetType();
propertyObject = propertyInfo.GetValue(o, null);
propertyObject = propertyInfo.GetValue(obj, null);
}
else {
propertyObject = propertyInfo.GetValue(o, null);
propertyObject = propertyInfo.GetValue(obj, null);
}
Match match = propertySet.Match(value);
while (true) {
@ -187,33 +187,33 @@ namespace SharpReportCore { @@ -187,33 +187,33 @@ namespace SharpReportCore {
}
if (propertyInfo.CanWrite) {
propertyInfo.SetValue(o, propertyObject, null);
propertyInfo.SetValue(obj, propertyObject, null);
}
} else if (propertyInfo.PropertyType.IsEnum) {
propertyInfo.SetValue(o, Enum.Parse(propertyInfo.PropertyType, value), null);
propertyInfo.SetValue(obj, Enum.Parse(propertyInfo.PropertyType, value), null);
} else if (propertyInfo.PropertyType == typeof(Color)) {
string color = value.Substring(value.IndexOf('[') + 1).Replace("]", "");
string[] argb = color.Split(',', '=');
if (argb.Length > 1) {
CultureInfo ci = CultureInfo.CurrentCulture;
propertyInfo.SetValue(o, Color.FromArgb(Int32.Parse(argb[1],ci), Int32.Parse(argb[3],ci), Int32.Parse(argb[5],ci), Int32.Parse(argb[7],ci)), null);
propertyInfo.SetValue(obj, Color.FromArgb(Int32.Parse(argb[1],ci), Int32.Parse(argb[3],ci), Int32.Parse(argb[5],ci), Int32.Parse(argb[7],ci)), null);
} else {
propertyInfo.SetValue(o, Color.FromName(color), null);
propertyInfo.SetValue(obj, Color.FromName(color), null);
}
} else if (propertyInfo.PropertyType == typeof(Font)) {
Font fnt = XmlFormReader.MakeFont(value);
if (fnt != null) {
propertyInfo.SetValue(o,fnt,null);
propertyInfo.SetValue(obj,fnt,null);
} else {
propertyInfo.SetValue(o, SystemInformation.MenuFont, null);
propertyInfo.SetValue(obj, SystemInformation.MenuFont, null);
}
}
else {
if (value.Length > 0) {
if (propertyInfo.CanWrite) {
propertyInfo.SetValue(o,
propertyInfo.SetValue(obj,
Convert.ChangeType(value,
propertyInfo.PropertyType,
CultureInfo.CurrentCulture),

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

@ -35,7 +35,7 @@ namespace ReportGenerator @@ -35,7 +35,7 @@ namespace ReportGenerator
}
public override void GenerateReport() {
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportTypeEnum.FormSheet;
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.FormSheet;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModelEnum.FormSheet;
base.GenerateReport();
base.AdjustAllNames();

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

@ -46,7 +46,7 @@ namespace ReportGenerator { @@ -46,7 +46,7 @@ namespace ReportGenerator {
#region ReportGenerator.IReportGenerator interface implementation
public override void GenerateReport() {
try {
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportTypeEnum.DataReport;
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.DataReport;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModelEnum.PullData;
this.ReportModel.ReportSettings.AvailableFieldsCollection =

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

@ -48,7 +48,7 @@ namespace ReportGenerator { @@ -48,7 +48,7 @@ namespace ReportGenerator {
public override void GenerateReport() {
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportTypeEnum.DataReport;
base.ReportModel.ReportSettings.ReportType = GlobalEnums.ReportType.DataReport;
base.ReportModel.ReportSettings.DataModel = GlobalEnums.PushPullModelEnum.PushData;

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

@ -33,7 +33,7 @@ namespace ReportGenerator { @@ -33,7 +33,7 @@ namespace ReportGenerator {
private string fileName;
private string path;
private GlobalEnums.ReportTypeEnum reportType;
private GlobalEnums.ReportType reportType;
private GraphicsUnit graphicsUnit;
//Database
@ -89,7 +89,7 @@ namespace ReportGenerator { @@ -89,7 +89,7 @@ namespace ReportGenerator {
reportName = value;
}
}
public SharpReportCore.GlobalEnums.ReportTypeEnum ReportType {
public SharpReportCore.GlobalEnums.ReportType ReportType {
get {
return reportType;
}

Loading…
Cancel
Save