protected void toField(StringBuilder sb, Field f, bool isHidden)
 {
     string s = " {{ name: '{0}', label: '{1}', formatter:'{2}', {3} align:'{4}'{5}{6}}}";
     if (f.Align == "" || f.Align == null)
     {
         switch (f.FieldType)
         {
             case "integer":
             case "number":
             case "area":
             case "rate":
             case "exchangerate":
             case "currency":
                 f.Align = "right";
                 break;
         }
     }
     string sortable = "";
     if (f.Sortable == false)
     {
         sortable = ",sortable:false";
     }
     sb.AppendLine(string.Format(s, f.Alias == "" ? f.FieldName : f.Alias, f.Name, f.FieldType,f.width>0?string.Format("width:{0},", f.width):"", f.Align, isHidden ? ",hidden:true" : "", sortable));
 }
 protected void toField(StringBuilder sb, Field f)
 {
     toField(sb, f, f.IsHidden);
 }
 protected void AddGroup2Sql(StringBuilder sb, Field f)
 {
     if (sb.Length == 0)
     {
         sb.Append(" group by ");
     }
     else
     {
         sb.Append(",");
     }
     sb.Append(f.FullName);
 }
 protected void AddSumField2Sql(StringBuilder sb, Field f)
 {
     if (sb.Length == 0)
     {
         sb.Append("select ");
     }
     else
     {
         sb.Append(",");
     }
     sb.Append("sum(");
     sb.Append(f.FullName);
     sb.Append(") as ");
     if (f.Alias.Length > 0)
     {
         sb.Append(f.Alias);
     }
     else
     {
         sb.Append(f.Name);
     }
 }
 //������dependonfield
 protected void AddField2Sql(StringBuilder sb, Field f)
 {
     if (sb.Length == 0)
     {
         sb.Append("select ");
     }
     else
     {
         sb.Append(",");
     }
     if (f.FunctionStr == "")
     {
         sb.Append(f.FullName);
     }
     else
     {
         sb.Append(f.FunctionStr);
     }
     if (f.Alias.Length > 0)
     {
         sb.Append(" as ");
         sb.Append(f.Alias);
     }
 }