diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportItems/BaseImageItem.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportItems/BaseImageItem.cs index b0dcc1c7aa..4ce90a773c 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportItems/BaseImageItem.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportItems/BaseImageItem.cs @@ -60,21 +60,21 @@ namespace ICSharpCode.Reports.Addin if (this.scaleImageToSize) { graphics.DrawImageUnscaled(this.Image,this.Location.X,this.Location.Y); } else { - Image im = this.image; - if (im != null) { - graphics.DrawImage(this.Image,this.ClientRectangle); - } + graphics.DrawImage(this.Image,this.ClientRectangle); } } + #region Property's [Category("Image")] [EditorAttribute ( typeof(FileNameEditor), typeof(UITypeEditor) ) ] public string ImageFileName { get { return imageFileName; } set { imageFileName = value; - this.relativeFileName = FileUtility.GetRelativePath(Path.GetFullPath(this.reportFileName),Path.GetFullPath(this.ImageFileName)); + if (!String.IsNullOrEmpty(reportFileName)) { + this.relativeFileName = FileUtility.GetRelativePath(Path.GetFullPath(this.reportFileName),Path.GetFullPath(this.ImageFileName)); + } } } @@ -138,16 +138,24 @@ namespace ICSharpCode.Reports.Addin if (this.imageSource == GlobalEnums.ImageSource.Database ) { text = ""; } + if (!String.IsNullOrEmpty(imageFileName)) { + this.image = this.LoadImage(); + return this.image; + } + /* this.image = FakeImage(base.Size,text); if (this.image != null) { return image; } else { + var s = AbsoluteFileName; if (!String.IsNullOrEmpty(imageFileName)) { this.image = this.LoadImage(); return this.image; } } return null; + */ + return null; } set { this.image = value; @@ -212,16 +220,25 @@ namespace ICSharpCode.Reports.Addin public string AbsoluteFileName { get { -//D:\SharpDevelop3.0_WorkingCopy\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos + //D:\SharpDevelop3.0_WorkingCopy\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos if (!string.IsNullOrEmpty(relativeFileName)) { Console.WriteLine(""); - string testFileName = FileUtility.NormalizePath(Path.Combine(Path.GetDirectoryName(this.reportFileName),this.relativeFileName)); + + string testFileName = String.Empty; + if (! String.IsNullOrEmpty(reportFileName)) { + testFileName = FileUtility.NormalizePath(Path.Combine(Path.GetDirectoryName(this.reportFileName),this.relativeFileName)); + } + +// else +// { +// testFileName = FileUtility.NormalizePath(Path.Combine(Path.GetDirectoryName(this.reportFileName),this.relativeFileName)); +// } if (File.Exists(testFileName)){ Console.WriteLine("Image found with Relative Filename"); - Console.WriteLine("Report Filename {0}",this.reportFileName); - Console.WriteLine("Relative Filename {0}",this.relativeFileName); - Console.WriteLine("Image Filename {0}",this.ImageFileName); +// Console.WriteLine("Report Filename {0}",this.reportFileName); +// Console.WriteLine("Relative Filename {0}",this.relativeFileName); +// Console.WriteLine("Image Filename {0}",this.ImageFileName); return testFileName; } else { Console.WriteLine("AbsoluteFileName can't load image"); diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ReportingLanguage/IntegrationTests/AggregateFunctionsFixture.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ReportingLanguage/IntegrationTests/AggregateFunctionsFixture.cs index f90d0689a2..a279e64ebe 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ReportingLanguage/IntegrationTests/AggregateFunctionsFixture.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Test/ICSharpCode.Reports.Core.Test/ReportingLanguage/IntegrationTests/AggregateFunctionsFixture.cs @@ -15,7 +15,7 @@ namespace ICSharpCode.Reports.Core.Test.ReportingLanguage.IntegrationTests { [TestFixture] - [SetCulture("de-DE")] +// [SetCulture("de-DE")] public class AggregateFunctionsFromTableFixture { @@ -100,6 +100,7 @@ namespace ICSharpCode.Reports.Core.Test.ReportingLanguage.IntegrationTests public void Can_Sum_Double () { const string expression = "=sum(amount)"; + //var s = this.evaluator.Evaluate(expression); Assert.That(this.evaluator.Evaluate(expression), Is.EqualTo(this.doubleResult.ToString())); } @@ -112,6 +113,7 @@ namespace ICSharpCode.Reports.Core.Test.ReportingLanguage.IntegrationTests public void Can_Look_For_MaxValue() { const string expression = "=max(amount)"; + //var s = this.evaluator.Evaluate(expression); Assert.That(this.evaluator.Evaluate(expression), Is.EqualTo("400,5")); }