Beispiel #1
0
        private void PopulateSelectedFields(string storedValue)
        {
            var sections         = storedValue.Split(new[] { '|' });
            var fieldSection     = sections[2];
            var fieldTypeSection = sections[1];

            if (string.IsNullOrEmpty(fieldSection))
            {
                return;
            }

            var reportFilterSelection  = new ReportFilterSelection();
            var columnAndFieldsSection = fieldSection.Split(new[] { ':' });

            reportFilterSelection.FieldNameForDisplay = columnAndFieldsSection[0];
            reportFilterSelection.InternalFieldName   = columnAndFieldsSection[1];
            reportFilterSelection.FieldType           = SPFieldTypeHelper.GetFieldType(fieldTypeSection);
            reportFilterSelection.SelectedFields.AddRange(columnAndFieldsSection[2].Split(new[] { ',' }));

            //TODO: RHS - Setting the list ID in two places is a smell. Consider refactoring to one.
            if (ListId != null)
            {
                reportFilterSelection.ListToFilterOn = ListId.Value;
            }
            FieldSelection = reportFilterSelection;
        }
Beispiel #2
0
 public ReportFilterUserSettings()
 {
     TitleSelections = new List <string>();
     FieldSelection  = new ReportFilterSelection();
 }