diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs index 638ee12d70..d15123ac04 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs @@ -74,6 +74,8 @@ namespace ICSharpCode.Reports.Core { } + public string QueryString {get;set;} + public IDbConnection Connection { get { diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs index b5b12f2653..cb0dce1b02 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs @@ -64,7 +64,13 @@ namespace ICSharpCode.Reports.Core } IDbCommand command = this.connectionObject.Connection.CreateCommand(); - command.CommandText = reportSettings.CommandText; + + if (String.IsNullOrEmpty(this.connectionObject.QueryString)) { + command.CommandText = reportSettings.CommandText; + } else { + command.CommandText = this.connectionObject.QueryString; + } + command.CommandType = reportSettings.CommandType; // We have to check if there are parameters for this Query, if so // add them to the command