Esempio n. 1
0
        public void GetCommand(SqlCommand command, bool inlcudeHiddenFields = true, bool isSchemaOnly = false, bool useUserFilter = true, string sortField = null, string sortDir = null)
        {
            _report.MigrateToNewReport();

            command.CommandType    = CommandType.Text;
            command.CommandTimeout = SystemSettings.GetReportTimeout();
            switch (_report.ReportDefType)
            {
            case ReportType.Table:
                _tabularReportSql.GetTabularSql(command, JsonConvert.DeserializeObject <TabularReport>(_report.ReportDef), inlcudeHiddenFields, isSchemaOnly, _report.ReportID, useUserFilter, sortField, sortDir);
                break;

            case ReportType.TicketView:
                _tabularReportSql.GetTabularSql(command, JsonConvert.DeserializeObject <TabularReport>(_report.ReportDef), inlcudeHiddenFields, isSchemaOnly, _report.ReportID, useUserFilter, sortField, sortDir);
                break;

            default:
                break;
            }

            Report.AddCommandParametersForExport(command, _report.Collection.LoginUser);
            command.CommandText = $" /* ReportID: {_report.ReportID.ToString()} OrganizationID: {_report.OrganizationID.ToString()} */ " + command.CommandText;
        }
        private void GetCommand(SqlCommand command, bool inlcudeHiddenFields = true, bool isSchemaOnly = false, bool useUserFilter = true, string sortField = null, string sortDir = null)
        {
            _report.MigrateToNewReport();
            _summaryReport = JsonConvert.DeserializeObject <SummaryReport>(_report.ReportDef);

            command.CommandType    = CommandType.Text;
            command.CommandTimeout = SystemSettings.GetReportTimeout();
            switch (_report.ReportDefType)
            {
            case ReportType.Chart:
                _summaryReportSql.GetSummarySql(command, _summaryReport, isSchemaOnly, null, false, true);
                break;

            case ReportType.Summary:
                _summaryReportSql.GetSummarySql(command, _summaryReport, isSchemaOnly, _report.ReportID, useUserFilter, false);
                break;

            default:
                break;
            }

            Report.AddCommandParametersForExport(command, _report.Collection.LoginUser);
            command.CommandText = $" /* ReportID: {_report.ReportID.ToString()} OrganizationID: {_report.OrganizationID.ToString()} */ " + command.CommandText;
        }