diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj b/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj index 5ef9632a..2a41b3a4 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.Couchbase/FastReport.Data.Couchbase.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net4.5 + netstandard2.0;net45 ../../../FastReport.Plugins.snk true Fast Reports Inc. @@ -34,7 +34,9 @@ - + + + @@ -48,13 +50,26 @@ False - ..\..\..\..\FastReport\bin\Release\FastReport.dll + ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll - + + + + + False + ..\FastReport.Data.Json\bin\Community\net47\FastReport.Data.Json.dll + + + + + + + + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj b/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj index eceb2b35..d5103875 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.Json/FastReport.Data.Json.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net4;net4.5 + netstandard2.0;net4;net45;net47 true ../../../FastReport.Plugins.snk true 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 c284a571..0cc3ffc3 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 @@ -52,7 +52,7 @@ False - ..\..\..\..\FastReport\bin\Release\FastReport.dll + ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj index 35ed2ba1..b666afcd 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.Data.OracleODPCore.csproj @@ -1,6 +1,6 @@  - netcoreapp2.0 + netstandard2.0;net47 true ../../../FastReport.Plugins.snk true @@ -23,21 +23,80 @@ + + FRCORE; + + - + + + + false + + + False + ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll + + - - + + + + + + false + + + False + ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll + + + + + + + + + + - + + + + + + + + + + + + + + + + + OracleConnectionEditor.cs + + + + + OracleConnectionEditor.cs + Designer + + + + + UserControl + \ No newline at end of file diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj index 1a0543bc..e165bf66 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/FastReport.OpenSource.Data.OracleODPCore.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + netstandard2.0;net47 true ../../../FastReport.Plugins.snk true @@ -25,11 +25,25 @@ https://github.com/FastReports/FastReport + + FRCORE; + + - + + + + + + + + + + + diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.Designer.cs b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.Designer.cs new file mode 100644 index 00000000..3e58f834 --- /dev/null +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.Designer.cs @@ -0,0 +1,157 @@ +namespace FastReport.Data +{ + partial class OracleConnectionEditor + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btnAdvanced = new System.Windows.Forms.Button(); + this.tbPassword = new System.Windows.Forms.TextBox(); + this.tbUserName = new System.Windows.Forms.TextBox(); + this.lblPassword = new System.Windows.Forms.Label(); + this.lblUserName = new System.Windows.Forms.Label(); + this.label1 = new FastReport.Controls.LabelLine(); + this.gbServer = new System.Windows.Forms.GroupBox(); + this.lblServer = new System.Windows.Forms.Label(); + this.cbxServer = new System.Windows.Forms.ComboBox(); + this.gbServer.SuspendLayout(); + this.SuspendLayout(); + // + // btnAdvanced + // + this.btnAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnAdvanced.AutoSize = true; + this.btnAdvanced.Location = new System.Drawing.Point(250, 140); + this.btnAdvanced.Name = "btnAdvanced"; + this.btnAdvanced.Size = new System.Drawing.Size(77, 23); + this.btnAdvanced.TabIndex = 0; + this.btnAdvanced.Text = "Advanced..."; + this.btnAdvanced.UseVisualStyleBackColor = true; + this.btnAdvanced.Click += new System.EventHandler(this.btnAdvanced_Click); + // + // tbPassword + // + this.tbPassword.Location = new System.Drawing.Point(120, 96); + this.tbPassword.Name = "tbPassword"; + this.tbPassword.Size = new System.Drawing.Size(188, 20); + this.tbPassword.TabIndex = 2; + this.tbPassword.UseSystemPasswordChar = true; + // + // tbUserName + // + this.tbUserName.Location = new System.Drawing.Point(120, 72); + this.tbUserName.Name = "tbUserName"; + this.tbUserName.Size = new System.Drawing.Size(188, 20); + this.tbUserName.TabIndex = 1; + // + // lblPassword + // + this.lblPassword.AutoSize = true; + this.lblPassword.Location = new System.Drawing.Point(12, 100); + this.lblPassword.Name = "lblPassword"; + this.lblPassword.Size = new System.Drawing.Size(57, 13); + this.lblPassword.TabIndex = 1; + this.lblPassword.Text = "Password:"; + // + // lblUserName + // + this.lblUserName.AutoSize = true; + this.lblUserName.Location = new System.Drawing.Point(12, 76); + this.lblUserName.Name = "lblUserName"; + this.lblUserName.Size = new System.Drawing.Size(62, 13); + this.lblUserName.TabIndex = 0; + this.lblUserName.Text = "User name:"; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(8, 164); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(320, 17); + this.label1.TabIndex = 2; + // + // gbServer + // + this.gbServer.Controls.Add(this.cbxServer); + this.gbServer.Controls.Add(this.lblServer); + this.gbServer.Controls.Add(this.tbUserName); + this.gbServer.Controls.Add(this.tbPassword); + this.gbServer.Controls.Add(this.lblUserName); + this.gbServer.Controls.Add(this.lblPassword); + this.gbServer.Location = new System.Drawing.Point(8, 4); + this.gbServer.Name = "gbServer"; + this.gbServer.Size = new System.Drawing.Size(320, 128); + this.gbServer.TabIndex = 3; + this.gbServer.TabStop = false; + this.gbServer.Text = "Server"; + // + // lblServer + // + this.lblServer.AutoSize = true; + this.lblServer.Location = new System.Drawing.Point(12, 20); + this.lblServer.Name = "lblServer"; + this.lblServer.Size = new System.Drawing.Size(72, 13); + this.lblServer.TabIndex = 4; + this.lblServer.Text = "Server name:"; + // + // cbxServer + // + this.cbxServer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Append; + this.cbxServer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cbxServer.FormattingEnabled = true; + this.cbxServer.Location = new System.Drawing.Point(12, 40); + this.cbxServer.Name = "cbxServer"; + this.cbxServer.Size = new System.Drawing.Size(296, 21); + this.cbxServer.TabIndex = 5; + // + // OracleConnectionEditor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.gbServer); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnAdvanced); + this.Name = "OracleConnectionEditor"; + this.Size = new System.Drawing.Size(336, 183); + this.gbServer.ResumeLayout(false); + this.gbServer.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnAdvanced; + private System.Windows.Forms.TextBox tbPassword; + private System.Windows.Forms.TextBox tbUserName; + private System.Windows.Forms.Label lblPassword; + private System.Windows.Forms.Label lblUserName; + private FastReport.Controls.LabelLine label1; + private System.Windows.Forms.GroupBox gbServer; + private System.Windows.Forms.Label lblServer; + private System.Windows.Forms.ComboBox cbxServer; + } +} diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.cs b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.cs new file mode 100644 index 00000000..0765712b --- /dev/null +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using FastReport.Data.ConnectionEditors; +using FastReport.Forms; +using FastReport.Utils; +using Oracle.ManagedDataAccess.Client; + +namespace FastReport.Data +{ + public partial class OracleConnectionEditor : ConnectionEditorBase + { + private string FConnectionString; + + private void btnAdvanced_Click(object sender, EventArgs e) + { + using (AdvancedConnectionPropertiesForm form = new AdvancedConnectionPropertiesForm()) + { + OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(ConnectionString); + form.AdvancedProperties = builder; + if (form.ShowDialog() == DialogResult.OK) + ConnectionString = form.AdvancedProperties.ToString(); + } + } + + private void Localize() + { + MyRes res = new MyRes("ConnectionEditors,Common"); + + gbServer.Text = res.Get("ServerLogon"); + lblServer.Text = res.Get("Server"); + lblUserName.Text = res.Get("UserName"); + lblPassword.Text = res.Get("Password"); + + btnAdvanced.Text = Res.Get("Buttons,Advanced"); + } + + private void InitServers() + { + OracleDataSourceEnumerator oraEnum = new OracleDataSourceEnumerator(); + try + { + DataTable dt = oraEnum.GetDataSources(); + foreach (DataRow row in dt.Rows) + { + cbxServer.Items.Add(row[0]); + } + } + catch + { + } + } + + protected override string GetConnectionString() + { + OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(FConnectionString); + + builder.DataSource = cbxServer.Text; + builder.UserID = tbUserName.Text; + builder.Password = tbPassword.Text; + + return builder.ToString(); + } + + protected override void SetConnectionString(string value) + { + FConnectionString = value; + OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(value); + + cbxServer.Text = builder.DataSource; + tbUserName.Text = builder.UserID; + tbPassword.Text = builder.Password; + } + + public OracleConnectionEditor() + { + InitializeComponent(); + Localize(); + InitServers(); + } + } +} diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.resx b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.resx new file mode 100644 index 00000000..19dc0dd8 --- /dev/null +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleConnectionEditor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleDataConnection.cs b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleDataConnection.cs index 74032ab9..2fa974df 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleDataConnection.cs +++ b/Extras/Core/FastReport.Data/FastReport.Data.OracleODPCore/OracleDataConnection.cs @@ -7,94 +7,121 @@ namespace FastReport.Data { - public class OracleDataConnection : DataConnectionBase - { - private void GetDBObjectNames(string name, string columnName, List list) + public class OracleDataConnection : DataConnectionBase { - DataTable schema = null; - DbConnection connection = GetConnection(); - try - { - OpenConnection(connection); - OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(connection.ConnectionString); - schema = connection.GetSchema(name, new string[] { builder.UserID.ToUpper(), null }); - } - finally - { - DisposeConnection(connection); - } - - foreach (DataRow row in schema.Rows) - { - string tableName = row[columnName].ToString(); - string schemaName = row["OWNER"].ToString(); - if (String.Compare(schemaName, "SYSTEM") == 0) - list.Add(tableName); - else - list.Add(schemaName + ".\"" + tableName + "\""); - } - } + private void GetDBObjectNames(string name, string columnName, List list) + { + DataTable schema = null; + DbConnection connection = GetConnection(); + try + { + OpenConnection(connection); + OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(connection.ConnectionString); + schema = connection.GetSchema(name, new string[] { builder.UserID.ToUpper(), null }); + } + finally + { + DisposeConnection(connection); + } - public override string[] GetTableNames() - { - List list = new List(); - GetDBObjectNames("Tables", "TABLE_NAME", list); - GetDBObjectNames("Views", "VIEW_NAME", list); - return list.ToArray(); - } + foreach (DataRow row in schema.Rows) + { + string tableName = row[columnName].ToString(); + string schemaName = row["OWNER"].ToString(); + if (String.Compare(schemaName, "SYSTEM") == 0) + list.Add(tableName); + else + list.Add(schemaName + ".\"" + tableName + "\""); + } + } - public override string QuoteIdentifier(string value, DbConnection connection) - { - // already quoted? keep in mind GetDBObjectNames and non-SYSTEM schema! - if (!value.EndsWith("\"")) - value = "\"" + value + "\""; - return value; - } + public override string[] GetTableNames() + { + List list = new List(); + GetDBObjectNames("Tables", "TABLE_NAME", list); + GetDBObjectNames("Views", "VIEW_NAME", list); + return list.ToArray(); + } - protected override string GetConnectionStringWithLoginInfo(string userName, string password) - { - OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(ConnectionString); + public override string QuoteIdentifier(string value, DbConnection connection) + { + // already quoted? keep in mind GetDBObjectNames and non-SYSTEM schema! + if (!value.EndsWith("\"")) + value = "\"" + value + "\""; + return value; + } - builder.UserID = userName; - builder.Password = password; + protected override string GetConnectionStringWithLoginInfo(string userName, string password) + { + OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(ConnectionString); - return builder.ToString(); - } + builder.UserID = userName; + builder.Password = password; - public override Type GetConnectionType() - { - return typeof(OracleConnection); - } + return builder.ToString(); + } - public override DbDataAdapter GetAdapter(string selectCommand, DbConnection connection, - CommandParameterCollection parameters) - { - OracleDataAdapter adapter = new OracleDataAdapter(selectCommand, connection as OracleConnection); - adapter.SelectCommand.BindByName = true; - - foreach (CommandParameter p in parameters) - { - OracleDbType parType = (OracleDbType)p.DataType; - OracleParameter parameter = adapter.SelectCommand.Parameters.Add(p.Name, parType, p.Size); - parameter.Value = p.Value; - - // if we have refcursor parameter, set its direction to output, and also - // modify the command type to CommandType.StoredProcedure. The selectCommand must contain - // the stored proc name only. - if (parType == OracleDbType.RefCursor) + public override Type GetConnectionType() { - parameter.Direction = ParameterDirection.Output; - adapter.SelectCommand.CommandType = CommandType.StoredProcedure; + return typeof(OracleConnection); } - } - return adapter; - } + public override DbDataAdapter GetAdapter(string selectCommand, DbConnection connection, + CommandParameterCollection parameters) + { + OracleDataAdapter adapter = new OracleDataAdapter(selectCommand, connection as OracleConnection); + adapter.SelectCommand.BindByName = true; - public override Type GetParameterType() - { - return typeof(OracleDbType); + foreach (CommandParameter p in parameters) + { + OracleDbType parType = (OracleDbType)p.DataType; + OracleParameter parameter = adapter.SelectCommand.Parameters.Add(p.Name, parType, p.Size); + parameter.Value = p.Value; + + // if we have refcursor parameter, set its direction to output, and also + // modify the command type to CommandType.StoredProcedure. The selectCommand must contain + // the stored proc name only. + if (parType == OracleDbType.RefCursor) + { + parameter.Direction = ParameterDirection.Output; + adapter.SelectCommand.CommandType = CommandType.StoredProcedure; + } + } + + return adapter; + } + + public override Type GetParameterType() + { + return typeof(OracleDbType); + } + +#if !FRCORE + public override int GetDefaultParameterType() + { + return (int)OracleDbType.Varchar2; + } + + public override string GetConnectionId() + { + OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder(ConnectionString); + string info = ""; + try + { + info = builder.DataSource; + } + catch + { + + } + return "Oracle: " + info; + } + + + public override ConnectionEditors.ConnectionEditorBase GetEditor() + { + return new OracleConnectionEditor(); + } +#endif } - - } -} +} \ No newline at end of file diff --git a/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj b/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj index a75cca3c..9d112ca7 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.RavenDB/FastReport.Data.RavenDB.csproj @@ -50,7 +50,7 @@ False - ..\..\..\..\FastReport\bin\Release\FastReport.dll + ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll diff --git a/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj b/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj index 6d910013..c0289d26 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj +++ b/Extras/Core/FastReport.Data/FastReport.Data.SQLite/FastReport.Data.SQLite.csproj @@ -1,6 +1,6 @@ - + netstandard2.0;net4 true ../../../FastReport.Plugins.snk @@ -16,8 +16,6 @@ https://www.fast-report.com/download/images/frlogo-big.png reporting, SQLite, connection, reports 2018.2.2$(VersionSuffix) - 2018.2.2.0 - 2018.2.2.0 Debug;Release; FastReport.Data.SQLite FastReport.Data @@ -48,7 +46,7 @@ False - ..\..\..\..\FastReport\bin\Release\FastReport.dll + ..\..\..\..\FastReport\bin\$(Configuration)\FastReport.dll diff --git a/Extras/Core/FastReport.Data/FastReport.Data.sln b/Extras/Core/FastReport.Data/FastReport.Data.sln index 976213b6..f9e406ea 100644 --- a/Extras/Core/FastReport.Data/FastReport.Data.sln +++ b/Extras/Core/FastReport.Data/FastReport.Data.sln @@ -13,7 +13,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.Data.Postgres", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.Data.Json", "FastReport.Data.Json\FastReport.Data.Json.csproj", "{C58DD653-F4F4-47A5-A52F-4F151A31F190}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastReport.Data.MongoDB", "FastReport.Data.MongoDB\FastReport.Data.MongoDB.csproj", "{9BA8F49F-6BD7-42EA-9914-8BFF239A0C20}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.Data.MongoDB", "FastReport.Data.MongoDB\FastReport.Data.MongoDB.csproj", "{9BA8F49F-6BD7-42EA-9914-8BFF239A0C20}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.Data.OracleODPCore", "FastReport.Data.OracleODPCore\FastReport.Data.OracleODPCore.csproj", "{62E59CEB-C587-4642-8126-44B47D8C7FAD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.Data.Couchbase", "FastReport.Data.Couchbase\FastReport.Data.Couchbase.csproj", "{7FC77FBC-B25A-4BD2-ADDA-7F6935710A5F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastReport.Data.RavenDB", "FastReport.Data.RavenDB\FastReport.Data.RavenDB.csproj", "{BB143926-05EB-4569-A474-EA21225EB6CC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -45,6 +51,18 @@ Global {9BA8F49F-6BD7-42EA-9914-8BFF239A0C20}.Debug|Any CPU.Build.0 = Debug|Any CPU {9BA8F49F-6BD7-42EA-9914-8BFF239A0C20}.Release|Any CPU.ActiveCfg = Release|Any CPU {9BA8F49F-6BD7-42EA-9914-8BFF239A0C20}.Release|Any CPU.Build.0 = Release|Any CPU + {62E59CEB-C587-4642-8126-44B47D8C7FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62E59CEB-C587-4642-8126-44B47D8C7FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62E59CEB-C587-4642-8126-44B47D8C7FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62E59CEB-C587-4642-8126-44B47D8C7FAD}.Release|Any CPU.Build.0 = Release|Any CPU + {7FC77FBC-B25A-4BD2-ADDA-7F6935710A5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FC77FBC-B25A-4BD2-ADDA-7F6935710A5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FC77FBC-B25A-4BD2-ADDA-7F6935710A5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FC77FBC-B25A-4BD2-ADDA-7F6935710A5F}.Release|Any CPU.Build.0 = Release|Any CPU + {BB143926-05EB-4569-A474-EA21225EB6CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB143926-05EB-4569-A474-EA21225EB6CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB143926-05EB-4569-A474-EA21225EB6CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB143926-05EB-4569-A474-EA21225EB6CC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/FastReport.Base/AssemblyInitializer.cs b/FastReport.Base/AssemblyInitializer.cs index 90b9b445..b0f472fc 100644 --- a/FastReport.Base/AssemblyInitializer.cs +++ b/FastReport.Base/AssemblyInitializer.cs @@ -100,7 +100,10 @@ public AssemblyInitializer() RegisteredObjects.Add(typeof(TableRow), "", 216); RegisteredObjects.Add(typeof(TableCell), "", 214); RegisteredObjects.Add(typeof(MatrixObject), "ReportPage", 142, 7); + +#if !COMMUNITY RegisteredObjects.Add(typeof(CrossViewObject), "ReportPage", 247, 8); +#endif RegisteredObjects.AddCategory("ReportPage,Barcodes", 123, 9, "Objects,BarcodeObject"); for (int i = 0; i <= Barcodes.Items.Length - 1; i++) diff --git a/FastReport.Base/Code/AssemblyDescriptor.cs b/FastReport.Base/Code/AssemblyDescriptor.cs index 7a76ff96..77249426 100644 --- a/FastReport.Base/Code/AssemblyDescriptor.cs +++ b/FastReport.Base/Code/AssemblyDescriptor.cs @@ -399,7 +399,12 @@ private void InternalCompile() foreach (string a in cp.ReferencedAssemblies) assemblyHashSB.Append(a); assemblyHashSB.Append(scriptText.ToString()); - string assemblyHash = Convert.ToBase64String(new HMACSHA1(Encoding.ASCII.GetBytes(shaKey)).ComputeHash(Encoding.Unicode.GetBytes(assemblyHashSB.ToString()))); + byte[] hash = null; + using (HMACSHA1 hMACSHA1 = new HMACSHA1(Encoding.ASCII.GetBytes(shaKey))) + { + hash = hMACSHA1.ComputeHash(Encoding.Unicode.GetBytes(assemblyHashSB.ToString())); + } + string assemblyHash = Convert.ToBase64String(hash); Assembly cachedAssembly = null; if (FAssemblyCache.TryGetValue(assemblyHash, out cachedAssembly)) { @@ -478,7 +483,11 @@ public bool ContainsExpression(string expr) public object CalcExpression(string expr, Variant value) { - return (expressions[expr] as FastReport.Code.ExpressionDescriptor).Invoke(new object[] { expr, value }); + FastReport.Code.ExpressionDescriptor expressionDescriptor = expressions[expr] as FastReport.Code.ExpressionDescriptor; + if (expressionDescriptor != null) + return expressionDescriptor.Invoke(new object[] { expr, value }); + else + return null; } public void InvokeEvent(string name, object[] parms) diff --git a/FastReport.Base/Data/CsvDataConnection.cs b/FastReport.Base/Data/CsvDataConnection.cs index 77fbef66..44a14735 100644 --- a/FastReport.Base/Data/CsvDataConnection.cs +++ b/FastReport.Base/Data/CsvDataConnection.cs @@ -294,9 +294,12 @@ protected override DataSet CreateDataSet() if (!String.IsNullOrEmpty(CsvFile) && !String.IsNullOrEmpty(Separator)) { - StreamReader reader = new StreamReader(CsvFile, Encoding.GetEncoding(Codepage)); + string allText = ""; + using (StreamReader reader = new StreamReader(CsvFile, Encoding.GetEncoding(Codepage))) + { + allText = reader.ReadToEnd(); + } List lines = new List(); - string allText = reader.ReadToEnd(); lines.AddRange(allText.Split(Environment.NewLine.ToCharArray())); // get table name from file name diff --git a/FastReport.Base/GroupHeaderBand.cs b/FastReport.Base/GroupHeaderBand.cs index 1de92ee8..87862a07 100644 --- a/FastReport.Base/GroupHeaderBand.cs +++ b/FastReport.Base/GroupHeaderBand.cs @@ -414,12 +414,27 @@ internal void FinalizeDataSource() internal void ResetGroupValue() { - groupValue = Report.Calc(Condition); + if (!string.IsNullOrEmpty(Condition)) + { + groupValue = Report.Calc(Condition); + } + else + { + throw new GroupHeaderHasNoGroupCondition(Name); + } } internal bool GroupValueChanged() { - object value = Report.Calc(Condition); + object value = null; + if (!string.IsNullOrEmpty(Condition)) + { + value = Report.Calc(Condition); + } + else + { + throw new GroupHeaderHasNoGroupCondition(Name); + } if (groupValue == null) { if (value == null) diff --git a/FastReport.Base/Utils/Config.cs b/FastReport.Base/Utils/Config.cs index e6fcd933..2ccbe3f9 100644 --- a/FastReport.Base/Utils/Config.cs +++ b/FastReport.Base/Utils/Config.cs @@ -158,13 +158,15 @@ internal static string GetTempFolder() internal static void Init() { +#if !NETSTANDARD2_0 string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; WebMode = String.Compare(processName, "iisexpress") == 0 || String.Compare(processName, "w3wp") == 0; - if (!WebMode) LoadConfig(); - +#else + WebMode = true; +#endif LoadPlugins(); // init TextRenderingHint.SystemDefault diff --git a/FastReport.Base/Utils/Crypter.cs b/FastReport.Base/Utils/Crypter.cs index e77c1aa9..51f0fae4 100644 --- a/FastReport.Base/Utils/Crypter.cs +++ b/FastReport.Base/Utils/Crypter.cs @@ -37,11 +37,17 @@ public static string DefaultPassword /// public static Stream Encrypt(Stream dest, string password) { + ICryptoTransform encryptor = null; +#if DOTNET_4 + using (PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, Encoding.UTF8.GetBytes("Salt"))) +#else PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, Encoding.UTF8.GetBytes("Salt")); - RijndaelManaged rm = new RijndaelManaged(); - rm.Padding = PaddingMode.ISO10126; - ICryptoTransform encryptor = rm.CreateEncryptor(pdb.GetBytes(16), pdb.GetBytes(16)); - +#endif + { + RijndaelManaged rm = new RijndaelManaged(); + rm.Padding = PaddingMode.ISO10126; + encryptor = rm.CreateEncryptor(pdb.GetBytes(16), pdb.GetBytes(16)); + } // write "rij" signature dest.Write(new byte[] { 114, 105, 106 }, 0, 3); return new CryptoStream(dest, encryptor, CryptoStreamMode.Write); @@ -58,11 +64,17 @@ public static Stream Encrypt(Stream dest, string password) /// public static Stream Decrypt(Stream source, string password) { + ICryptoTransform decryptor = null; +#if DOTNET_4 + using (PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, Encoding.UTF8.GetBytes("Salt"))) +#else PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, Encoding.UTF8.GetBytes("Salt")); - RijndaelManaged rm = new RijndaelManaged(); - rm.Padding = PaddingMode.ISO10126; - ICryptoTransform decryptor = rm.CreateDecryptor(pdb.GetBytes(16), pdb.GetBytes(16)); - +#endif + { + RijndaelManaged rm = new RijndaelManaged(); + rm.Padding = PaddingMode.ISO10126; + decryptor = rm.CreateDecryptor(pdb.GetBytes(16), pdb.GetBytes(16)); + } // check "rij" signature int byte1 = source.ReadByte(); int byte2 = source.ReadByte(); diff --git a/FastReport.Base/Utils/Exceptions.cs b/FastReport.Base/Utils/Exceptions.cs index 95a6dbeb..5816c82c 100644 --- a/FastReport.Base/Utils/Exceptions.cs +++ b/FastReport.Base/Utils/Exceptions.cs @@ -158,4 +158,15 @@ internal CloudStorageException(string message, Exception innerException) : base( { } } + + /// + /// The exception that is thrown when the Group Header has no group condition. + /// + public class GroupHeaderHasNoGroupCondition : Exception + { + internal GroupHeaderHasNoGroupCondition(string name) + : base(String.Format(Res.Get("Messages,GroupHeaderHasNoGroupCondition"), name)) + { + } + } } \ No newline at end of file diff --git a/FastReport/Resources/en.xml b/FastReport/Resources/en.xml index 19e57d4e..c35c97c0 100644 --- a/FastReport/Resources/en.xml +++ b/FastReport/Resources/en.xml @@ -26,6 +26,7 @@ + diff --git a/Tools/pack.bat b/Tools/pack.bat index fbf4fb0c..2f74d811 100644 --- a/Tools/pack.bat +++ b/Tools/pack.bat @@ -41,6 +41,10 @@ pushd %~dp0.. IF "!WITH_OUT_DEBUG!"=="false" ( + for %%x in (%PROJECTS%) do ( + dotnet restore %%x "!PROP!-debug" + ) + for %%x in (%PROJECTS%) do ( dotnet clean %%x -c Debug "!PROP!-debug" ) @@ -51,6 +55,10 @@ IF "!WITH_OUT_DEBUG!"=="false" ( ) + for %%x in (!PROJECTS!) do ( + dotnet restore %%x "!PROP!" + ) + for %%x in (!PROJECTS!) do ( dotnet clean %%x -c Release "!PROP!" )