From 87dff50e3a5cac58d02b27b55b0067808947d878 Mon Sep 17 00:00:00 2001 From: Fast Reports Date: Thu, 26 Aug 2021 10:43:46 +0300 Subject: [PATCH 1/2] * sync 8/26/2021 --- Demos/Reports/Barcode.frx | 6 +- .../FastReport.Core.Data.MongoDB.csproj | 6 +- .../FastReport.CoreWin.Data.MongoDB.csproj | 4 +- .../FastReport.Data.MongoDB.csproj | 6 +- .../FastReport.OpenSource.Data.MongoDB.csproj | 16 +- FastReport.Base/AssemblyInitializer.cs | 2 +- FastReport.Base/BandBase.cs | 9 +- FastReport.Base/Barcode/BarcodeObject.cs | 5 +- FastReport.Base/Barcode/BarcodePostNet.cs | 119 +++ FastReport.Base/ComponentBase.cs | 22 + .../Elasticsearch/ESDataSourceConnection.cs | 193 ++++ .../ESDataSourceConnectionStringBuilder.cs | 130 +++ .../JsonConnection/JsonTableDataSource.cs | 7 +- FastReport.Base/Export/ExportBase.cs | 1 + FastReport.Base/TextObject.cs | 38 +- FastReport.Base/TextObjectBase.cs | 877 +++++++++--------- FastReport.Base/Utils/Res.cs | 3 +- .../Application/ExportMenuSettings.cs | 420 ++++++++- .../Application/Toolbar.Localization.cs | 164 ++++ .../Application/ToolbarSettings.cs | 293 +++++- .../Application/WebReport.Exports.cs | 1 + FastReport.Core.Web/Application/WebReport.cs | 4 + .../Controllers/ReportController.cs | 36 +- FastReport.Core.Web/Templates/main.cs | 51 +- FastReport.Core.Web/Templates/script.cs | 3 +- FastReport.Core.Web/Templates/style.cs | 50 +- FastReport.Core.Web/Templates/toolbar.cs | 79 +- .../FastReport.OpenSource.csproj | 5 +- FastReport/Resources/en.xml | 9 +- Localization/Russian.frl | 3 + UsedPackages.version | 10 +- 31 files changed, 1944 insertions(+), 628 deletions(-) create mode 100644 FastReport.Base/Data/Elasticsearch/ESDataSourceConnection.cs create mode 100644 FastReport.Base/Data/Elasticsearch/ESDataSourceConnectionStringBuilder.cs create mode 100644 FastReport.Core.Web/Application/Toolbar.Localization.cs diff --git a/Demos/Reports/Barcode.frx b/Demos/Reports/Barcode.frx index 9008f539..ff6be5ab 100644 --- a/Demos/Reports/Barcode.frx +++ b/Demos/Reports/Barcode.frx @@ -1,5 +1,5 @@  - + @@ -68,8 +68,10 @@ + + - + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj index d08ea6fd..9a0f2472 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj @@ -27,14 +27,10 @@ This package will not be updated. The $(AssemblyName) package now includes a con FRCORE; - - - - - + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj index 7bf26db3..ba30c5fb 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj @@ -26,9 +26,7 @@ This package will not be updated. The $(AssemblyName) package now includes a con FRCORE; - - - + 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 3c25a036..9f3dadf3 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 @@ -48,13 +48,9 @@ Requirements: Any FastReport $(Version)+ package, NuGet Client 3.4.4+ - - - - - + 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 37940c64..61cd9e00 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 @@ -27,16 +27,12 @@ This package will not be updated. The $(AssemblyName) package now includes a con FRCORE; - - - - - - - - - - + + + + + + diff --git a/FastReport.Base/AssemblyInitializer.cs b/FastReport.Base/AssemblyInitializer.cs index 55bce8ef..05e55848 100644 --- a/FastReport.Base/AssemblyInitializer.cs +++ b/FastReport.Base/AssemblyInitializer.cs @@ -50,7 +50,7 @@ public AssemblyInitializer() //RegisteredObjects.Add(typeof(Data.JsonConnection.JsonObjectDataSource), "", 0); //RegisteredObjects.Add(typeof(Data.JsonConnection.JsonArrayDataSource), "", 0); RegisteredObjects.InternalAddConnection(typeof(Data.JsonConnection.JsonDataSourceConnection)); - + RegisteredObjects.InternalAddConnection(typeof(Data.ElasticSearch.ESDataSourceConnection)); // formats RegisteredObjects.InternalAdd(typeof(BooleanFormat), "", 0); RegisteredObjects.InternalAdd(typeof(CurrencyFormat), "", 0); diff --git a/FastReport.Base/BandBase.cs b/FastReport.Base/BandBase.cs index b85bbd9f..88c64e54 100644 --- a/FastReport.Base/BandBase.cs +++ b/FastReport.Base/BandBase.cs @@ -448,10 +448,18 @@ public virtual void UpdateLayout(float dx, float dy) { if ((c.Anchor & AnchorStyles.Right) != 0) { + // Save width of right anchor when page has unlimited width and its width is increasing. + if (Page != null && (Page as ReportPage).UnlimitedWidth && dx > 0) + c.RightAnchorWidth = Width - c.Right; + if ((c.Anchor & AnchorStyles.Left) != 0) c.Width += dx; else c.Left += dx; + + // Restore width of right anchor when page has unlimited width and its width is decreasing. + if (Page != null && (Page as ReportPage).UnlimitedWidth && dx < 0) + c.Width = PageWidth - c.RightAnchorWidth - c.Left; } else if ((c.Anchor & AnchorStyles.Left) == 0) { @@ -1048,6 +1056,5 @@ public BandBase() FlagUseStartNewPage = true; FlagCheckFreeSpace = true; } - } } \ No newline at end of file diff --git a/FastReport.Base/Barcode/BarcodeObject.cs b/FastReport.Base/Barcode/BarcodeObject.cs index df137add..b731f19c 100644 --- a/FastReport.Base/Barcode/BarcodeObject.cs +++ b/FastReport.Base/Barcode/BarcodeObject.cs @@ -661,10 +661,10 @@ public BarcodeItem(Type objType, string barcodeName) new BarcodeItem(typeof(Barcode2of5Industrial), "2/5 Industrial"), new BarcodeItem(typeof(Barcode2of5Matrix), "2/5 Matrix"), new BarcodeItem(typeof(BarcodeDeutscheIdentcode), "Deutsche Identcode"), - new BarcodeItem(typeof(BarcodeDeutscheLeitcode),"Deutshe Leitcode"), + new BarcodeItem(typeof(BarcodeDeutscheLeitcode),"Deutshe Leitcode"), new BarcodeItem(typeof(BarcodeITF14), "ITF-14"), new BarcodeItem(typeof(BarcodeCodabar), "Codabar"), - new BarcodeItem(typeof(Barcode128), "Code128"), + new BarcodeItem(typeof(Barcode128), "Code128"), new BarcodeItem(typeof(Barcode39), "Code39"), new BarcodeItem(typeof(Barcode39Extended), "Code39 Extended"), new BarcodeItem(typeof(Barcode93), "Code93"), @@ -673,6 +673,7 @@ public BarcodeItem(Type objType, string barcodeName) new BarcodeItem(typeof(BarcodeEAN13), "EAN13"), new BarcodeItem(typeof(BarcodeMSI), "MSI"), new BarcodeItem(typeof(BarcodePostNet), "PostNet"), + new BarcodeItem(typeof(BarcodeJapanPost4StateCode), "Japan Post 4 State Code"), new BarcodeItem(typeof(BarcodeUPC_A), "UPC-A"), new BarcodeItem(typeof(BarcodeUPC_E0), "UPC-E0"), new BarcodeItem(typeof(BarcodeUPC_E1), "UPC-E1"), diff --git a/FastReport.Base/Barcode/BarcodePostNet.cs b/FastReport.Base/Barcode/BarcodePostNet.cs index 5d02f003..88579207 100644 --- a/FastReport.Base/Barcode/BarcodePostNet.cs +++ b/FastReport.Base/Barcode/BarcodePostNet.cs @@ -1,6 +1,8 @@ +using FastReport.Utils; using System; using System.Collections.Generic; using System.Text; +using System.Text.RegularExpressions; namespace FastReport.Barcode { @@ -34,4 +36,121 @@ internal override string GetPattern() return result; } } + + /// + /// Generates the Japan Post 4 State Code barcode. + /// + public class BarcodeJapanPost4StateCode : LinearBarcodeBase + { + private string CeckDigitSet = "0123456789-abcdefgh"; + private string EncodeTable = "1234567890-abcdefgh"; + private static string[] JapanTable = + { + "6161E", //1 + "61G1F", //2 + "G161F", //3 + "61F1G", //4 + "61E16", //5 + "G1F16", //6 + "F161G", //7 + "F1G16", //8 + "E1616", //9 + "61E1E", //0 + "E161E", //- + "G1F1E", //a + "G1E1F", //b + "F1G1E", //c + "E1G1F", //d + "F1E1G", //e + "E1F1G", //f + "E1E16", //g + "61616" //h + }; + + internal override string GetPattern() + { + string encoded = ""; + int sum = 0; + int weight = 0; + string result = "61G1"; // start bar + + if (text.Length < 7) + { + throw new FormatException(Res.Get("Messages,BarcodeFewError")); + } + + foreach (var i in text) + { + if (((i >= '0') && (i <= '9')) || (i == '-')) + { + encoded += i; + weight++; + } + else + { + if ((i >= 'A') && (i <= 'J')) + { + encoded += 'a'; + encoded += (char)(i - 'A' + '0'); + } + if ((i >= 'K') && (i <= 'T')) + { + encoded += 'b'; + encoded += (char)(i - 'K' + '0'); + } + if ((i >= 'U') && (i <= 'Z')) + { + encoded += 'c'; + encoded += (char)(i - 'U' + '0'); + } + weight += 2; + } + } + + // remove the hyphens that will not be encoded in the barcode + if (encoded.IndexOf('-') == 3) + { + encoded = encoded.Remove(3, 1); + weight--; + } + if (encoded.IndexOf('-', 5) == 7) + { + encoded = encoded.Remove(7, 1); + weight--; + } + + if (weight > 20 || Regex.IsMatch(text.Substring(0, 7), "[^0-9\\-]") || + Regex.IsMatch(text.Substring(7, text.Length - 7), "[^A-Z0-9\\-]") || + (encoded.IndexOf('-') < 8 && encoded.IndexOf('-') != -1 )) + { + throw new FormatException(Res.Get("Messages,BarcodeLengthMismatch")); + } + + // fill pad character CC4, if need + for (int i = encoded.Length; i < 20; i++) + { + encoded += 'd'; + } + + for (int i = 0; i < 20; i++) + { + result += JapanTable[EncodeTable.IndexOf(encoded[i])]; + sum += CeckDigitSet.IndexOf(encoded[i]); + result += '1'; + } + + //Calculate check digit + char check_char = char.MinValue; + int check = 19 - (sum % 19); + if (check == 19) { check = 0; } + if (check <= 9) { check_char = (char)(check + '0'); } + if (check == 10) { check_char = '-'; } + if (check >= 11) { check_char = (char)((check - 11) + 'a'); } + result += JapanTable[EncodeTable.IndexOf(check_char)]; + + // data + stop bar + return result + "1G16"; + } + } } + diff --git a/FastReport.Base/ComponentBase.cs b/FastReport.Base/ComponentBase.cs index cd7bdae3..03a7f7d2 100644 --- a/FastReport.Base/ComponentBase.cs +++ b/FastReport.Base/ComponentBase.cs @@ -27,6 +27,7 @@ public abstract partial class ComponentBase : Base private bool printable; private string printableExpression; private float width; + private float rightAnchorWidth; #endregion Fields @@ -411,6 +412,21 @@ public virtual float Width } } + /// + /// Gets or sets the distance between right of the object and the right of a parent band. + /// + /// + /// This property value is measured in the screen pixels. + /// This property is used only when page has unlimited width. + /// + [DefaultValue(0.0f)] + [Browsable(false)] + public float RightAnchorWidth + { + get { return rightAnchorWidth; } + set { rightAnchorWidth = value; } + } + #endregion Properties #region Constructors @@ -427,6 +443,7 @@ public ComponentBase() printableExpression = ""; SetFlags(Flags.CanWriteBounds | Flags.HasGlobalName, true); tag = ""; + rightAnchorWidth = 0.0f; } #endregion Constructors @@ -488,6 +505,11 @@ public override void Serialize(FRWriter writer) } if (Tag != c.Tag) writer.WriteStr("Tag", Tag); + if (writer.SerializeTo == SerializeTo.Preview) + { + if (RightAnchorWidth != c.RightAnchorWidth) + writer.WriteFloat("RightAnchorWidth", RightAnchorWidth); + } } #endregion Public Methods diff --git a/FastReport.Base/Data/Elasticsearch/ESDataSourceConnection.cs b/FastReport.Base/Data/Elasticsearch/ESDataSourceConnection.cs new file mode 100644 index 00000000..cd9d0a80 --- /dev/null +++ b/FastReport.Base/Data/Elasticsearch/ESDataSourceConnection.cs @@ -0,0 +1,193 @@ +using FastReport.Data.JsonConnection; +using System.Collections.Generic; +using System.Data; +using System.Data.Common; +using System.Linq; +using System.Net; +using System.Text; + +namespace FastReport.Data.ElasticSearch +{ + public partial class ESDataSourceConnection : DataConnectionBase + { + #region Private Fields + private List connectionCollection; + private ESDataSourceConnectionStringBuilder sourceConnectionStringBuilder; + private string[] tableNames; + #endregion Private Fields + + #region Public Methods + + public ESDataSourceConnection() + { + IsSqlBased = false; + } + + public override void CreateAllTables(bool initSchema) + { + if (connectionCollection == null) + InitConnection(); + + bool found = false; + foreach (Base b in Tables) + { + if (b is JsonTableDataSource) + { + (b as JsonTableDataSource).UpdateSchema = true; + (b as JsonTableDataSource).InitSchema(); + found = true; + break; + } + } + + for (int i = 0; i < connectionCollection.Count; i++) + { + + if (!found) + { + JsonTableDataSource jsonDataSource = new JsonTableDataSource(); + + string fixedTableName = tableNames[i].Replace(".", "_").Replace("[", "").Replace("]", "").Replace("\"", ""); + jsonDataSource.TableName = fixedTableName; + + if (Report != null) + { + jsonDataSource.Name = Report.Dictionary.CreateUniqueName(fixedTableName); + jsonDataSource.Alias = Report.Dictionary.CreateUniqueAlias(jsonDataSource.Alias); + } + else + jsonDataSource.Name = fixedTableName; + + jsonDataSource.Parent = connectionCollection[i]; + jsonDataSource.InitSchema(); + jsonDataSource.Enabled = false; + Tables.Add(jsonDataSource); + } + } + + // init table schema + if (initSchema) + { + foreach (TableDataSource table in Tables) + { + table.InitSchema(); + } + } + } + + public override string QuoteIdentifier(string value, DbConnection connection) + { + return value; + } + + ///// + public override void CreateTable(TableDataSource source) + { + + } + /// + public override void FillTableData(DataTable table, string selectCommand, CommandParameterCollection parameters) + { + } + + /// + public override void FillTableSchema(DataTable table, string selectCommand, CommandParameterCollection parameters) + { + } + + public override string[] GetTableNames() + { + string respoce; + HttpWebRequest req = (HttpWebRequest)WebRequest.Create($"{sourceConnectionStringBuilder.EndPoint}/_alias"); + req.Method = "GET"; + foreach (var header in sourceConnectionStringBuilder.Headers) + { + req.Headers.Add(header.Key, header.Value); + } + + using (var response = req.GetResponse() as HttpWebResponse) + { + var encoding = Encoding.GetEncoding(response.CharacterSet); + + using (var responseStream = response.GetResponseStream()) + using (var reader = new System.IO.StreamReader(responseStream, encoding)) + respoce = reader.ReadToEnd(); + } + List Names = new List(); + object s = JsonBase.FromString(respoce).Keys; + foreach (string name in JsonBase.FromString(respoce).Keys) + Names.Add(name); + return Names.ToArray(); + } + + public JsonDataSourceConnection GetParentJTDSByName(string name) + { + sourceConnectionStringBuilder = new ESDataSourceConnectionStringBuilder(ConnectionString); + + if (tableNames == null) + tableNames = GetTableNames(); + if (tableNames == null || !tableNames.Contains(name)) + return null; + + int countRec = GetRecCount(name); + JsonDataSourceConnectionStringBuilder connectionStringBuilder = new JsonDataSourceConnectionStringBuilder(); + connectionStringBuilder.ConnectionString = + $"Json={sourceConnectionStringBuilder.EndPoint}/{name}/_search?size={countRec};JsonShema=;Encoding=utf-8;"; + connectionStringBuilder.Headers = sourceConnectionStringBuilder.Headers; + return new JsonDataSourceConnection() { ConnectionString = connectionStringBuilder.ToString() }; + } + #endregion + + #region Private Methods + private int GetRecCount(string teableName) + { + string responce; + HttpWebRequest req; + req = (HttpWebRequest)WebRequest.Create($"{sourceConnectionStringBuilder.EndPoint}/{teableName}/_count"); + req.Method = "GET"; + foreach (var header in sourceConnectionStringBuilder.Headers) + { + req.Headers.Add(header.Key, header.Value); + } + + using (var response = req.GetResponse() as HttpWebResponse) + { + var encoding = Encoding.GetEncoding(response.CharacterSet); + + using (var responseStream = response.GetResponseStream()) + using (var reader = new System.IO.StreamReader(responseStream, encoding)) + responce = reader.ReadToEnd(); + } + + int countRec = 0; + int.TryParse(JsonBase.FromString(responce)["count"].ToString(), out countRec); + return countRec; + } + + private void InitConnection() + { + ServicePointManager.Expect100Continue = true; + ServicePointManager.SecurityProtocol = (SecurityProtocolType)(0xc0 | 0x300 | 0xc00); + connectionCollection = new List(); + JsonDataSourceConnection jsonData; + int countRec; + sourceConnectionStringBuilder = new ESDataSourceConnectionStringBuilder(ConnectionString); + tableNames = GetTableNames(); + + foreach (var tableName in tableNames) + { + countRec = GetRecCount(tableName); + JsonDataSourceConnectionStringBuilder connectionStringBuilder = new JsonDataSourceConnectionStringBuilder(); + connectionStringBuilder.ConnectionString = + $"Json={sourceConnectionStringBuilder.EndPoint}/{tableName}/_search?size={countRec};JsonShema=;Encoding=utf-8;"; + connectionStringBuilder.Headers = sourceConnectionStringBuilder.Headers; + jsonData = new JsonDataSourceConnection() + { + ConnectionString = connectionStringBuilder.ToString() + }; + connectionCollection.Add(jsonData); + } + } + #endregion + } +} diff --git a/FastReport.Base/Data/Elasticsearch/ESDataSourceConnectionStringBuilder.cs b/FastReport.Base/Data/Elasticsearch/ESDataSourceConnectionStringBuilder.cs new file mode 100644 index 00000000..4df575ad --- /dev/null +++ b/FastReport.Base/Data/Elasticsearch/ESDataSourceConnectionStringBuilder.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Globalization; +using System.Text; +using System.Text.RegularExpressions; + +namespace FastReport.Data.ElasticSearch +{ + public class ESDataSourceConnectionStringBuilder : DbConnectionStringBuilder + { + #region Public Properties + + /// + /// Gets or sets EndPoint ElasticSearch DB + /// + public string EndPoint + { + get + { + object result; + if (TryGetValue("EndPoint", out result) && result != null) + { + if (Regex.IsMatch((string)result, @"^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$")) + { + var base64str = (Convert.FromBase64String(result.ToString())); + return Encoding.UTF8.GetString(base64str); + } + string resultStr = result.ToString(); + if (resultStr[resultStr.Length - 1] == '/') + return resultStr.Remove(resultStr.Length - 1); + return (string)result; + } + return ""; + } + set + { + base["EndPoint"] = value; + } + } + public Dictionary Headers { get; set; } + + #endregion Public Properties + + #region Public Constructors + + /// + /// Initializes a new instance of the class with default settings. + /// + public ESDataSourceConnectionStringBuilder() + { + ConnectionString = ""; + Headers = new Dictionary(); + } + + /// + /// Initializes a new instance of the class with + /// specified connection string. + /// + /// The connection string. + public ESDataSourceConnectionStringBuilder(string connectionString) + : base() + { + ConnectionString = connectionString; + Headers = new Dictionary(); + + object result; + string header = string.Empty; + string[] splittedHeader; + int headerIteration = 0; + while (TryGetValue("Header" + headerIteration.ToString(CultureInfo.InvariantCulture.NumberFormat), out result) && result != null) + { + header = (string)result; + + if (!string.IsNullOrWhiteSpace(header)) + { + splittedHeader = header.Split(':'); + + string headerKey = splittedHeader[0], headerVal = splittedHeader[1]; + + if (Regex.IsMatch(headerKey, @"^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$")) + { + var base64str = Convert.FromBase64String(headerKey); + headerKey = Encoding.UTF8.GetString(base64str); + } + + if (Regex.IsMatch(headerVal, @"^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$")) + { + var base64str = Convert.FromBase64String(headerVal); + headerVal = Encoding.UTF8.GetString(base64str); + } + + Headers.Add(headerKey, headerVal); + } + + headerIteration++; + } + } + + #endregion Public Constructors + + #region Public Methods + // escape / ; " : + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + builder.Append("EndPoint=").Append(Convert.ToBase64String(Encoding.UTF8.GetBytes(EndPoint))); + + int headerIteration = 0; + foreach (var header in Headers) + { + var headerKey = header.Key; + var headerVal = header.Value; + if (headerKey.Contains(";") || headerKey.Contains(":") || headerKey.Contains("\"") || headerKey.Contains("\'")) + { + headerKey = Convert.ToBase64String(Encoding.UTF8.GetBytes(headerKey)); + } + + if (headerVal.Contains(";") || headerVal.Contains(":") || headerVal.Contains("\"") || headerVal.Contains("\'")) + { + headerVal = Convert.ToBase64String(Encoding.UTF8.GetBytes(headerVal)); + } + + builder.Append(";Header").Append(headerIteration.ToString(CultureInfo.InvariantCulture.NumberFormat)).Append("=").Append(headerKey).Append(":").Append(headerVal); + } + return builder.ToString(); + } + #endregion + } +} diff --git a/FastReport.Base/Data/JsonConnection/JsonTableDataSource.cs b/FastReport.Base/Data/JsonConnection/JsonTableDataSource.cs index c65722df..7bd8a4b9 100644 --- a/FastReport.Base/Data/JsonConnection/JsonTableDataSource.cs +++ b/FastReport.Base/Data/JsonConnection/JsonTableDataSource.cs @@ -1,4 +1,5 @@ -using FastReport.Data.JsonConnection.JsonParser; +using FastReport.Data.ElasticSearch; +using FastReport.Data.JsonConnection.JsonParser; using System; using System.Collections; using System.Collections.Generic; @@ -279,6 +280,8 @@ internal static void InitSchema(Column table, JsonSchema schema) internal object GetJson(Base parentColumn, Column column) { + if(parentColumn is ESDataSourceConnection) + parentColumn = (parentColumn as ESDataSourceConnection).GetParentJTDSByName(column.Name); if (parentColumn is JsonDataSourceConnection) { // return zero level json @@ -286,6 +289,8 @@ internal object GetJson(Base parentColumn, Column column) } else if (parentColumn is JsonTableDataSource) { + if (parentColumn.Parent is ESDataSourceConnection) + parentColumn.Parent = (parentColumn.Parent as ESDataSourceConnection).GetParentJTDSByName(parentColumn.Name); JsonTableDataSource source = parentColumn as JsonTableDataSource; return source.Json[source.CurrentRowNo] as object; } diff --git a/FastReport.Base/Export/ExportBase.cs b/FastReport.Base/Export/ExportBase.cs index 4235744a..9c41c796 100644 --- a/FastReport.Base/Export/ExportBase.cs +++ b/FastReport.Base/Export/ExportBase.cs @@ -358,6 +358,7 @@ protected virtual void ExportPageEnd(ReportPage page) /// Band, dispose after method compite. protected virtual void ExportBand(Base band) { + (band as BandBase).UpdateWidth(); } /// diff --git a/FastReport.Base/TextObject.cs b/FastReport.Base/TextObject.cs index 94f87dab..70cbbbdf 100644 --- a/FastReport.Base/TextObject.cs +++ b/FastReport.Base/TextObject.cs @@ -10,7 +10,6 @@ using FastReport.Code; using System.Windows.Forms; using System.Drawing.Design; -using System.Globalization; namespace FastReport { @@ -775,7 +774,7 @@ private SizeF CalcSize() { if (width == 0) width = 100000; - AdvancedTextRenderer renderer = new AdvancedTextRenderer(Text, g, font, Brushes.Black, Pens.Black, + AdvancedTextRenderer renderer = new AdvancedTextRenderer(GetDisplayText(), g, font, Brushes.Black, Pens.Black, new RectangleF(0, 0, width, 100000), GetStringFormat(report.GraphicCache, 0), HorzAlign, VertAlign, LineHeight, Angle, FontWidthRatio, false, Wysiwyg, HasHtmlTags, false, 96f / DrawUtils.ScreenDpi, 96f / DrawUtils.ScreenDpi, InlineImageCache); @@ -792,7 +791,7 @@ private SizeF CalcSize() { if (FontWidthRatio != 1) width /= FontWidthRatio; - SizeF size = g.MeasureString(Text, font, new SizeF(width, 100000)); + SizeF size = g.MeasureString(GetDisplayText(), font, new SizeF(width, 100000)); size.Width += Padding.Horizontal + 1; size.Height += Padding.Vertical + 1; return size; @@ -1010,6 +1009,12 @@ protected override void DeserializeSubItems(FRReader reader) #endregion #region Public Methods + /// + /// Returns StringFormat object. + /// + /// Report graphic cache. + /// StringFormat flags. + /// StringFormat object. public StringFormat GetStringFormat(GraphicCache cache, StringFormatFlags flags) { return GetStringFormat(cache, flags, 1); @@ -1079,6 +1084,17 @@ public override void Assign(Base source) paragraphFormat.Assign(src.paragraphFormat); } + /// + /// Returns an instance of html text renderer. + /// + /// Scale ratio. + /// Font scale ratio. + /// The html text renderer. + public HtmlTextRenderer GetHtmlTextRenderer(float scale, float fontScale) + { + return GetHtmlTextRenderer(Report.MeasureGraphics, scale, fontScale); + } + internal HtmlTextRenderer GetHtmlTextRenderer(IGraphics g, float scale, float fontScale) { StringFormat format = GetStringFormat(Report.GraphicCache, 0, scale); @@ -1091,11 +1107,6 @@ internal HtmlTextRenderer GetHtmlTextRenderer(IGraphics g, float scale, float fo } - public HtmlTextRenderer GetHtmlTextRenderer(float scale, float fontScale) - { - return GetHtmlTextRenderer(Report.MeasureGraphics, scale, fontScale); - } - internal HtmlTextRenderer GetHtmlTextRenderer(IGraphics g, RectangleF textRect, float scale, float fontScale) { StringFormat format = GetStringFormat(Report.GraphicCache, 0, fontScale); @@ -1104,14 +1115,13 @@ internal HtmlTextRenderer GetHtmlTextRenderer(IGraphics g, RectangleF textRect, internal HtmlTextRenderer GetHtmlTextRenderer(IGraphics g, float scale, float fontScale, RectangleF textRect, StringFormat format) { - return GetHtmlTextRenderer(g, fontScale, scale, fontScale, textRect, format, false); + return GetHtmlTextRenderer(GetDisplayText(), g, fontScale, scale, fontScale, textRect, format, false); } - - internal HtmlTextRenderer GetHtmlTextRenderer(IGraphics g, float formatScale, float scale, float fontScale, RectangleF textRect, StringFormat format, bool isPrinting) + internal HtmlTextRenderer GetHtmlTextRenderer(string text, IGraphics g, float formatScale, float scale, float fontScale, RectangleF textRect, StringFormat format, bool isPrinting) { bool isDifferentTabPositions = TabPositions.Count > 0; - return new HtmlTextRenderer(Text, g, font.Name, font.Size, font.Style, TextColor, + return new HtmlTextRenderer(text, g, font.Name, font.Size, font.Style, TextColor, textOutline.Color, textRect, Underlines, format, horzAlign, vertAlign, ParagraphFormat.MultipleScale(formatScale), ForceJustify, scale * 96f / DrawUtils.ScreenDpi, fontScale * 96f / DrawUtils.ScreenDpi, InlineImageCache, @@ -1124,7 +1134,7 @@ internal HtmlTextRenderer GetHtmlTextRenderer(IGraphics g, float formatScale, fl /// Paint event data. public void DrawText(FRPaintEventArgs e) { - string text = Text; + string text = GetDisplayText(); if (!String.IsNullOrEmpty(text)) { IGraphics g = e.Graphics; @@ -1163,7 +1173,7 @@ public void DrawText(FRPaintEventArgs e) case TextRenderType.HtmlParagraph: try { - using (HtmlTextRenderer htmlRenderer = GetHtmlTextRenderer(e.Graphics, e.ScaleX, + using (HtmlTextRenderer htmlRenderer = GetHtmlTextRenderer(text, e.Graphics, e.ScaleX, IsPrinting ? 1 : e.ScaleX, IsPrinting ? 1 / (96f / DrawUtils.ScreenDpi) : e.ScaleX, textRect, format, IsPrinting)) { htmlRenderer.Draw(); diff --git a/FastReport.Base/TextObjectBase.cs b/FastReport.Base/TextObjectBase.cs index 52005e29..9fe025a7 100644 --- a/FastReport.Base/TextObjectBase.cs +++ b/FastReport.Base/TextObjectBase.cs @@ -7,477 +7,488 @@ namespace FastReport { - /// - /// Specifies how to display the duplicate values. - /// - public enum Duplicates - { /// - /// The TextObject can show duplicate values. + /// Specifies how to display the duplicate values. /// - Show, - - /// - /// The TextObject with duplicate value will be hidden. - /// - Hide, - - /// - /// The TextObject with duplicate value will be shown but with no text. - /// - Clear, - - /// - /// Several TextObject objects with the same value will be merged into one TextObject object. - /// - Merge - } - - /// - /// Specifies how the report engine processes the text objects. - /// - public enum ProcessAt - { - /// - /// Specifies the default process mode. The text object is processed just-in-time. - /// - Default, - - /// - /// Specifies that the text object must be processed when the entire report is finished. This mode - /// can be used to print grand total value (which is normally calculated at the end of report) in the - /// report title band. - /// - ReportFinished, - - /// - /// Specifies that the text object must be processed when the entire report page is finished. This mode - /// can be used if the report template consists of several report pages. - /// - ReportPageFinished, - - /// - /// Specifies that the text object must be processed when any report page is finished. This mode - /// can be used to print the page total (which is normally calculated at the page footer) in the - /// page header band. - /// - PageFinished, - - /// - /// Specifies that the text object must be processed when the column is finished. This mode - /// can be used to print the column total (which is normally calculated at the column footer) in the - /// column header band. - /// - ColumnFinished, - - /// - /// Specifies that the text object must be processed when the data block is finished. This mode can be - /// used to print a total value in the data header (which is normally available - /// in the data footer only). - /// - DataFinished, - - /// - /// Specifies that the text object must be processed when the group is finished. This mode can be - /// used to print a total value in the group header (which is normally available - /// in the group footer only). - /// - GroupFinished, - - /// - /// Specifies that the text object is processed manually when you call the Engine.ProcessObject - /// method in the report script. - /// - Custom - } - - /// - /// Base class for text objects such as and . - /// - /// - /// This class implements common functionality of the text objects. - /// - public partial class TextObjectBase : BreakableComponent - { - #region Fields - private string text; - private object value; - private bool allowExpressions; - private string brackets; - private Padding padding; - private bool hideZeros; - private string hideValue; - private string nullValue; - private FormatCollection formats; - private ProcessAt processAt; - private Duplicates duplicates; - private bool editable; - #endregion - - #region Properties - /// - /// Gets or sets a value indicating that the object's text may contain expressions. - /// - [DefaultValue(true)] - [Category("Data")] - public bool AllowExpressions + public enum Duplicates { - get { return allowExpressions; } - set { allowExpressions = value; } + /// + /// The TextObject can show duplicate values. + /// + Show, + + /// + /// The TextObject with duplicate value will be hidden. + /// + Hide, + + /// + /// The TextObject with duplicate value will be shown but with no text. + /// + Clear, + + /// + /// Several TextObject objects with the same value will be merged into one TextObject object. + /// + Merge } /// - /// Gets or sets the symbols that will be used to find expressions in the object's text. + /// Specifies how the report engine processes the text objects. /// - /// - /// The default property value is "[,]". As you can see, the open and close symbols are - /// separated by the comma. You may use another symbols, for example: "<,>" or "<%,%>". - /// You should use different open and close symbols. - /// - [Category("Data")] - public string Brackets + public enum ProcessAt { - get { return brackets; } - set { brackets = value; } + /// + /// Specifies the default process mode. The text object is processed just-in-time. + /// + Default, + + /// + /// Specifies that the text object must be processed when the entire report is finished. This mode + /// can be used to print grand total value (which is normally calculated at the end of report) in the + /// report title band. + /// + ReportFinished, + + /// + /// Specifies that the text object must be processed when the entire report page is finished. This mode + /// can be used if the report template consists of several report pages. + /// + ReportPageFinished, + + /// + /// Specifies that the text object must be processed when any report page is finished. This mode + /// can be used to print the page total (which is normally calculated at the page footer) in the + /// page header band. + /// + PageFinished, + + /// + /// Specifies that the text object must be processed when the column is finished. This mode + /// can be used to print the column total (which is normally calculated at the column footer) in the + /// column header band. + /// + ColumnFinished, + + /// + /// Specifies that the text object must be processed when the data block is finished. This mode can be + /// used to print a total value in the data header (which is normally available + /// in the data footer only). + /// + DataFinished, + + /// + /// Specifies that the text object must be processed when the group is finished. This mode can be + /// used to print a total value in the group header (which is normally available + /// in the group footer only). + /// + GroupFinished, + + /// + /// Specifies that the text object is processed manually when you call the Engine.ProcessObject + /// method in the report script. + /// + Custom } /// - /// Gets or sets the object's text. + /// Base class for text objects such as and . /// /// - /// Text may contain expressions and data items, for example: "Today is [Date]". - /// When report is running, all expressions are calculated and replaced with actual - /// values, so the text would be "Today is 01.01.2008". + /// This class implements common functionality of the text objects. /// - [Category("Data")] - public virtual string Text + public partial class TextObjectBase : BreakableComponent { - get { return text; } - set { text = value; } - } + #region Fields + private string text; + private object value; + private bool allowExpressions; + private string brackets; + private Padding padding; + private bool hideZeros; + private string hideValue; + private string nullValue; + private FormatCollection formats; + private ProcessAt processAt; + private Duplicates duplicates; + private bool editable; + #endregion + + #region Properties + /// + /// Gets or sets a value indicating that the object's text may contain expressions. + /// + [DefaultValue(true)] + [Category("Data")] + public bool AllowExpressions + { + get { return allowExpressions; } + set { allowExpressions = value; } + } - /// - /// Gets or sets padding within the text object. - /// - [Category("Layout")] - public Padding Padding - { - get { return padding; } - set { padding = value; } - } + /// + /// Gets or sets the symbols that will be used to find expressions in the object's text. + /// + /// + /// The default property value is "[,]". As you can see, the open and close symbols are + /// separated by the comma. You may use another symbols, for example: "<,>" or "<%,%>". + /// You should use different open and close symbols. + /// + [Category("Data")] + public string Brackets + { + get { return brackets; } + set { brackets = value; } + } - /// - /// Gets or sets a value indicating that zero values must be hidden. - /// - [Category("Behavior")] - [DefaultValue(false)] - public bool HideZeros - { - get { return hideZeros; } - set { hideZeros = value; } - } + /// + /// Gets or sets the object's text. + /// + /// + /// Text may contain expressions and data items, for example: "Today is [Date]". + /// When report is running, all expressions are calculated and replaced with actual + /// values, so the text would be "Today is 01.01.2008". + /// + [Category("Data")] + public virtual string Text + { + get { return text; } + set { text = value; } + } - /// - /// Gets or sets a value that will be hidden. - /// - /// - /// Use this property to specify a value that you would like to hide. For example, specify "0" - /// if you want to hide zero values, or use property to do this. - /// You also may use this property to hide default DateTime values (such as 1/1/1900). - /// In this case you need to specify a string containing both date and time, for example: - /// "1/1/1900 0:00:00". - /// - /// FastReport uses the ToString conversion to compare the expression value with this property. - /// This conversion depends on regional settings selected in the Control Panel, so be aware of this - /// if you going to distribute your report worldwide. - /// - /// - [Category("Behavior")] - public string HideValue - { - get { return hideValue; } - set { hideValue = value; } - } + /// + /// Gets or sets padding within the text object. + /// + [Category("Layout")] + public Padding Padding + { + get { return padding; } + set { padding = value; } + } - /// - /// Gets or sets a string that will be displayed instead of a null value. - /// - [Category("Behavior")] - public string NullValue - { - get { return nullValue; } - set { nullValue = value; } - } + /// + /// Gets or sets a value indicating that zero values must be hidden. + /// + [Category("Behavior")] + [DefaultValue(false)] + public bool HideZeros + { + get { return hideZeros; } + set { hideZeros = value; } + } - /// - /// Gets or sets the formatter that will be used to format data in the Text object. - /// - /// - /// The default formatter does nothing, i.e. it shows expression values with no formatting. - /// To set another formatting, create a new formatter and assign it to this property. - /// If there are several expressions in the text, use the property - /// to format each expression value. - /// - /// This example shows how to set currency formatter. - /// - /// TextObject text1; - /// text1.Format = new CurrencyFormat(); - /// - /// - [Category("Data")] - [Editor("FastReport.TypeEditors.FormatEditor, FastReport", typeof(UITypeEditor))] - public FormatBase Format - { - get { return formats.Count == 0 ? new GeneralFormat() : formats[0]; } - set - { - if (value == null) - value = new GeneralFormat(); - if (formats.Count == 0) - formats.Add(value); - else - formats[0] = value; - } - } + /// + /// Gets or sets a value that will be hidden. + /// + /// + /// Use this property to specify a value that you would like to hide. For example, specify "0" + /// if you want to hide zero values, or use property to do this. + /// You also may use this property to hide default DateTime values (such as 1/1/1900). + /// In this case you need to specify a string containing both date and time, for example: + /// "1/1/1900 0:00:00". + /// + /// FastReport uses the ToString conversion to compare the expression value with this property. + /// This conversion depends on regional settings selected in the Control Panel, so be aware of this + /// if you going to distribute your report worldwide. + /// + /// + [Category("Behavior")] + public string HideValue + { + get { return hideValue; } + set { hideValue = value; } + } - /// - /// Gets or sets a value that specifies how the report engine processes this text object. - /// - /// - /// Use this property to perform such task as "print a total value in the group header". Normally, - /// all total values are calculated in the footers (for example, in a group footer). If you try to print - /// a total value in the group header, you will get 0. If you set this property to - /// ProcessAt.DataFinished, FastReport will do the following: - /// - /// - /// print the object (with wrong value); - /// - /// - /// print all related data rows; - /// - /// - /// calculate the correct object's value and replace old (wrong) value with the new one. - /// - /// - /// - /// This option will not work if you set the to true. - /// - /// - [Category("Behavior")] - [DefaultValue(ProcessAt.Default)] - public ProcessAt ProcessAt - { - get { return processAt; } - set { processAt = value; } - } - - /// - /// Gets the collection of formatters. - /// - /// - /// This property is used to set format for each expression contained in the text. - /// For example, if the TextObject contains two expressions: - /// Today is [Date]; Page [PageN] - /// you can use the following code to format these expressions separately: - /// - /// text1.Formats.Clear(); - /// text1.Formats.Add(new DateFormat()); - /// text1.Formats.Add(new NumberFormat()); - /// - /// - [Browsable(false)] - public FormatCollection Formats - { - get { return formats; } - } + /// + /// Gets or sets a string that will be displayed instead of a null value. + /// + [Category("Behavior")] + public string NullValue + { + get { return nullValue; } + set { nullValue = value; } + } - /// - /// Gets or sets a value that determines how to display duplicate values. - /// - [DefaultValue(Duplicates.Show)] - [Category("Behavior")] - public Duplicates Duplicates - { - get { return duplicates; } - set { duplicates = value; } - } + /// + /// Gets or sets the formatter that will be used to format data in the Text object. + /// + /// + /// The default formatter does nothing, i.e. it shows expression values with no formatting. + /// To set another formatting, create a new formatter and assign it to this property. + /// If there are several expressions in the text, use the property + /// to format each expression value. + /// + /// This example shows how to set currency formatter. + /// + /// TextObject text1; + /// text1.Format = new CurrencyFormat(); + /// + /// + [Category("Data")] + [Editor("FastReport.TypeEditors.FormatEditor, FastReport", typeof(UITypeEditor))] + public FormatBase Format + { + get { return formats.Count == 0 ? new GeneralFormat() : formats[0]; } + set + { + if (value == null) + value = new GeneralFormat(); + if (formats.Count == 0) + formats.Add(value); + else + formats[0] = value; + } + } - /// - /// Gets a value of expression contained in the object's text. - /// - [Browsable(false)] - public object Value - { - get { return value; } - } - - /// - /// Gets or sets editable for pdf export - /// - [Category("Behavior")] - [DefaultValue(false)] - public bool Editable - { - get { return editable; } - set { editable = value; } - } - #endregion + /// + /// Gets or sets a value that specifies how the report engine processes this text object. + /// + /// + /// Use this property to perform such task as "print a total value in the group header". Normally, + /// all total values are calculated in the footers (for example, in a group footer). If you try to print + /// a total value in the group header, you will get 0. If you set this property to + /// ProcessAt.DataFinished, FastReport will do the following: + /// + /// + /// print the object (with wrong value); + /// + /// + /// print all related data rows; + /// + /// + /// calculate the correct object's value and replace old (wrong) value with the new one. + /// + /// + /// + /// This option will not work if you set the to true. + /// + /// + [Category("Behavior")] + [DefaultValue(ProcessAt.Default)] + public ProcessAt ProcessAt + { + get { return processAt; } + set { processAt = value; } + } - #region Protected Methods - /// - protected override void DeserializeSubItems(FRReader reader) - { - if (String.Compare(reader.ItemName, "Formats", true) == 0) - reader.Read(Formats); - else - base.DeserializeSubItems(reader); - } - #endregion + /// + /// Gets the collection of formatters. + /// + /// + /// This property is used to set format for each expression contained in the text. + /// For example, if the TextObject contains two expressions: + /// Today is [Date]; Page [PageN] + /// you can use the following code to format these expressions separately: + /// + /// text1.Formats.Clear(); + /// text1.Formats.Add(new DateFormat()); + /// text1.Formats.Add(new NumberFormat()); + /// + /// + [Browsable(false)] + public FormatCollection Formats + { + get { return formats; } + } - #region Public Methods - /// - public override void Assign(Base source) - { - base.Assign(source); - - TextObjectBase src = source as TextObjectBase; - Text = src.Text; - Padding = src.Padding; - AllowExpressions = src.AllowExpressions; - Brackets = src.Brackets; - HideZeros = src.HideZeros; - HideValue = src.HideValue; - NullValue = src.NullValue; - ProcessAt = src.ProcessAt; - Formats.Assign(src.Formats); - Duplicates = src.Duplicates; - Editable = src.Editable; - } + /// + /// Gets or sets a value that determines how to display duplicate values. + /// + [DefaultValue(Duplicates.Show)] + [Category("Behavior")] + public Duplicates Duplicates + { + get { return duplicates; } + set { duplicates = value; } + } - /// - public override void Serialize(FRWriter writer) - { - TextObjectBase c = writer.DiffObject as TextObjectBase; - base.Serialize(writer); - - if (Text != c.Text) - writer.WriteStr("Text", Text); - if (Padding != c.Padding) - writer.WriteValue("Padding", Padding); - if (writer.SerializeTo != SerializeTo.Preview) - { - if (AllowExpressions != c.AllowExpressions) - writer.WriteBool("AllowExpressions", AllowExpressions); - if (Brackets != c.Brackets) - writer.WriteStr("Brackets", Brackets); - if (HideZeros != c.HideZeros) - writer.WriteBool("HideZeros", HideZeros); - if (HideValue != c.HideValue) - writer.WriteStr("HideValue", HideValue); - if (NullValue != c.NullValue) - writer.WriteStr("NullValue", NullValue); - if (ProcessAt != c.ProcessAt) - writer.WriteValue("ProcessAt", ProcessAt); - if (Duplicates != c.Duplicates) - writer.WriteValue("Duplicates", Duplicates); - } - if (Editable) - writer.WriteBool("Editable", Editable); - if (Formats.Count > 1) - writer.Write(Formats); - else - Format.Serialize(writer, "Format.", c.Format); - } + /// + /// Gets a value of expression contained in the object's text. + /// + [Browsable(false)] + public object Value + { + get { return value; } + } - /// - public override void ExtractMacros() - { - Text = ExtractDefaultMacros(Text); - } + /// + /// Gets or sets editable for pdf export + /// + [Category("Behavior")] + [DefaultValue(false)] + public bool Editable + { + get { return editable; } + set { editable = value; } + } + #endregion - internal void SetValue(object value) - { - this.value = value; - } + #region Protected Methods + /// + protected override void DeserializeSubItems(FRReader reader) + { + if (String.Compare(reader.ItemName, "Formats", true) == 0) + reader.Read(Formats); + else + base.DeserializeSubItems(reader); + } + #endregion - internal string GetTextWithBrackets(string text) - { - string[] brackets = Brackets.Split(new char[] { ',' }); - return brackets[0] + text + brackets[1]; - } + #region Public Methods + /// + public override void Assign(Base source) + { + base.Assign(source); + + TextObjectBase src = source as TextObjectBase; + Text = src.Text; + Padding = src.Padding; + AllowExpressions = src.AllowExpressions; + Brackets = src.Brackets; + HideZeros = src.HideZeros; + HideValue = src.HideValue; + NullValue = src.NullValue; + ProcessAt = src.ProcessAt; + Formats.Assign(src.Formats); + Duplicates = src.Duplicates; + Editable = src.Editable; + } - internal string GetTextWithoutBrackets(string text) - { - string[] brackets = Brackets.Split(new char[] { ',' }); - if (text.StartsWith(brackets[0])) - text = text.Remove(0, brackets[0].Length); - if (text.EndsWith(brackets[1])) - text = text.Remove(text.Length - brackets[1].Length); - return text; - } + /// + public override void Serialize(FRWriter writer) + { + TextObjectBase c = writer.DiffObject as TextObjectBase; + base.Serialize(writer); + + if (Text != c.Text) + writer.WriteStr("Text", Text); + if (Padding != c.Padding) + writer.WriteValue("Padding", Padding); + if (writer.SerializeTo != SerializeTo.Preview) + { + if (AllowExpressions != c.AllowExpressions) + writer.WriteBool("AllowExpressions", AllowExpressions); + if (Brackets != c.Brackets) + writer.WriteStr("Brackets", Brackets); + if (HideZeros != c.HideZeros) + writer.WriteBool("HideZeros", HideZeros); + if (HideValue != c.HideValue) + writer.WriteStr("HideValue", HideValue); + if (NullValue != c.NullValue) + writer.WriteStr("NullValue", NullValue); + if (ProcessAt != c.ProcessAt) + writer.WriteValue("ProcessAt", ProcessAt); + if (Duplicates != c.Duplicates) + writer.WriteValue("Duplicates", Duplicates); + } + if (Editable) + writer.WriteBool("Editable", Editable); + if (Formats.Count > 1) + writer.Write(Formats); + else + Format.Serialize(writer, "Format.", c.Format); + } - internal string FormatValue(object value) - { - return FormatValue(value, 0); - } + /// + public override void ExtractMacros() + { + Text = ExtractDefaultMacros(Text); + } - internal string FormatValue(object value, int formatIndex) - { - this.value = value; - string formattedValue = ""; - if (value == null || value is DBNull) - { - formattedValue = NullValue; - } - else - { - if (formatIndex < Formats.Count) - formattedValue = Formats[formatIndex].FormatValue(value); - else - formattedValue = Format.FormatValue(value); - - if (!String.IsNullOrEmpty(HideValue)) + internal void SetValue(object value) { - if (value.ToString() == HideValue) - formattedValue = ""; + this.value = value; } - if (HideZeros) + + internal string GetTextWithBrackets(string text) { - Variant v = new Variant(value); - if ((v.IsNumeric && v == 0) || (v.IsDate && v.ToDateTime() == DateTime.MinValue)) - formattedValue = ""; + string[] brackets = Brackets.Split(new char[] { ',' }); + return brackets[0] + text + brackets[1]; } - } - return formattedValue; - } + internal string GetTextWithoutBrackets(string text) + { + string[] brackets = Brackets.Split(new char[] { ',' }); + if (text.StartsWith(brackets[0])) + text = text.Remove(0, brackets[0].Length); + if (text.EndsWith(brackets[1])) + text = text.Remove(text.Length - brackets[1].Length); + return text; + } - internal string CalcAndFormatExpression(string expression, int expressionIndex) - { - try - { - return FormatValue(Report.Calc(expression), expressionIndex); - } - catch (Exception e) - { - throw new Exception(Name + ": " + Res.Get("Messages,ErrorInExpression") + ": " + expression, e.InnerException); - } - } - #endregion + internal string FormatValue(object value) + { + return FormatValue(value, 0); + } - /// - /// Initializes a new instance of the class with default settings. - /// - public TextObjectBase() - { - allowExpressions = true; - brackets = "[,]"; - padding = new Padding(2, 0, 2, 0); - hideValue = ""; - nullValue = ""; - text = ""; - formats = new FormatCollection(); - formats.Add(new GeneralFormat()); + internal string FormatValue(object value, int formatIndex) + { + this.value = value; + string formattedValue = ""; + if (value == null || value is DBNull) + { + formattedValue = NullValue; + } + else + { + if (formatIndex < Formats.Count) + formattedValue = Formats[formatIndex].FormatValue(value); + else + formattedValue = Format.FormatValue(value); + + if (!String.IsNullOrEmpty(HideValue)) + { + if (value.ToString() == HideValue) + formattedValue = ""; + } + if (HideZeros) + { + Variant v = new Variant(value); + if ((v.IsNumeric && v == 0) || (v.IsDate && v.ToDateTime() == DateTime.MinValue)) + formattedValue = ""; + } + } + + return formattedValue; + } + + internal string CalcAndFormatExpression(string expression, int expressionIndex) + { + try + { + return FormatValue(Report.Calc(expression), expressionIndex); + } + catch (Exception e) + { + throw new Exception(Name + ": " + Res.Get("Messages,ErrorInExpression") + ": " + expression, e.InnerException); + } + } + + /// + /// Returns the text to display. + /// + /// The text to display. + /// This method is used to display simplified DB field names in the designer. In runtime, it returns the Text property value. + public virtual string GetDisplayText() + { + return Text; + } + + #endregion + + /// + /// Initializes a new instance of the class with default settings. + /// + public TextObjectBase() + { + allowExpressions = true; + brackets = "[,]"; + padding = new Padding(2, 0, 2, 0); + hideValue = ""; + nullValue = ""; + text = ""; + formats = new FormatCollection(); + formats.Add(new GeneralFormat()); + } } - } } diff --git a/FastReport.Base/Utils/Res.cs b/FastReport.Base/Utils/Res.cs index 8bd4e6da..3245397c 100644 --- a/FastReport.Base/Utils/Res.cs +++ b/FastReport.Base/Utils/Res.cs @@ -153,9 +153,10 @@ public static void LoadLocale(CultureInfo culture) localeFile = FindLocaleFile(ref culture, localeFolder); } + // Find 'Localization' directory from FastReport.Localization package if (string.IsNullOrEmpty(localeFile)) { - localeFolder = Path.Combine(localeFolder, "Localization"); + localeFolder = Path.Combine(Config.ApplicationFolder, "Localization"); if (Directory.Exists(localeFolder)) { localeFile = FindLocaleFile(ref culture, localeFolder); diff --git a/FastReport.Core.Web/Application/ExportMenuSettings.cs b/FastReport.Core.Web/Application/ExportMenuSettings.cs index 403728ce..ab96d2a6 100644 --- a/FastReport.Core.Web/Application/ExportMenuSettings.cs +++ b/FastReport.Core.Web/Application/ExportMenuSettings.cs @@ -1,75 +1,455 @@ -namespace FastReport.Web +using System; + +namespace FastReport.Web { public class ExportMenuSettings - { + { + private const Exports defaultExports = + Exports.Prepared | Exports.Pdf | Exports.Excel2007 | Exports.Word2007 | Exports.Text | Exports.Rtf + | Exports.Xps | Exports.Ods | Exports.Odt | Exports.XmlExcel | Exports.Csv; + + private const Exports allExports = + Exports.Prepared | Exports.Pdf | Exports.Excel2007 | Exports.Word2007 | Exports.PowerPoint2007 | Exports.XmlExcel + | Exports.Text | Exports.Rtf | Exports.Xps | Exports.Ods | Exports.Odt | Exports.Dbf | Exports.Csv | Exports.Mht + | Exports.HTML | Exports.Hpgl /*| Exports.Email*/ | Exports.Dxf | Exports.Json | Exports.LaTeX /*| Exports.Image*/ + | Exports.Ppml | Exports.PS | Exports.Xaml | Exports.Zpl | Exports.Excel97 | Exports.Svg; + /// /// Show Exports menu /// public bool Show { get; set; } = true; - + + /// + /// Used to set exports in toolbar. + /// + public Exports ExportTypes { get; set; } = defaultExports; + /// + /// Get an instance of ExportMenuSettings with default exports + /// Default : Prepared, Pdf, Excel2007, Word2007, Text, Rtf, Xps, Ods, Odt, XmlExcel, Csv + /// + public static ExportMenuSettings Default => new ExportMenuSettings + { + ExportTypes = defaultExports + }; + /// + /// Get an instance of ExportMenuSettings with all exports + /// + public static ExportMenuSettings All => new ExportMenuSettings + { + ExportTypes = allExports + }; /// /// Switch a visibility of prepared report export in toolbar /// - public bool ShowPreparedReport { get; set; } = true; + public bool ShowPreparedReport + { + get => (ExportTypes & Exports.Prepared) > 0; + set + { + if (value) + ExportTypes |= Exports.Prepared; + else + ExportTypes &= ~Exports.Prepared; + } + } + #if !OPENSOURCE /// /// Switches a visibility of PDF (Adobe Acrobat) export in toolbar. /// - public bool ShowPdfExport { get; set; } = true; + public bool ShowPdfExport + { + get => (ExportTypes & Exports.Pdf) > 0; + set + { + if (value) + ExportTypes |= Exports.Pdf; + + else + ExportTypes &= ~Exports.Pdf; + } + } + /// /// Switches a visibility of Excel 2007 export in toolbar. /// - public bool ShowExcel2007Export { get; set; } = true; + public bool ShowExcel2007Export { + get => (ExportTypes & Exports.Excel2007) > 0; + set + { + if (value) + ExportTypes |= Exports.Excel2007; + else + ExportTypes &= ~Exports.Excel2007; + } + } + /// /// Switches a visibility of Word 2007 export in toolbar. /// - public bool ShowWord2007Export { get; set; } = true; + public bool ShowWord2007Export { + get => (ExportTypes & Exports.Word2007) > 0; + set + { + if (value) + ExportTypes |= Exports.Word2007; + else + ExportTypes &= ~Exports.Word2007; + } + } + /// /// Switches a visibility of PowerPoint 2007 export in toolbar. /// - public bool ShowPowerPoint2007Export { get; set; } = false; + public bool ShowPowerPoint2007Export { + get => (ExportTypes & Exports.PowerPoint2007) > 0; + set + { + if (value) + ExportTypes |= Exports.PowerPoint2007; + else + ExportTypes &= ~Exports.PowerPoint2007; + } + } + /// /// Switch a visibility of text (plain text) export in toolbar /// - public bool ShowTextExport { get; set; } = true; + public bool ShowTextExport { + get => (ExportTypes & Exports.Text) > 0; + set + { + if (value) + ExportTypes |= Exports.Text; + else + ExportTypes &= ~Exports.Text; + } + } + /// /// Switches a visibility of RTF export in toolbar. /// - public bool ShowRtfExport { get; set; } = true; + public bool ShowRtfExport { + get => (ExportTypes & Exports.Rtf) > 0; + set + { + if (value) + ExportTypes |= Exports.Rtf; + else + ExportTypes &= ~Exports.Rtf; + } + } + /// /// Switches a visibility of XPS export in toolbar. /// - public bool ShowXpsExport { get; set; } = true; + public bool ShowXpsExport { + get => (ExportTypes & Exports.Xps) > 0; + set + { + if (value) + ExportTypes |= Exports.Xps; + else + ExportTypes &= ~Exports.Xps; + } + } + /// /// Switches a visibility of Open Office Spreadsheet (ODS) export in toolbar. /// - public bool ShowOdsExport { get; set; } = true; + public bool ShowOdsExport { + get => (ExportTypes & Exports.Ods) > 0; + set + { + if (value) + ExportTypes |= Exports.Ods; + else + ExportTypes &= ~Exports.Ods; + } + } + /// /// Switches a visibility of Open Office Text (ODT) export in toolbar /// - public bool ShowOdtExport { get; set; } = true; + public bool ShowOdtExport { + get => (ExportTypes & Exports.Odt) > 0; + set + { + if (value) + ExportTypes |= Exports.Odt; + else + ExportTypes &= ~Exports.Odt; + } + } + /// /// Switches a visibility of XML (Excel) export in toolbar. /// - public bool ShowXmlExcelExport { get; set; } = true; + public bool ShowXmlExcelExport { + get => (ExportTypes & Exports.XmlExcel) > 0; + set + { + if (value) + ExportTypes |= Exports.XmlExcel; + else + ExportTypes &= ~Exports.XmlExcel; + } + } + /// /// Switches a visibility of DBF export in toolbar. /// - public bool ShowDbfExport { get; set; } = false; + public bool ShowDbfExport { + get => (ExportTypes & Exports.Dbf) > 0; + set + { + if (value) + ExportTypes |= Exports.Dbf; + else + ExportTypes &= ~Exports.Dbf; + } + } + /// /// Switches visibility the CSV (comma separated values) export in toolbar. /// - public bool ShowCsvExport { get; set; } = true; + public bool ShowCsvExport { + get => (ExportTypes & Exports.Csv) > 0; + set + { + if (value) + ExportTypes |= Exports.Csv; + else + ExportTypes &= ~Exports.Csv; + } + } + /// /// Switches visibility the MHT export in toolbar. /// - public bool ShowMhtExport { get; set; } = false; -#endif - + public bool ShowMhtExport { + get => (ExportTypes & Exports.Mht) > 0; + set + { + if (value) + ExportTypes |= Exports.Mht; + else + ExportTypes &= ~Exports.Mht; + } + } - public ExportMenuSettings() + /// + /// Switches visibility the HTML export in toolbar. + /// + public bool ShowHTMLExport + { + get => (ExportTypes & Exports.HTML) > 0; + set + { + if (value) + ExportTypes |= Exports.HTML; + else + ExportTypes &= ~Exports.HTML; + } + } + /// + /// Switches visibility the HPGL export in toolbar. + /// + public bool ShowHpglExport + { + get => (ExportTypes & Exports.Hpgl) > 0; + set + { + if (value) + ExportTypes |= Exports.Hpgl; + else + ExportTypes &= ~Exports.Hpgl; + } + } + //public bool ShowEmailExport + //{ + // get => (ExportTypes & Exports.Email) > 0; + // set + // { + // if (value) + // ExportTypes |= Exports.Email; + // else + // ExportTypes &= ~Exports.Email; + // } + //} + /// + /// Switches visibility the DXF export in toolbar. + /// + public bool ShowDxfExport + { + get => (ExportTypes & Exports.Dxf) > 0; + set + { + if (value) + ExportTypes |= Exports.Dxf; + else + ExportTypes &= ~Exports.Dxf; + } + } + /// + /// Switches visibility the Json export in toolbar. + /// + public bool ShowJsonExport + { + get => (ExportTypes & Exports.Json) > 0; + set + { + if (value) + ExportTypes |= Exports.Json; + else + ExportTypes &= ~Exports.Json; + } + } + /// + /// Switches visibility the LaTeX export in toolbar. + /// + public bool ShowLaTeXExport + { + get => (ExportTypes & Exports.LaTeX) > 0; + set + { + if (value) + ExportTypes |= Exports.LaTeX; + else + ExportTypes &= ~Exports.LaTeX; + } + } + //public bool ShowImageExport + //{ + // get => (ExportTypes & Exports.Image) > 0; + // set + // { + // if (value) + // ExportTypes |= Exports.Image; + // else + // ExportTypes &= ~Exports.Image; + // } + //} + /// + /// Switches visibility the PPML export in toolbar. + /// + public bool ShowPpmlExport + { + get => (ExportTypes & Exports.Ppml) > 0; + set + { + if (value) + ExportTypes |= Exports.Ppml; + else + ExportTypes &= ~Exports.Ppml; + } + } + /// + /// Switches visibility the PS export in toolbar. + /// + public bool ShowPSExport + { + get => (ExportTypes & Exports.PS) > 0; + set + { + if (value) + ExportTypes |= Exports.PS; + else + ExportTypes &= ~Exports.PS; + } + } + /// + /// Switches visibility the XAML export in toolbar. + /// + public bool ShowXamlExport + { + get => (ExportTypes & Exports.Xaml) > 0; + set + { + if (value) + ExportTypes |= Exports.Xaml; + else + ExportTypes &= ~Exports.Xaml; + } + } + /// + /// Switches visibility the ZPL export in toolbar. + /// + public bool ShowZplExport { + get => (ExportTypes & Exports.Zpl) > 0; + set + { + if (value) + ExportTypes |= Exports.Zpl; + else + ExportTypes &= ~Exports.Zpl; + } } + /// + /// Switches visibility the Excel-97 export in toolbar. + /// + public bool ShowExcel97Export + { + get => (ExportTypes & Exports.Excel97) > 0; + set + { + if (value) + ExportTypes |= Exports.Excel97; + else + ExportTypes &= ~Exports.Excel97; + } + } + /// + /// Switches visibility the SVG export in toolbar. + /// + public bool ShowSvgExport + { + get => (ExportTypes & Exports.Svg) > 0; + set + { + if (value) + ExportTypes |= Exports.Svg; + else + ExportTypes &= ~Exports.Svg; + } + } +#endif + + } + /// + ///Used to select exports + /// + [Flags] + public enum Exports + { + Prepared = 1, + Pdf = 2, + Excel2007 = 4, + Word2007 = 8, + PowerPoint2007 = 16, + XmlExcel = 32, + Text = 64, + Rtf = 128, + Xps = 256, + Ods = 512, + Odt = 1024, + Dbf = 2048, + Csv = 4096, + Mht = 8192, + HTML = 16384, + Hpgl = 32768, + //Email = 65536, + Dxf = 131_072, + Json = 262_144, + LaTeX = 524_288, + //Image = 1_048_576, + Ppml = 2_097_152, + PS = 4_194_304, + Xaml = 8_388_608, + Zpl = 16_777_216, + Excel97 = 33_554_432, + Svg = 67_108_864, } } \ No newline at end of file diff --git a/FastReport.Core.Web/Application/Toolbar.Localization.cs b/FastReport.Core.Web/Application/Toolbar.Localization.cs new file mode 100644 index 00000000..264836e3 --- /dev/null +++ b/FastReport.Core.Web/Application/Toolbar.Localization.cs @@ -0,0 +1,164 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using FastReport.Web.Application; + +namespace FastReport.Web +{ + internal class ToolbarLocalization + { + + internal readonly string reloadTxt; + internal readonly string saveTxt; + internal readonly string preparedTxt; + internal readonly string printTxt; + internal readonly string pdfTxt; + internal readonly string excel2007Txt; + internal readonly string word2007Txt; + internal readonly string powerPoint2007Txt; + internal readonly string textTxt; + internal readonly string dbfTxt; + internal readonly string rtfTxt; + internal readonly string xpsTxt; + internal readonly string odsTxt; + internal readonly string odtTxt; + internal readonly string xmlTxt; + internal readonly string csvTxt; + internal readonly string excel97Txt; + internal readonly string emailTxt; + internal readonly string hpglTxt; + internal readonly string htmlTxt; + internal readonly string imageTxt; + internal readonly string jsonTxt; + internal readonly string dxfTxt; + internal readonly string latexTxt; + internal readonly string ppmlTxt; + internal readonly string psTxt; + internal readonly string xamlTxt; + internal readonly string zplTxt; + internal readonly string svgTxt; + internal readonly string mhtTxt; + + internal readonly string currentPageTxt; + internal readonly string totalPagesTxt; + internal readonly string firstPageTxt; + internal readonly string previousPageTxt; + internal readonly string nextPageTxt; + internal readonly string lastPageTxt; + + internal readonly string printFromBrowserTxt; + internal readonly string printFromPdf; + + internal readonly string zoomTxt; + + /// + /// Default toolbar localization + /// + public ToolbarLocalization() + { + reloadTxt = "Reload"; + saveTxt = "Save"; + preparedTxt = "Prepared report"; + printTxt = "Print"; + pdfTxt = "Adobe PDF"; + excel2007Txt = "Microsoft Excel 2007"; + word2007Txt = "Microsoft Word 2007"; + powerPoint2007Txt = "Microsoft PowerPoint 2007"; + textTxt = "Text File/Matrix Printer"; + rtfTxt = "Rich Text"; + xpsTxt = "Microsoft XPS"; + odsTxt = "OpenOffice Calc"; + odtTxt = "OpenOffice Writer"; + xmlTxt = "XML (Excel) table"; + dbfTxt = "DBF"; + mhtTxt = "MHT"; + csvTxt = "CSV file"; + dxfTxt = "DXF file"; + excel97Txt = "MS Office Excel 97-2003"; + //emailTxt = "Email"; // Required modal window + hpglTxt = "HPGL"; + htmlTxt = "HTML"; + svgTxt = "SVG"; + //imageTxt = "Image"; // Required modal window + jsonTxt = "Json"; + ppmlTxt = "PPML"; + latexTxt = "Latex"; + psTxt = "Post Script"; + xamlTxt = "XAML"; + zplTxt = " Zpl"; + + currentPageTxt = "Current page"; + totalPagesTxt = "Total Pages"; + firstPageTxt = "First page"; + previousPageTxt = "Previous page"; + nextPageTxt = "Next page"; + lastPageTxt = "Last page"; + + printFromBrowserTxt = "Print from browser"; + printFromPdf = "Print from PDF viewer"; + + zoomTxt = "Zoom"; + } + + /// + /// Localized toolbar items + /// + /// WebResources for localization + /// + /// new ToolbarLocalization(webReport.Res); + /// + public ToolbarLocalization(IWebRes Res) + { + Res.Root("Web"); + + reloadTxt = Res.Get("Refresh"); + printTxt = Res.Get("Print"); + zoomTxt = Res.Get("Zoom"); + currentPageTxt = Res.Get("EnterPage"); + totalPagesTxt = Res.Get("TotalPages"); + firstPageTxt = Res.Get("First"); + previousPageTxt = Res.Get("Prev"); + nextPageTxt = Res.Get("Next"); + lastPageTxt = Res.Get("Last"); + + printFromBrowserTxt = Res.Get("PrintFromBrowser"); + printFromPdf = Res.Get("PrintFromAcrobat"); + + Res.Root("Preview"); + + saveTxt = Res.Get("Save"); + preparedTxt = Res.Get("SaveNative"); + + Res.Root("Export"); + + pdfTxt = Res.Get("Pdf"); + excel2007Txt = Res.Get("Xlsx"); + word2007Txt = Res.Get("Docx"); + powerPoint2007Txt = Res.Get("Pptx"); + textTxt = Res.Get("Text"); + rtfTxt = Res.Get("RichText"); + xpsTxt = Res.Get("Xps"); + odsTxt = Res.Get("Ods"); + dbfTxt = Res.Get("Dbf"); + odtTxt = Res.Get("Odt"); + xmlTxt = Res.Get("Xml"); + csvTxt = Res.Get("Csv"); + svgTxt = Res.Get("Svg"); + excel97Txt = Res.Get("Xls"); + hpglTxt = Res.Get("Hpgl"); + htmlTxt = Res.Get("Html"); + jsonTxt = Res.Get("Json"); + dxfTxt = Res.Get("Dxf"); + latexTxt = Res.Get("LaTeX"); + ppmlTxt = Res.Get("Ppml"); + psTxt = Res.Get("PS"); + xamlTxt = Res.Get("Xaml"); + zplTxt = Res.Get("Zpl"); + mhtTxt = Res.Get("Mht"); + //emailTxt = Res.Get("Email"); // Required modal window + //imageTxt = Res.Get("Image"); // Required modal window + } + + } +} diff --git a/FastReport.Core.Web/Application/ToolbarSettings.cs b/FastReport.Core.Web/Application/ToolbarSettings.cs index e0023269..f9b77237 100644 --- a/FastReport.Core.Web/Application/ToolbarSettings.cs +++ b/FastReport.Core.Web/Application/ToolbarSettings.cs @@ -2,17 +2,15 @@ using System.Collections.Generic; using System.IO; using System.Text; -using Microsoft.AspNetCore.Html; using System.Threading.Tasks; using System.Linq; -using FastReport.Web.Controllers; -using FastReport.Web.Application; using System.Drawing; namespace FastReport.Web { public class ToolbarSettings { + public static ToolbarSettings Default => new ToolbarSettings(); public bool Show { get; set; } = true; @@ -20,32 +18,307 @@ public class ToolbarSettings #if DIALOGS public bool ShowOnDialogPage { get; set; } = true; #endif + [Obsolete("Please, use Position")] + public bool ShowBottomToolbar + { + get => Position == Positions.Bottom; + set + { + if (value) + { + Position = Positions.Bottom; + } + else + Position = default; + } + } - public bool ShowBottomToolbar { get; set; } = false; - - public ExportMenuSettings Exports { get; set; } = new ExportMenuSettings(); + public ExportMenuSettings Exports { get; set; } = ExportMenuSettings.Default; public bool ShowPrevButton { get; set; } = true; public bool ShowNextButton { get; set; } = true; public bool ShowFirstButton { get; set; } = true; public bool ShowLastButton { get; set; } = true; - public bool ShowRefreshButton { get; set; } = true; public bool ShowZoomButton { get; set; } = true; - public bool ShowPrint { get; set; } = true; public bool PrintInHtml { get; set; } = true; #if !OPENSOURCE public bool PrintInPdf { get; set; } = true; #endif + /// + /// Use to change ToolbarColor, + /// Default value Color.LightGray + /// + public Color Color { get; set; } = Color.LightGray; + /// + /// Use to change Toolbar DropDownMenuColor, + /// Default value Color.White + /// + public Color DropDownMenuColor { get; set; } = Color.White; + /// + /// Use to change Toolbar DropDownMenuText Color, + /// Default value Color.Black + /// + public Color DropDownMenuTextColor { get; set; } = Color.Black; + /// + /// Use to change Toolbar Position in report, + /// Default value Position.Top + /// + public Positions Position { get; set; } = Positions.Top; + /// + /// Use to add Roundness to Toolbar, + /// Default value RoundnessEnum.None + /// + public RoundnessEnum Roundness { get; set; } = RoundnessEnum.None; + /// + /// Use to change content position in Toolbar, + /// Default value ContentPositions.Left + /// + public ContentPositions ContentPosition { get; set; } = ContentPositions.Left; + /// + /// Use to change Icons color in Toolbar, + /// Default value IconColors.Black + /// + public IconColors IconColor { get; set; } = IconColors.Black; + /// + /// Use to add Transparency in icon Toolbar, + /// Default value IconTransparencyEnum.Default + /// + public IconTransparencyEnum IconTransperency { get; set; } = IconTransparencyEnum.Default; + /// + /// Use to change Font in Toolbar, + /// Default value null + /// Example syntax : new Font("Arial", 14 , FontStyle.Bold) + /// + public Font FontSettings { get; set; } = null; - public Color Color { get; set; } = Color.LightGray; - public ToolbarSettings() + internal string UserFontSettings { + get + { + if (FontSettings != null) + { + return FontSettings.Size + "em " + FontSettings.OriginalFontName + " " + FontSettings.Style; + } + else + return "15em Verdana,Arial sans-serif Regular"; + } + } + + internal int VerticalToolbarHeight + { + get + { + switch (Position) + { + case Positions.Left: + case Positions.Right: + return 100; + default: + return 40; + } + } + } + internal int TopOrBottom + { + get + { + switch (Position) + { + case Positions.Bottom: + return 1; + default: + return -1; + } + } } + internal string Vertical + { + get + { + + switch (Position) + { + case Positions.Right: + return "row-reverse"; + case Positions.Left: + return "row"; + default: + return "column"; + } + } + + } + internal int DropDownMenuPositionLeft + { + get + { + switch (Position) + { + case Positions.Left: + case Positions.Right: + return 50; + default: + return 0; + } + } + } + internal int DropDownMenuPositionTops + { + get + { + switch (Position) + { + case Positions.Right: + case Positions.Left: + return 7; + default: + return 0; + } + } + } + internal string RowOrColumn + { + get + { + switch (Position) + { + case Positions.Left: + case Positions.Right: + return "column"; + default: + return "row"; + } + } + } + internal string Content + { + get + { + switch (ContentPosition) + { + case ContentPositions.Center: + return "center"; + case ContentPositions.Right: + return "flex-end"; + default: + return "flex-start"; + } + } + } + internal string DropDownMenuPosition + { + get + { + switch (Position) + { + case Positions.Left: + return "left:48px;" + "text-align:left;" + "top:8px;"; + case Positions.Right: + return "right:48px;" + "text-align:right;" + "top:8px;"; + case Positions.Bottom: + return "bottom:40px;"; + default: + return "top: 40px;"; + } + } + } + internal string TabsPositionSettings + { + get + { + switch (Position) + { + case Positions.Left: + return "179px"; + case Positions.Right: + return "179px"; + case Positions.Bottom: + return "order:1;"; + default: + return "auto"; + } + } + } + internal int ToolbarRoundness + { + get + { + switch (Roundness) + { + case RoundnessEnum.High: + return 10; + case RoundnessEnum.Medium: + return 5; + case RoundnessEnum.Low: + return 3; + case RoundnessEnum.None: + default: + return 0; + } + } + } + internal int ColorIcon + { + get + { + switch (IconColor) + { + case IconColors.White: + return 1; + default: + return 0; + } + } + } + internal string TransparencyIcon + { + get + { + switch (IconTransperency) + { + case IconTransparencyEnum.Low: + return "0.9"; + case IconTransparencyEnum.Medium: + return "0.7"; + case IconTransparencyEnum.Default: + return "0.5"; + default: + return "0.5"; + } + } + } + } + public enum IconColors + { + White, Black + } + public enum IconTransparencyEnum + { + Low, Medium, High, Default + } + public enum Positions + { + Top = 0, + Bottom, + Right, + Left, + } + public enum ContentPositions + { + Left, + Right, + Center, + } + public enum RoundnessEnum + { + Low, Medium, High, None + } + } diff --git a/FastReport.Core.Web/Application/WebReport.Exports.cs b/FastReport.Core.Web/Application/WebReport.Exports.cs index 68c279a4..a364674b 100644 --- a/FastReport.Core.Web/Application/WebReport.Exports.cs +++ b/FastReport.Core.Web/Application/WebReport.Exports.cs @@ -63,6 +63,7 @@ partial class WebReport /// Switches visibility the MHT export in toolbar. /// public bool ShowMhtExport { get => Toolbar.Exports.ShowMhtExport; set => Toolbar.Exports.ShowMhtExport = value; } + #endif } } diff --git a/FastReport.Core.Web/Application/WebReport.cs b/FastReport.Core.Web/Application/WebReport.cs index 6dd9de23..4fe7312b 100644 --- a/FastReport.Core.Web/Application/WebReport.cs +++ b/FastReport.Core.Web/Application/WebReport.cs @@ -161,6 +161,7 @@ public bool ReportPrepared /// public ToolbarSettings Toolbar { get; set; } = ToolbarSettings.Default; + [Obsolete("Please, use Toolbar.Show")] public bool ShowToolbar { get => Toolbar.Show; set => Toolbar.Show = value; } [Obsolete("Please, use Toolbar.ShowPrevButton")] @@ -189,8 +190,11 @@ public bool ReportPrepared public bool PrintInPdf { get => Toolbar.PrintInPdf; set => Toolbar.PrintInPdf = value; } #endif + [Obsolete("Please, use Toolbar.Position")] + public bool ShowBottomToolbar { get => Toolbar.ShowBottomToolbar; set => Toolbar.ShowBottomToolbar = value; } + public Color ToolbarColor { get => Toolbar.Color; set => Toolbar.Color = value; } #endregion diff --git a/FastReport.Core.Web/Controllers/ReportController.cs b/FastReport.Core.Web/Controllers/ReportController.cs index be7144db..f10eb9e3 100644 --- a/FastReport.Core.Web/Controllers/ReportController.cs +++ b/FastReport.Core.Web/Controllers/ReportController.cs @@ -20,6 +20,14 @@ using FastReport.Export.Text; using FastReport.Export.XAML; using FastReport.Export.Xml; +using FastReport.Export.BIFF8; +using FastReport.Export.Email; +using FastReport.Export.Hpgl; +using FastReport.Export.LaTeX; +using FastReport.Export.Zpl; +using FastReport.Export.Dxf; + + #endif namespace FastReport.Web.Controllers @@ -208,13 +216,28 @@ ExportBase GetExport(string exportFormat) switch (exportFormat) { #if !OPENSOURCE - case "pdf": + case "latex": + export = new LaTeXExport(); + break; + case "xls": + export = new Excel2003Document(); + break; + //case "email": + // export = new EmailExport(); //Required modal window + // break; + case "zpl": + export = new ZplExport(); + break; + case "hpgl": + export = new HpglExport(); + break; + case "pdf": export = new PDFExport(); break; case "rtf": export = new RTFExport(); break; - case "mht": + case "mht": export = new MHTExport(); break; case "xml": @@ -262,10 +285,13 @@ ExportBase GetExport(string exportFormat) case "json": export = new JsonExport(); break; + case "dxf": + export = new DxfExport(); + break; #endif case "html": export = new HTMLExport(); - break; + break; case "bmp": export = new ImageExport() { ImageFormat = ImageExportFormat.Bmp }; break; @@ -286,9 +312,11 @@ ExportBase GetExport(string exportFormat) case "tiff": export = new ImageExport() { ImageFormat = ImageExportFormat.Tiff }; break; + } - + return export; + } string Template_textedit_form(string text, string okText, string cancelText) => $@" diff --git a/FastReport.Core.Web/Templates/main.cs b/FastReport.Core.Web/Templates/main.cs index 653d66c3..96dcf2d6 100644 --- a/FastReport.Core.Web/Templates/main.cs +++ b/FastReport.Core.Web/Templates/main.cs @@ -13,37 +13,6 @@ partial class WebReport string template_render(bool renderBody) { - Res.Root("Web"); - string reloadTxt = Res.Get("Refresh"); - string printTxt = Res.Get("Print"); - string printFromBrowserTxt = Res.Get("PrintFromBrowser"); - string printFromPdf = Res.Get("PrintFromAcrobat"); - string zoomTxt = Res.Get("Zoom"); - string firstPageTxt = Res.Get("First"); - string previousPageTxt = Res.Get("Prev"); - string currentPageTxt = Res.Get("EnterPage"); - string nextPageTxt = Res.Get("Next"); - string lastPageTxt = Res.Get("Last"); - string totalPagesTxt = Res.Get("TotalPages"); - - Res.Root("Preview"); - string saveTxt = Res.Get("Save"); - string preparedTxt = Res.Get("SaveNative"); - Res.Root("Export"); - string pdfTxt = Res.Get("Pdf"); - string excel2007Txt = Res.Get("Xlsx"); - string word2007Txt = Res.Get("Docx"); - string pptxTxt = Res.Get("Pptx"); - string txtTxt = Res.Get("Text"); - string rtfTxt = Res.Get("RichText"); - string xpsTxt = Res.Get("Xps"); - string odsTxt = Res.Get("Ods"); - string odtTxt = Res.Get("Odt"); - string xmlTxt = Res.Get("Xml"); - string csvTxt = Res.Get("Csv"); - string dbfTxt = Res.Get("Dbf"); - string mhtTxt = Res.Get("Mht"); - return $@"
@@ -58,24 +27,8 @@ string template_render(bool renderBody)
- - {(Toolbar.ShowBottomToolbar ?$@" -{template_body(renderBody)} -{template_toolbar(renderBody, saveTxt, reloadTxt, preparedTxt, printTxt, printFromBrowserTxt, - printFromPdf, zoomTxt, firstPageTxt, previousPageTxt, currentPageTxt, nextPageTxt, - lastPageTxt, totalPagesTxt, pdfTxt, excel2007Txt, word2007Txt, pptxTxt, txtTxt, rtfTxt, xpsTxt, odsTxt, - odtTxt, xmlTxt, csvTxt, dbfTxt, mhtTxt)}" - :$@" -{template_toolbar(renderBody, saveTxt, reloadTxt, preparedTxt, printTxt, printFromBrowserTxt, - printFromPdf, zoomTxt, firstPageTxt, previousPageTxt, currentPageTxt, nextPageTxt, - lastPageTxt, totalPagesTxt, pdfTxt, excel2007Txt, word2007Txt, pptxTxt, txtTxt, rtfTxt, xpsTxt, odsTxt, - odtTxt, xmlTxt, csvTxt, dbfTxt, mhtTxt)} -{template_body(renderBody)}")} - - - - - + {template_toolbar(renderBody)} + {template_body(renderBody)}
"; } } diff --git a/FastReport.Core.Web/Templates/script.cs b/FastReport.Core.Web/Templates/script.cs index b4292c75..d346045a 100644 --- a/FastReport.Core.Web/Templates/script.cs +++ b/FastReport.Core.Web/Templates/script.cs @@ -106,8 +106,7 @@ string template_script() => $@" }}, goto: function (page) {{ - this._reload('&skipPrepare=yes&goto=' + page);"+ - (Toolbar.ShowBottomToolbar ? $@"document.getElementsByClassName('{template_FR}-body')[0].scrollIntoView({{behavior:""smooth""}});" : "")+$@" + this._reload('&skipPrepare=yes&goto=' + page); }}, click: function (el, kind, value) {{ diff --git a/FastReport.Core.Web/Templates/style.cs b/FastReport.Core.Web/Templates/style.cs index 186da8b9..f57c9fbf 100644 --- a/FastReport.Core.Web/Templates/style.cs +++ b/FastReport.Core.Web/Templates/style.cs @@ -1,4 +1,6 @@ -namespace FastReport.Web +using System.Drawing; + +namespace FastReport.Web { partial class WebReport { @@ -6,13 +8,12 @@ string template_style() => $@" /********** MAIN ***********/ - .{template_FR}-container {{ {(Width.IsNullOrWhiteSpace() ? "" : $"width: {Width};")} {(Height.IsNullOrWhiteSpace() ? "" : $"height: {Height};")} background-color: white; display: {(Inline ? "inline-" : "")}flex; - flex-direction: column; + flex-direction: {Toolbar.Vertical}; position: relative; }} @@ -32,8 +33,8 @@ string template_style() => $@" overflow: auto; width: 100%; display: flex; - flex-direction: column; - align-items: center; + flex-direction: {Toolbar.RowOrColumn}; + align-items: flex-start; }} /*********** @@ -56,15 +57,22 @@ string template_style() => $@" **************/ .{template_FR}-toolbar {{ - flex-shrink: 0; - font-family: Verdana,Arial,sans-serif; - background-color: {Toolbar.Color.Name}; + flex-shrink: 1; + font:{Toolbar.UserFontSettings}; + background-color: {ColorTranslator.ToHtml(Toolbar.Color)}; {(Tabs.Count > 1 ? "" : "box-shadow: 0px 3px 4px -2px rgba(0, 0, 0, 0.2);")} display: flex; + flex-direction: {Toolbar.RowOrColumn}; /* flex-wrap: wrap; */ - width: 100%; + width: auto; + height: {Toolbar.VerticalToolbarHeight}%; + order:{Toolbar.TopOrBottom} ; position: relative; + align-items: center; + justify-content:{Toolbar.Content}; z-index: 2; + border-radius:{Toolbar.ToolbarRoundness}px; + min-width:50px; /*min-width: intrinsic; min-width: -moz-max-content; min-width: -webkit-max-content; @@ -73,11 +81,13 @@ string template_style() => $@" .{template_FR}-toolbar-item {{ height: {ToolbarHeight}px; + border-radius:{Toolbar.ToolbarRoundness}px; + background-color: #00000000; position: relative; }} .{template_FR}-toolbar-item:hover {{ - background-color: #d1d1d1; + background-color: {ColorTranslator.ToHtml(Toolbar.Color)}; }} .{template_FR}-toolbar-item > img {{ @@ -86,8 +96,9 @@ string template_style() => $@" padding-bottom: calc({ToolbarHeight}px * 0.15); padding-left: calc({ToolbarHeight}px * 0.25); padding-right: calc({ToolbarHeight}px * 0.25); - opacity: 0.5; + opacity: {Toolbar.TransparencyIcon}; display: block; + filter:invert({Toolbar.ColorIcon}) }} .{template_FR}-toolbar-item:hover > img {{ @@ -109,12 +120,11 @@ TOOLBAR DROPDOWN .{template_FR}-toolbar-dropdown-content {{ display: none; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - background-color: #f9f9f9; + background-color: {ColorTranslator.ToHtml(Toolbar.DropDownMenuColor)}; min-width: 120px; z-index: 2; position: absolute; - top: {ToolbarHeight}px; - left: 0; + {Toolbar.DropDownMenuPosition} white-space: nowrap; }} @@ -124,7 +134,7 @@ TOOLBAR DROPDOWN .{template_FR}-toolbar-dropdown-content > a {{ float: none; - color: black; + color: {ColorTranslator.ToHtml(Toolbar.DropDownMenuTextColor)}; padding: 6px 12px 6px 8px; text-decoration: none; display: block; @@ -135,7 +145,8 @@ TOOLBAR DROPDOWN }} .{template_FR}-toolbar-dropdown-content > a:hover {{ - background-color: #ddd; + background-color: {ColorTranslator.ToHtml(Toolbar.DropDownMenuColor)}; + opacity:0.5; cursor: pointer; }} @@ -169,8 +180,7 @@ TOOLBAR NAVIGATION text-align: center; border: 0; background: #fbfbfb; - border-radius: 4px; - + border-radius:{Toolbar.ToolbarRoundness}px; height: calc({ToolbarHeight}px * 0.68); width: 2.5em; margin-top: calc({ToolbarHeight}px * 0.17); @@ -251,10 +261,12 @@ TOOLBAR NAVIGATION font-family: Verdana,Arial,sans-serif; background-color: #f1f1f1; display: table; - width: 100%; + width: {Toolbar.TabsPositionSettings}; + max-width: 800px; box-shadow: 0px 3px 4px -2px rgba(0, 0, 0, 0.2); position: relative; z-index: 1; + {Toolbar.TabsPositionSettings} }} .{template_FR}-tabs .{template_FR}-tab {{ diff --git a/FastReport.Core.Web/Templates/toolbar.cs b/FastReport.Core.Web/Templates/toolbar.cs index 5f2d90be..6e4f546a 100644 --- a/FastReport.Core.Web/Templates/toolbar.cs +++ b/FastReport.Core.Web/Templates/toolbar.cs @@ -6,15 +6,7 @@ namespace FastReport.Web { partial class WebReport { - string template_toolbar(bool renderBody, string saveTxt = "Save", string reloadTxt = "Reload", string preparedTxt = "Prepared report", - string printTxt = "Print", string printFromBrowserTxt = "Print from browser", - string printFromPdf = "Print from PDF viewer", string zoomTxt = "Zoom", string firstPageTxt = "First page", - string previousPageTxt = "Previous page", string currentPageTxt = "Current page", - string nextPageTxt = "Next page", string lastPageTxt = "Last page", string totalPagesTxt = "Total Pages", - string pdfTxt = "Adobe PDF", string excel2007Txt = "Microsoft Excel 2007", string word2007Txt = "Microsoft Word 2007", - string pptxTxt = "Microsoft PowerPoint 2007", string txtTxt = "Text File/Matrix Printer", string rtfTxt = "Rich Text", - string xpsTxt = "Microsoft XPS", string odsTxt = "OpenOffice Calc", string odtTxt = "OpenOffice Writer", - string xmlTxt = "XML (Excel) table", string csvTxt = "CSV file", string dbfTxt = "DBF table", string mhtTxt = "MHT file") + string template_toolbar(bool renderBody) { if (!Toolbar.Show || !renderBody #if !OPENSOURCE @@ -23,36 +15,51 @@ string template_toolbar(bool renderBody, string saveTxt = "Save", string reloadT ) return ""; + + var localization = new ToolbarLocalization(Res); var exports = Toolbar.Exports; var toolbarExportItem = $@"
- +
" + - (exports.ShowPreparedReport ? $@"{preparedTxt}" : "") + (exports.ShowPreparedReport ? $@"{localization.preparedTxt}" : "") #if !OPENSOURCE - + (exports.ShowPdfExport ? $@"{pdfTxt}" : "") + - (exports.ShowExcel2007Export ? $@"{excel2007Txt}" : "") + - (exports.ShowWord2007Export ? $@"{word2007Txt}" : "") + - (exports.ShowPowerPoint2007Export ? $@"{pptxTxt}" : "") + - (exports.ShowTextExport ? $@"{txtTxt}" : "") + - (exports.ShowRtfExport ? $@"{rtfTxt}" : "") + - (exports.ShowXpsExport ? $@"{xpsTxt}" : "") + - (exports.ShowOdsExport ? $@"{odsTxt}" : "") + - (exports.ShowOdtExport ? $@"{odtTxt}" : "") + - (exports.ShowXmlExcelExport ? $@"{xmlTxt}" : "") + - (exports.ShowDbfExport ? $@"{dbfTxt}": "") + - (exports.ShowCsvExport ? $@"{csvTxt}" : "") + - (exports.ShowMhtExport ? $@"{mhtTxt}" : "") + + (exports.ShowPdfExport ? $@"{localization.pdfTxt}" : "") + + (exports.ShowExcel2007Export ? $@"{localization.excel2007Txt}" : "") + + (exports.ShowWord2007Export ? $@"{localization.word2007Txt}" : "") + + (exports.ShowPowerPoint2007Export ? $@"{localization.powerPoint2007Txt}" : "") + + (exports.ShowTextExport ? $@"{localization.textTxt}" : "") + + (exports.ShowRtfExport ? $@"{localization.rtfTxt}" : "") + + (exports.ShowXpsExport ? $@"{localization.xpsTxt}" : "") + + (exports.ShowOdsExport ? $@"{localization.odsTxt}" : "") + + (exports.ShowOdtExport ? $@"{localization.odtTxt}" : "") + + (exports.ShowXmlExcelExport ? $@"{localization.xmlTxt}" : "") + + (exports.ShowDbfExport ? $@"{localization.dbfTxt}": "") + + (exports.ShowCsvExport ? $@"{localization.csvTxt}" : "") + + (exports.ShowSvgExport ? $@"{localization.svgTxt}" : "") + + (exports.ShowMhtExport ? $@"{localization.mhtTxt}" : "") + + (exports.ShowExcel97Export ? $@"{localization.excel97Txt}" :"") + + //(exports.ShowEmailExport ? $@"{emailTxt}" : "") + + (exports.ShowHpglExport ? $@"{localization.hpglTxt}" : "") + + (exports.ShowHTMLExport ? $@"{localization.htmlTxt}" : "") + + //(exports.ShowImageExport ? $@"{imageTxt}" : "") + + (exports.ShowJsonExport ? $@"{localization.jsonTxt}" : "") + + (exports.ShowDxfExport ? $@"{localization.dxfTxt}" : "") + + (exports.ShowLaTeXExport ? $@"{localization.latexTxt}" : "") + + (exports.ShowPpmlExport ? $@"{localization.ppmlTxt}" : "") + + (exports.ShowPSExport ? $@"{localization.psTxt}" : "") + + (exports.ShowXamlExport ? $@"{localization.xamlTxt}" : "") + + (exports.ShowZplExport ? $@"{localization.zplTxt}" : "") #endif - + "
" + +"" ; var toolbarPrintItem = $@"
- +
" + - (Toolbar.PrintInHtml ? $@"{printFromBrowserTxt} + (Toolbar.PrintInHtml ? $@"{localization.printFromBrowserTxt} " : "") + #if !OPENSOURCE - (Toolbar.PrintInPdf ? $@"{printFromPdf} + (Toolbar.PrintInPdf ? $@"{localization.printFromPdf} " : "") + #endif $@"
@@ -66,7 +73,7 @@ string template_toolbar(bool renderBody, string saveTxt = "Save", string reloadT string templateToolbar = $@"
-{(Toolbar.ShowRefreshButton ? $@"
+{(Toolbar.ShowRefreshButton ? $@"
" : "")} @@ -76,7 +83,7 @@ string template_toolbar(bool renderBody, string saveTxt = "Save", string reloadT {(Toolbar.ShowPrint ? $"{toolbarPrintItem}" : "")} {(Toolbar.ShowZoomButton ? $@"
- +
{(currentZoom == 300 ? selectedZoom1 : selectedZoom2)}300% {(currentZoom == 200 ? selectedZoom1 : selectedZoom2)}200% @@ -91,17 +98,17 @@ string template_toolbar(bool renderBody, string saveTxt = "Save", string reloadT {((SinglePage || TotalPages < 2) ? "" : $@" - {(Toolbar.ShowFirstButton ? $@"
+ {(Toolbar.ShowFirstButton ? $@"
" : "")} -{(Toolbar.ShowPrevButton ? $@"
+{(Toolbar.ShowPrevButton ? $@"
" : "")}
- TotalPages ? TotalPages : (CurrentPageIndex + 1))}"" onchange=""{template_FR}.goto(document.getElementsByClassName('{template_FR}-current-page-input')[0].value);"" title=""{currentPageTxt}""> + TotalPages ? TotalPages : (CurrentPageIndex + 1))}"" onchange=""{template_FR}.goto(document.getElementsByClassName('{template_FR}-current-page-input')[0].value);"" title=""{localization.currentPageTxt}"">
@@ -110,14 +117,14 @@ string template_toolbar(bool renderBody, string saveTxt = "Save", string reloadT
- +
-{(Toolbar.ShowNextButton ? $@"
+{(Toolbar.ShowNextButton ? $@"
" : "")} -{(Toolbar.ShowLastButton ? $@"
+{(Toolbar.ShowLastButton ? $@"
" : "")} diff --git a/FastReport.OpenSource/FastReport.OpenSource.csproj b/FastReport.OpenSource/FastReport.OpenSource.csproj index 1a94f8da..a0f6253e 100644 --- a/FastReport.OpenSource/FastReport.OpenSource.csproj +++ b/FastReport.OpenSource/FastReport.OpenSource.csproj @@ -77,8 +77,9 @@ Various report objects will allow your report to look exactly how you want it to - - Resources\%(RecursiveDir)%(Filename)%(Extension) + + Resources\%(RecursiveDir)%(Filename)%(Extension) diff --git a/FastReport/Resources/en.xml b/FastReport/Resources/en.xml index 614b7a50..d95819df 100644 --- a/FastReport/Resources/en.xml +++ b/FastReport/Resources/en.xml @@ -126,6 +126,7 @@ + @@ -1772,7 +1773,8 @@ - + + @@ -2453,10 +2455,11 @@ - - + + + diff --git a/Localization/Russian.frl b/Localization/Russian.frl index 03b5e29e..d0c83a72 100644 --- a/Localization/Russian.frl +++ b/Localization/Russian.frl @@ -21,6 +21,7 @@ + @@ -1571,6 +1572,7 @@ + @@ -2208,6 +2210,7 @@ + diff --git a/UsedPackages.version b/UsedPackages.version index 2e8244d0..5cb22876 100644 --- a/UsedPackages.version +++ b/UsedPackages.version @@ -3,7 +3,7 @@ - 2021.2.10 + 2021.3.0 2021.2.3 @@ -24,13 +24,13 @@ - 2021.3.6 + 2021.3.22 - 2021.3.6 + 2021.3.22 - 2021.3.6 + 2021.3.22 - 2021.3.6 + 2021.3.22 From 442692e70a0ce05360c190880ac81a8fdaf3145b Mon Sep 17 00:00:00 2001 From: Fast Reports Date: Thu, 26 Aug 2021 13:55:18 +0300 Subject: [PATCH 2/2] reverted MongoDB --- .../FastReport.Core.Data.MongoDB.csproj | 6 +++++- .../FastReport.CoreWin.Data.MongoDB.csproj | 4 +++- .../FastReport.Data.MongoDB.csproj | 6 +++++- .../FastReport.OpenSource.Data.MongoDB.csproj | 16 ++++++++++------ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj index 9a0f2472..d08ea6fd 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.Core.Data.MongoDB.csproj @@ -27,10 +27,14 @@ This package will not be updated. The $(AssemblyName) package now includes a con FRCORE; + + - + + + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj index ba30c5fb..7bf26db3 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.MongoDB/FastReport.CoreWin.Data.MongoDB.csproj @@ -26,7 +26,9 @@ This package will not be updated. The $(AssemblyName) package now includes a con FRCORE; - + + + 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 9f3dadf3..3c25a036 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 @@ -48,9 +48,13 @@ Requirements: Any FastReport $(Version)+ package, NuGet Client 3.4.4+ + + - + + + 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 61cd9e00..37940c64 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 @@ -27,12 +27,16 @@ This package will not be updated. The $(AssemblyName) package now includes a con FRCORE; - - - - - - + + + + + + + + + +