/// <summary>
            /// The request to get report configuration from data layer.
            /// </summary>
            /// <param name="request">The request.</param>
            /// <returns>The report data set.</returns>
            private static GetReportDataServiceResponse GetReportData(GetReportDataServiceRequest request)
            {
                ReportDataSet outputData;

                var dataRequest = new GetReportConfigurationDataRequest(request.ReportId, request.QueryResultSettings);
                ReportConfiguration reportDefinition = request.RequestContext.Runtime.Execute <SingleEntityDataServiceResponse <ReportConfiguration> >(dataRequest, request.RequestContext).Entity;

                // If reportDefinition is null, throw error.
                ThrowIf.Null(reportDefinition, "This report is either not configured in database or not allowed for this role.");
                reportDefinition.SetReportParameters(request.ReportParameters);

                // Get report data based on its type.
                if (reportDefinition.DataSourceType.Equals("OLTP", StringComparison.OrdinalIgnoreCase))
                {
                    var dataReportRequest = new GetOLTPReportDataRequest(reportDefinition, request.QueryResultSettings);
                    outputData = request.RequestContext.Runtime.Execute <SingleEntityDataServiceResponse <ReportDataSet> >(dataReportRequest, request.RequestContext).Entity;
                }
                else
                {
                    throw new NotSupportedException("The report type of the requested report is not supported.");
                }

                return(new GetReportDataServiceResponse(outputData));
            }
            /// <summary>
            /// Gets report configuration.
            /// </summary>
            /// <param name="request">The request with report id, locale and settings.</param>
            /// <returns><see cref="ReportConfiguration"/> object.</returns>
            private SingleEntityDataServiceResponse <ReportConfiguration> GetReportConfiguration(GetReportConfigurationDataRequest request)
            {
                // Get localized strings for the report.
                if (this.LocalizedStrings == null)
                {
                    this.LocalizedStrings = this.GetLocalizedReportsStrings(request.RequestContext, request.QueryResultSettings);
                }

                DataTable           reportAttributesTable = this.GetReportsConfiguration(request.RequestContext, request.ReportId, request.QueryResultSettings);
                string              query, reportTitle, parameters, type, charts;
                bool                hasTotalRow       = false;
                bool                hasDisclaimer     = false;
                bool                isUserBasedReport = false;
                ReportConfiguration reportConfig      = null;
                DataRow             reportRow;
                List <string>       rolesAllowed;

                if (reportAttributesTable.Rows.Count > 0)
                {
                    reportConfig          = new ReportConfiguration();
                    reportRow             = reportAttributesTable.Rows[0];
                    rolesAllowed          = new List <string>();
                    reportConfig.ReportId = reportRow[ColumnReportId].ToString();
                    this.GetReportDetailsFromXml(
                        reportRow[ColumnReportDefinitionXml].ToString(),
                        out query,
                        out reportTitle,
                        out parameters,
                        out type,
                        out charts,
                        out hasTotalRow,
                        out hasDisclaimer,
                        out isUserBasedReport);
                    reportConfig.Query             = query;
                    reportConfig.DataSourceType    = type;
                    reportConfig.IsUserBasedReport = isUserBasedReport;
                    reportConfig.HasTotalRow       = hasTotalRow;
                    reportConfig.HasDisclaimer     = hasDisclaimer;
                    foreach (DataRow row in reportAttributesTable.Rows)
                    {
                        rolesAllowed.Add(row[ColumnRolesAllowed].ToString());
                    }

                    reportConfig.SetRolesAllowed(rolesAllowed.AsReadOnly());
                }

                return(new SingleEntityDataServiceResponse <ReportConfiguration>(reportConfig));
            }