diff --git a/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.csproj b/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.csproj index c5d7336c..6476cf97 100644 --- a/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.csproj +++ b/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.csproj @@ -32,14 +32,9 @@ - - - - - - + diff --git a/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.sln b/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.sln index 1cc3e948..3385c196 100644 --- a/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.sln +++ b/Demos/Core/FastReportCore.MVC/FastReportCore.MVC.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 15.0.26730.8 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReportCore.MVC", "FastReportCore.MVC.csproj", "{D52ADB4D-0003-4035-8DFD-C01F2B14DDCD}" EndProject -Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{4C501371-339F-4270-8F3F-22F0D3DED115}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -17,10 +15,6 @@ Global {D52ADB4D-0003-4035-8DFD-C01F2B14DDCD}.Debug|Any CPU.Build.0 = Debug|Any CPU {D52ADB4D-0003-4035-8DFD-C01F2B14DDCD}.Release|Any CPU.ActiveCfg = Release|Any CPU {D52ADB4D-0003-4035-8DFD-C01F2B14DDCD}.Release|Any CPU.Build.0 = Release|Any CPU - {4C501371-339F-4270-8F3F-22F0D3DED115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4C501371-339F-4270-8F3F-22F0D3DED115}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C501371-339F-4270-8F3F-22F0D3DED115}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4C501371-339F-4270-8F3F-22F0D3DED115}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Demos/Core/FastReportWebCore.MVC/FastReportWebCore.MVC/FastReportWebCore.MVC.csproj b/Demos/Core/FastReportWebCore.MVC/FastReportWebCore.MVC/FastReportWebCore.MVC.csproj index f2f4e7b6..f36b7a12 100644 --- a/Demos/Core/FastReportWebCore.MVC/FastReportWebCore.MVC/FastReportWebCore.MVC.csproj +++ b/Demos/Core/FastReportWebCore.MVC/FastReportWebCore.MVC/FastReportWebCore.MVC.csproj @@ -20,15 +20,10 @@ - - - - - - + - + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj b/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj index 57f7b30c..debcb90a 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj @@ -14,7 +14,7 @@ FastReport.Data.Couchbase https://www.fast-report.com/download/images/frlogo-big.png reporting, Couchbase, connection, reports - 2018.2.2$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.Couchbase FastReport.Data @@ -24,46 +24,15 @@ FRCORE; - - + - - - - - - - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - + all + - - - False - ..\FastReport.Data.Json\bin\Community\net47\FastReport.Data.Json.dll - - - - - - - - - - diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.OpenSource.Data.Couchbase.csproj b/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.OpenSource.Data.Couchbase.csproj index cecbe427..28fb9732 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.OpenSource.Data.Couchbase.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.OpenSource.Data.Couchbase.csproj @@ -15,7 +15,7 @@ FastReport.OpenSource.Data.Couchbase https://www.fast-report.com/download/images/frlogo-big.png reporting, Couchbase, connection, reports - 2018.4.13$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.Couchbase FastReport.Data @@ -27,7 +27,7 @@ FRCORE; - + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj b/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj index 0850fcd7..ac2fd577 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj @@ -15,7 +15,7 @@ FastReport.Data.Json https://www.fast-report.com/download/images/frlogo-big.png reporting, Json, connection, reports - 2018.3.11$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.Json FastReport.Data @@ -29,27 +29,13 @@ - - - - - - - - - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - - + + + + + all + + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Json/JsonCompiler.cs b/Extras/Core/FastReport.Data/FastReport.Data.Json/JsonCompiler.cs index b840906f..12529639 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Json/JsonCompiler.cs +++ b/Extras/Core/FastReport.Data/FastReport.Data.Json/JsonCompiler.cs @@ -41,8 +41,19 @@ public static Type Compile(string json) source = sw.ToString(); } - string nLocation = Path.GetDirectoryName(Assembly.GetCallingAssembly().Location); - string nPath = Path.Combine(nLocation, "Newtonsoft.Json.dll"); + string nLocation; + string nPath; + + try + { + nLocation = Path.GetDirectoryName(Assembly.GetCallingAssembly().Location); + nPath = Path.Combine(nLocation, "Newtonsoft.Json.dll"); + } + catch + { + nLocation = Environment.CurrentDirectory; + nPath = Path.Combine(nLocation, "Newtonsoft.Json.dll"); + } Type type = Utils.CompileHelper.GenerateAssemblyInMemory(source, nPath).GetType("__JSON__.__JSON__"); return type; diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Data.MongoDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Data.MongoDB.csproj index 1166c2ed..73d0021c 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Data.MongoDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Data.MongoDB.csproj @@ -15,7 +15,7 @@ FastReport.Data.MongoDB https://www.fast-report.com/download/images/frlogo-big.png reporting, MongoDB, connection, reports - 2018.2.2$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.MongoDB FastReport.Data @@ -31,27 +31,13 @@ - - - + all - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - - + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.OpenSource.Data.MongoDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.OpenSource.Data.MongoDB.csproj index 61535a58..61945937 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.OpenSource.Data.MongoDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.OpenSource.Data.MongoDB.csproj @@ -14,7 +14,7 @@ FastReport.OpenSource.Data.MongoDB https://www.fast-report.com/download/images/frlogo-big.png reporting, MongoDB, connection, reports - 2018.4.13$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.MongoDB FastReport.Data diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MsSql/FastReport.Data.MsSql.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MsSql/FastReport.Data.MsSql.csproj index 28bea43f..42fe4100 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MsSql/FastReport.Data.MsSql.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MsSql/FastReport.Data.MsSql.csproj @@ -14,7 +14,7 @@ FastReport.Data.MsSql https://www.fast-report.com/download/images/frlogo-big.png reporting, mssql, connection, reports, core - 2018.2.3$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.MsSql FastReport.Data @@ -25,17 +25,8 @@ - - - - - - - - - diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MySql/FastReport.Data.MySql.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MySql/FastReport.Data.MySql.csproj index 6436259c..af7a43c2 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MySql/FastReport.Data.MySql.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MySql/FastReport.Data.MySql.csproj @@ -14,7 +14,7 @@ FastReport.Data.MySql https://www.fast-report.com/download/images/frlogo-big.png reporting, mysql, connection, reports - 2018.2.2$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.MySql FastReport.Data @@ -25,27 +25,12 @@ - - - - - - - - - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - - + + + + + all + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj index 72699e84..5d101f3a 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj @@ -14,7 +14,7 @@ FastReport.Data.OracleODPCore https://www.fast-report.com/download/images/frlogo-big.png reporting, oracle, core, connection, reports - 2018.3.29$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.OracleODPCore FastReport.Data @@ -25,33 +25,12 @@ FRCORE; - - - - - - - - false - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - - + + + + + all + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj index f89c420b..662fd6b7 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj @@ -15,7 +15,7 @@ FastReport.OpenSource.Data.OracleODPCore https://www.fast-report.com/download/images/frlogo-big.png reporting, oracle, core, connection, reports - 2018.4.13$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.OracleODPCore FastReport.Data diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.Data.Postgres.csproj b/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.Data.Postgres.csproj index 454c121f..4790dc9f 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.Data.Postgres.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.Data.Postgres.csproj @@ -14,9 +14,7 @@ FastReport.Data.Postgres https://www.fast-report.com/download/images/frlogo-big.png reporting, postgres, connection, reports - 2018.3.46$(VersionSuffix) - 2018.3.46.0 - 2018.3.46.0 + 1.0.0 Debug;Release; FastReport.Data.Postgres FastReport.Data @@ -30,28 +28,13 @@ - - - - + all - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - - + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.OpenSource.Data.Postgres.csproj b/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.OpenSource.Data.Postgres.csproj index 5117299c..7099dc91 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.OpenSource.Data.Postgres.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.Postgres/FastReport.OpenSource.Data.Postgres.csproj @@ -15,7 +15,6 @@ FastReport.OpenSource.Data.Postgres https://www.fast-report.com/download/images/frlogo-big.png reporting, postgres, connection, reports - 2018.3.46$(VersionSuffix) 1.0.0 Debug;Release; FastReport.Data.Postgres diff --git a/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj index b581e879..babaa05f 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj @@ -15,9 +15,7 @@ FastReport.Data.RavenDB https://www.fast-report.com/download/images/frlogo-big.png reporting, RavenDB, connection, reports - 2018.2.2$(VersionSuffix) - 2018.2.2.0 - 2018.2.2.0 + 1.0.0 Debug;Release; FastReport.Data.RavenDB FastReport.Data @@ -31,27 +29,13 @@ - - + - - - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - + all - - diff --git a/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.OpenSource.Data.RavenDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.OpenSource.Data.RavenDB.csproj index 868ce975..a4489adb 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.OpenSource.Data.RavenDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.OpenSource.Data.RavenDB.csproj @@ -15,9 +15,7 @@ FastReport.OpenSource.Data.RavenDB https://www.fast-report.com/download/images/frlogo-big.png reporting, RavenDB, connection, reports - 2018.4.13$(VersionSuffix) - 2018.4.13.0 - 2018.4.13.0 + 1.0.0 Debug;Release; FastReport.Data.RavenDB FastReport.Data diff --git a/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj b/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj index 71c4ad36..c1a81aa9 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj @@ -1,7 +1,7 @@ - net4;netstandard2.0;net47 + net4;netstandard2.0;net46 true ../../../FastReport.Plugins.snk true @@ -15,7 +15,7 @@ FastReport.Data.SQLite https://www.fast-report.com/download/images/frlogo-big.png reporting, SQLite, connection, reports - 2018.2.2$(VersionSuffix) + 1.0.0 Debug;Release; FastReport.Data.SQLite FastReport.Data @@ -30,27 +30,12 @@ - - - + all - - - - - - - - False - ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - - - - diff --git a/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.OpenSource.Data.SQLite.csproj b/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.OpenSource.Data.SQLite.csproj index aac55ad4..3bab9e5d 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.OpenSource.Data.SQLite.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.OpenSource.Data.SQLite.csproj @@ -14,9 +14,7 @@ FastReport.OpenSource.Data.SQLite https://www.fast-report.com/download/images/frlogo-big.png reporting, SQLite, connection, reports - 2018.4.13$(VersionSuffix) - 2018.4.13.0 - 2018.4.13.0 + 1.0.0 Debug;Release; FastReport.Data.SQLite FastReport.Data diff --git a/FastReport.Base/Engine/ReportEngine.Subreports.cs b/FastReport.Base/Engine/ReportEngine.Subreports.cs index 8e561cf0..1b18015a 100644 --- a/FastReport.Base/Engine/ReportEngine.Subreports.cs +++ b/FastReport.Base/Engine/ReportEngine.Subreports.cs @@ -8,7 +8,8 @@ public partial class ReportEngine private void RenderSubreport(SubreportObject subreport) { - RunBands(subreport.ReportPage.Bands); + if (subreport.ReportPage != null) + RunBands(subreport.ReportPage.Bands); } private void RenderInnerSubreport(BandBase parentBand, SubreportObject subreport) diff --git a/FastReport.Base/Export/Html/HTMLExportDraw.cs b/FastReport.Base/Export/Html/HTMLExportDraw.cs index 221b4f35..d507ad52 100644 --- a/FastReport.Base/Export/Html/HTMLExportDraw.cs +++ b/FastReport.Base/Export/Html/HTMLExportDraw.cs @@ -317,7 +317,7 @@ private string HTMLGetImage(int PageNumber, int CurrentPage, int ImageNumber, st if (!saveStreams) GeneratedFiles.Add(targetPath + ImageFileName); } - if (EmbedPictures) + if (EmbedPictures && PictureStream != null) { return embedPreffix + Convert.ToBase64String(PictureStream.ToArray()); } diff --git a/FastReport.Base/Report.cs b/FastReport.Base/Report.cs index 542fbbd2..6a82c5f7 100644 --- a/FastReport.Base/Report.cs +++ b/FastReport.Base/Report.cs @@ -957,7 +957,14 @@ private void ClearReportProperties() { ReportInfo.Clear(); Dictionary.Clear(); - ScriptLanguage = Config.ReportSettings.DefaultLanguage; + if (IsDesigning) + { + ScriptLanguage = Config.ReportSettings.DefaultLanguage; + } + else + { + ScriptLanguage = Language.CSharp; + } ScriptText = codeHelper.EmptyScript(); BaseReport = ""; DoublePass = false; diff --git a/FastReport.Base/SubreportObject.cs b/FastReport.Base/SubreportObject.cs index f31d2dab..a63158dd 100644 --- a/FastReport.Base/SubreportObject.cs +++ b/FastReport.Base/SubreportObject.cs @@ -52,8 +52,12 @@ public ReportPage ReportPage get { return reportPage; } set { - if (reportPage != null) - reportPage.Subreport = null; + if (value == Page) + return; + if (reportPage != null && value != reportPage) + { + RemoveSubReport(false); + } if (value != null) { value.Subreport = this; @@ -78,6 +82,44 @@ public bool PrintOnParent } #endregion + private void RemoveSubReport(bool delete) + { + if (reportPage != null) + { + if (Report != null) + { + foreach (Base obj in Report.AllObjects) + { + if (obj is SubreportObject && obj != this) + { + SubreportObject subReport = obj as SubreportObject; + if (subReport.ReportPage == reportPage) + { + + reportPage.Subreport = subReport; + reportPage.PageName = subReport.Name; + reportPage = null; + break; + } + } + } + } + if (reportPage != null) + { + if (delete && Report != null) + { + reportPage.Dispose(); + } + else + { + reportPage.Subreport = null; + reportPage.PageName = reportPage.Name; + } + reportPage = null; + } + } + } + #region Public Methods /// public override void Assign(Base source) diff --git a/FastReport.Base/TextObject.cs b/FastReport.Base/TextObject.cs index 89acf863..92f6ef8b 100644 --- a/FastReport.Base/TextObject.cs +++ b/FastReport.Base/TextObject.cs @@ -1068,10 +1068,16 @@ internal HtmlTextRenderer GetHtmlTextRenderer(Graphics g, RectangleF textRect, f } internal HtmlTextRenderer GetHtmlTextRenderer(Graphics g, float scale, float fontScale, RectangleF textRect, StringFormat format) + { + return GetHtmlTextRenderer(g, fontScale, scale, fontScale, textRect, format); + } + + + internal HtmlTextRenderer GetHtmlTextRenderer(Graphics g, float formatScale, float scale, float fontScale, RectangleF textRect, StringFormat format) { return new HtmlTextRenderer(Text, g, font.Name, font.Size, font.Style, TextColor, textOutline.Color, textRect, Underlines, - format, horzAlign, vertAlign, ParagraphFormat.MultipleScale(fontScale), ForceJustify, + format, horzAlign, vertAlign, ParagraphFormat.MultipleScale(formatScale), ForceJustify, scale * 96f / DrawUtils.ScreenDpi, fontScale * 96f / DrawUtils.ScreenDpi, InlineImageCache ); } @@ -1119,21 +1125,28 @@ public void DrawText(FRPaintEventArgs e) switch (TextRenderType) { case TextRenderType.HtmlParagraph: + try { - HtmlTextRenderer renderer = GetHtmlTextRenderer(e.Graphics, e.ScaleX, IsPrinting ? 1 : e.ScaleX, textRect, format); - - renderer.Draw(); + HtmlTextRenderer htmlRenderer = GetHtmlTextRenderer(e.Graphics, e.ScaleX, + IsPrinting ? 1 : e.ScaleX, IsPrinting ? 1 : e.ScaleX, textRect, format); + htmlRenderer.Draw(); + } + catch + { + textBrush.Dispose(); + textBrush = null; } break; default: if (IsAdvancedRendererNeeded) { // use advanced rendering - AdvancedTextRenderer renderer = new AdvancedTextRenderer(text, g, font, textBrush, outlinePen, - textRect, format, HorzAlign, VertAlign, LineHeight * e.ScaleY, Angle, FontWidthRatio, - ForceJustify, Wysiwyg, HasHtmlTags, false, e.ScaleX * 96f / DrawUtils.ScreenDpi, IsPrinting ? 1 : e.ScaleX * 96f / DrawUtils.ScreenDpi, - InlineImageCache); - renderer.Draw(); + AdvancedTextRenderer advancedRenderer = new AdvancedTextRenderer(text, g, font, textBrush, + outlinePen, textRect, format, HorzAlign, VertAlign, LineHeight * e.ScaleY, Angle, + FontWidthRatio, ForceJustify, Wysiwyg, HasHtmlTags, false, + e.ScaleX * 96f / DrawUtils.ScreenDpi, + IsPrinting ? 1 : e.ScaleX * 96f / DrawUtils.ScreenDpi, InlineImageCache); + advancedRenderer.Draw(); } else { @@ -1147,7 +1160,8 @@ public void DrawText(FRPaintEventArgs e) else { GraphicsPath path = new GraphicsPath(); - path.AddString(text, font.FontFamily, Convert.ToInt32(font.Style), g.DpiY * font.Size / 72, textRect, format); + path.AddString(text, font.FontFamily, Convert.ToInt32(font.Style), + g.DpiY * font.Size / 72, textRect, format); GraphicsState state = g.Save(); g.SetClip(textRect); @@ -1170,7 +1184,8 @@ public void DrawText(FRPaintEventArgs e) } } else - StandardTextRenderer.Draw(text, g, font, textBrush, outlinePen, textRect, format, Angle, FontWidthRatio); + StandardTextRenderer.Draw(text, g, font, textBrush, outlinePen, textRect, format, Angle, + FontWidthRatio); } DrawUnderlines(e); @@ -1565,13 +1580,7 @@ internal IEnumerable GetPictureFromHtmlText(AdvancedTextRenderer ); - if (left < 0 - || - top < 0 - || - width < runImage.Width - || - height < runImage.Height) + if (left < 0 || top < 0 || width < runImage.Width || height < runImage.Height) { Bitmap bmp = new Bitmap((int)width, (int)height); using (Graphics g = Graphics.FromImage(bmp)) diff --git a/FastReport.Base/Utils/TextRenderer.cs b/FastReport.Base/Utils/TextRenderer.cs index 58f6888a..c040ff03 100644 --- a/FastReport.Base/Utils/TextRenderer.cs +++ b/FastReport.Base/Utils/TextRenderer.cs @@ -523,12 +523,16 @@ private int MeasureString(string text) // BEGIN: The fix for linux and core app a264aae5-193b-4e5c-955c-0818de3ca01b float left = 0; int tabFit = 0; - while (text[0] == '\t') + while (text.Length > 0 && text[0] == '\t') { left = Renderer.GetTabPosition(left); text = text.Substring(1); + if (Renderer.DisplayRect.Width < left) + return tabFit; tabFit++; } + if (tabFit > 0 && Renderer.DisplayRect.Width < left) + return tabFit; int charsFit = 0; int linesFit = 0; // END: The fix for linux and core app a264aae5-193b-4e5c-955c-0818de3ca01b diff --git a/FastReport.Core.Web/Application/WebReportDesigner.cs b/FastReport.Core.Web/Application/WebReportDesigner.cs index f564d3ab..57c4efa1 100644 --- a/FastReport.Core.Web/Application/WebReportDesigner.cs +++ b/FastReport.Core.Web/Application/WebReportDesigner.cs @@ -192,19 +192,20 @@ internal IActionResult DesignerSaveReport(HttpContext context) } // Request call-back - HttpWebResponse resp; try { - resp = request.GetResponse() as HttpWebResponse; - //context.Response.StatusCode = (int)resp.StatusCode; - //context.Response.Write(resp.StatusDescription); - - result = new ContentResult() + using (HttpWebResponse resp = request.GetResponse() as HttpWebResponse) { - StatusCode = (int)resp.StatusCode, - ContentType = "text/html", - Content = resp.StatusDescription, - }; + //context.Response.StatusCode = (int)resp.StatusCode; + //context.Response.Write(resp.StatusDescription); + + result = new ContentResult() + { + StatusCode = (int)resp.StatusCode, + ContentType = "text/html", + Content = resp.StatusDescription, + }; + } } catch (WebException err) { @@ -406,14 +407,18 @@ string CutRestricted(string xmlString) } // cut connection strings - var dictionary = xml.Root.FindItem("Dictionary"); - if (dictionary != null) + using (var dictionary = xml.Root.FindItem("Dictionary")) { - for (int i = 0; i < dictionary.Items.Count; i++) + if (dictionary != null) { - var item = dictionary.Items[i]; - if (!String.IsNullOrEmpty(item.GetProp("ConnectionString"))) - item.SetProp("ConnectionString", String.Empty); + for (int i = 0; i < dictionary.Items.Count; i++) + { + var item = dictionary.Items[i]; + if (!String.IsNullOrEmpty(item.GetProp("ConnectionString"))) + { + item.SetProp("ConnectionString", String.Empty); + } + } } } @@ -448,41 +453,43 @@ string PasteRestricted(string xmlString) if (!DesignScriptCode) { xml2.Root.SetProp("CodeRestricted", ""); - // clean received script - var scriptItem2 = xml2.Root.FindItem("ScriptText"); - if (scriptItem2 != null) - scriptItem2.Value = ""; // paste old script var scriptItem1 = xml1.Root.FindItem("ScriptText"); - if (scriptItem1 != null) + if (scriptItem1 != null && String.IsNullOrEmpty(scriptItem1.Value)) { - if (String.IsNullOrEmpty(scriptItem1.Value)) + var scriptItem2 = xml2.Root.FindItem("ScriptText"); + if (scriptItem2 != null) { + scriptItem2.Value = scriptItem1.Value; scriptItem2.Dispose(); - scriptItem2 = null; } else - if (scriptItem2 != null) - scriptItem2.Value = scriptItem1.Value; - else + { xml2.Root.AddItem(scriptItem1); + } + scriptItem1.Dispose(); } - } + // paste saved connection strings - var dictionary1 = xml1.Root.FindItem("Dictionary"); - var dictionary2 = xml2.Root.FindItem("Dictionary"); - if (dictionary1 != null && dictionary2 != null) + using (var dictionary1 = xml1.Root.FindItem("Dictionary")) + using (var dictionary2 = xml2.Root.FindItem("Dictionary")) { - for (int i = 0; i < dictionary1.Items.Count; i++) + if (dictionary1 != null && dictionary2 != null) { - var item1 = dictionary1.Items[i]; - string connectionString = item1.GetProp("ConnectionString"); - if (!String.IsNullOrEmpty(connectionString)) + for (int i = 0; i < dictionary1.Items.Count; i++) { - var item2 = dictionary2.FindItem(item1.Name); - if (item2 != null) - item2.SetProp("ConnectionString", connectionString); + var item1 = dictionary1.Items[i]; + string connectionString = item1.GetProp("ConnectionString"); + if (!String.IsNullOrEmpty(connectionString)) + { + var item2 = dictionary2.FindItem(item1.Name); + if (item2 != null) + { + item2.SetProp("ConnectionString", connectionString); + item2.Dispose(); + } + } } } } @@ -496,6 +503,8 @@ string PasteRestricted(string xmlString) secondXmlStream.Read(buff, 0, buff.Length); xmlString = Encoding.UTF8.GetString(buff); } + xml1.Dispose(); + xml2.Dispose(); } return xmlString; } diff --git a/FastReport.Core.Web/Controllers/DesignerController.cs b/FastReport.Core.Web/Controllers/DesignerController.cs index 0bb82668..67687138 100644 --- a/FastReport.Core.Web/Controllers/DesignerController.cs +++ b/FastReport.Core.Web/Controllers/DesignerController.cs @@ -181,42 +181,44 @@ IActionResult GetConnectionTables(string connectionType, string connectionString IActionResult GetFunctions() { - var xml = new XmlDocument(); - xml.AutoIndent = true; - var list = new List(); - RegisteredObjects.Objects.EnumItems(list); - ObjectInfo rootFunctions = null; - - foreach (ObjectInfo item in list) + using (var xml = new XmlDocument()) { - if (item.Name == "Functions") + xml.AutoIndent = true; + var list = new List(); + RegisteredObjects.Objects.EnumItems(list); + ObjectInfo rootFunctions = null; + + foreach (ObjectInfo item in list) { - rootFunctions = item; - break; + if (item.Name == "Functions") + { + rootFunctions = item; + break; + } } - } - - xml.Root.Name = "ReportFunctions"; -// TODO -//#if !FRCORE -// if (rootFunctions != null) -// RegisteredObjects.CreateFunctionsTree(Report, rootFunctions, xml.Root); -//#endif + xml.Root.Name = "ReportFunctions"; - using (var stream = new MemoryStream()) - { - xml.Save(stream); - stream.Position = 0; - byte[] buff = new byte[stream.Length]; - stream.Read(buff, 0, buff.Length); + // TODO + //#if !FRCORE + // if (rootFunctions != null) + // RegisteredObjects.CreateFunctionsTree(Report, rootFunctions, xml.Root); + //#endif - return new ContentResult() + using (var stream = new MemoryStream()) { - StatusCode = (int)HttpStatusCode.OK, - ContentType = "application/xml", - Content = Encoding.UTF8.GetString(buff), - }; + xml.Save(stream); + stream.Position = 0; + byte[] buff = new byte[stream.Length]; + stream.Read(buff, 0, buff.Length); + + return new ContentResult() + { + StatusCode = (int)HttpStatusCode.OK, + ContentType = "application/xml", + Content = Encoding.UTF8.GetString(buff), + }; + } } } diff --git a/FastReport.Core.Web/FastReport.Web.csproj b/FastReport.Core.Web/FastReport.Web.csproj index 246ce84b..faf36b93 100644 --- a/FastReport.Core.Web/FastReport.Web.csproj +++ b/FastReport.Core.Web/FastReport.Web.csproj @@ -39,9 +39,8 @@ Various report objects will allow your report to look exactly how you want it to - - + FastReport.Web ../FastReport.Net.snk diff --git a/FastReport.OpenSource/DotNetClasses/CodeGenerator.cs b/FastReport.OpenSource/DotNetClasses/CodeGenerator.cs index a3b0d425..7ab151dc 100644 --- a/FastReport.OpenSource/DotNetClasses/CodeGenerator.cs +++ b/FastReport.OpenSource/DotNetClasses/CodeGenerator.cs @@ -10,7 +10,6 @@ internal static bool IsValidLanguageIndependentIdentifier(string value) { //TODO o_0 what???? return true; - throw new NotImplementedException(); } } } diff --git a/FastReport.OpenSource/FastReport.OpenSource.csproj b/FastReport.OpenSource/FastReport.OpenSource.csproj index 5c59b600..d0edde21 100644 --- a/FastReport.OpenSource/FastReport.OpenSource.csproj +++ b/FastReport.OpenSource/FastReport.OpenSource.csproj @@ -18,7 +18,7 @@ https://www.fast-report.com/download/images/frlogo-big.png reporting, reports, pdf, html, mvc, core 1.0.0 - Debug;Release;Academic;Demo;WinForms + Debug;Release FastReport FastReport FastReport Open Source is an open source reporting solution for .Net Core 2.x and .Net Framework 4.x. diff --git a/FastReport/Resources/en.xml b/FastReport/Resources/en.xml index aa47c3ac..913045b6 100644 --- a/FastReport/Resources/en.xml +++ b/FastReport/Resources/en.xml @@ -1526,6 +1526,7 @@ +