/// <summary> /// Gets reports configuration. If report identifier is null or empty, it will return configuration of all reports. /// </summary> /// <param name="context">The request context.</param> /// <param name="reportId">The report identifier.</param> /// <param name="settings">The query result settings.</param> /// <returns>Report configuration data table.</returns> private DataTable GetReportsConfiguration(RequestContext context, string reportId, QueryResultSettings settings) { ThrowIf.Null(settings, "settings"); string reportConfigSPName = GetReportConfigSPName; ParameterSet parameters = new ParameterSet(); parameters[DatabaseAccessor.ChannelIdVariableName] = context.GetPrincipal().ChannelId; parameters[ParamUserId] = context.GetPrincipal().UserId; if (!string.IsNullOrEmpty(reportId)) { parameters[ParamReportId] = reportId; reportConfigSPName = GetReportConfigByIdSPName; } DataSet outputDataSet; using (SqlServerDatabaseContext sqlServerDatabaseContext = new SqlServerDatabaseContext(context, settings)) { outputDataSet = sqlServerDatabaseContext.ExecuteStoredProcedureDataSet(reportConfigSPName, parameters); } if (outputDataSet != null && outputDataSet.Tables.Count > 0) { outputDataSet.Tables[0].TableName = OutputTableName; return(outputDataSet.Tables[0]); } return(null); }
/// <summary> /// Gets localized report strings for this locale. /// </summary> /// <param name="context">The request context.</param> /// <param name="settings">The query result settings.</param> /// <returns>Data table containing all localized strings.</returns> internal DataTable GetLocalizedReportsStrings(RequestContext context, QueryResultSettings settings) { ThrowIf.Null(settings, "settings"); ParameterSet parameters = new ParameterSet(); parameters[DatabaseAccessor.ChannelIdVariableName] = context.GetPrincipal().ChannelId; parameters[ParamLocaleCode] = context.LanguageId; DataSet reportOutput; using (SqlServerDatabaseContext sqlServerDatabaseContext = new SqlServerDatabaseContext(context, settings)) { reportOutput = sqlServerDatabaseContext.ExecuteStoredProcedureDataSet(GetListOfLocalizedStrings, parameters); } if (reportOutput != null && reportOutput.Tables.Count > 0) { return(reportOutput.Tables[0]); } return(null); }
/// <summary> /// Gets a downloading dataset of a given data group. /// </summary> /// <param name="request">The get downloading data set data request.</param> /// <returns>A dataset.</returns> public SingleEntityDataServiceResponse <DataSet> GetDownloadingDataSet(GetDownloadingDataSetDataRequest request) { ThrowIf.Null(request, "request"); ThrowIf.NullOrWhiteSpace(request.DataGroupName, "request.DataGroupName"); Stopwatch processTimer = Stopwatch.StartNew(); ParameterSet parameters = new ParameterSet(); parameters[DatabaseAccessor.ChannelIdVariableName] = request.RequestContext.GetPrincipal().ChannelId; parameters["@vc_DataGroupName"] = request.DataGroupName; DataSet result = null; using (SqlServerDatabaseContext sqlServerDatabaseContext = new SqlServerDatabaseContext(request)) { result = sqlServerDatabaseContext.ExecuteStoredProcedureDataSet(GetDownloadingDataSprocName, parameters); } processTimer.Stop(); NetTracer.Information("** timer info: GetDownloadingDataSet completed in {0} ms", processTimer.ElapsedMilliseconds); return(new SingleEntityDataServiceResponse <DataSet>(result)); }