/// <summary> /// Check to see that columns are sortable /// </summary> /// <param name="sortColumns"></param> public void ValidateSortColumns( List <SortColumn> sortColumns) { for (int sci = 0; sci < sortColumns.Count; sci++) { // be sure all columns are sortable QueryColumn qc = sortColumns[sci].QueryColumn; MetaColumnType t = qc.MetaColumn.DataType; if (t == MetaColumnType.Image || t == MetaColumnType.Structure) { throw new Exception("Can't sort on column " + Lex.Dq(qc.MetaColumn.Label) + " because it is of type " + t.ToString()); } } return; }
public void Serialize( XmlTextWriter tw) { tw.WriteStartElement("CondFormat"); tw.WriteAttributeString("ColumnType", ColumnType.ToString()); tw.WriteAttributeString("Name", Name); //if (!ShowInHeaders) tw.WriteAttributeString("ShowInHeaders", ShowInHeaders.ToString()); if (Option1) { tw.WriteAttributeString("Option1", Option1.ToString()); } if (Option2) { tw.WriteAttributeString("Option2", Option2.ToString()); } Rules.Serialize(tw); tw.WriteEndElement(); return; }
public void Serialize( XmlTextWriter tw) { tw.WriteStartElement("CalcField"); XmlUtil.WriteAttributeIfDefined(tw, "Name", Name); tw.WriteAttributeString("CalcType", CalcType.ToString()); tw.WriteAttributeString("SourceColumnType", SourceColumnType.ToString()); if (PreclassificationlResultType != MetaColumnType.Unknown) { tw.WriteAttributeString("PreclassificationlResultType", PreclassificationlResultType.ToString()); } for (int ci = 0; ci < CfCols.Count; ci++) { CalcFieldColumn cfc = CfCols[ci]; if (cfc == null) { continue; } int ci1 = ci + 1; if (cfc.MetaColumn != null) { tw.WriteAttributeString("Table" + ci1, cfc.MetaColumn.MetaTable.Name); tw.WriteAttributeString("Column" + ci1, cfc.MetaColumn.Name); } if (cfc.Function != null) { tw.WriteAttributeString("Function" + ci1, cfc.Function); } if (cfc.Constant != "") { tw.WriteAttributeString("Constant" + ci1, cfc.Constant); } } tw.WriteAttributeString("Operation", Operation); if (!String.IsNullOrEmpty(AdvancedExpr)) { tw.WriteAttributeString("AdvancedExpr", AdvancedExpr); } if (!String.IsNullOrEmpty(OuterJoinRoot)) { tw.WriteAttributeString("OuterJoinRoot", OuterJoinRoot); } if (!String.IsNullOrEmpty(ColumnLabel)) { tw.WriteAttributeString("ColumnLabel", ColumnLabel); } if (!String.IsNullOrEmpty(Description)) { tw.WriteAttributeString("Description", Description); } if (!String.IsNullOrEmpty(Prompt)) { tw.WriteAttributeString("Prompt", Prompt); } if (Classification != null) { Classification.Serialize(tw); } tw.WriteEndElement(); }