internal MemberCollection GetMembers(string memberSet, string[] properties, Level parentLevel, Member parentMember) { string dimensionPropertiesClause = MemberQueryGenerator.GetDimensionPropertiesClause(properties); string memberQuery = MemberQueryGenerator.GetMemberQuery(memberSet, dimensionPropertiesClause, this); return(this.ExecuteMembersQuery(memberQuery, parentLevel, parentMember)); }
private static string GetIndividualFilter(string hierarchyUniqueName, MemberFilter filter) { string propertyReference = MemberQueryGenerator.GetPropertyReference(hierarchyUniqueName, filter.PropertyName); string result; switch (filter.FilterType) { case MemberFilterType.Equals: result = MemberQueryGenerator.GetEqualFilter(propertyReference, filter.PropertyValue); break; case MemberFilterType.BeginsWith: result = MemberQueryGenerator.GetBeginsWithFilter(propertyReference, filter.PropertyValue); break; case MemberFilterType.EndsWith: result = MemberQueryGenerator.GetEndsWithFilter(propertyReference, filter.PropertyValue); break; case MemberFilterType.Contains: result = MemberQueryGenerator.GetContainsFilter(propertyReference, filter.PropertyValue); break; default: result = MemberQueryGenerator.GetEqualFilter(propertyReference, filter.PropertyValue); break; } return(result); }
public static string GetFilteredAndRangedMemberSet(string baseSet, string hierarchyUniqueName, long start, long count, MemberFilter[] filters) { string text; if (filters.Length > 0) { string filterExpression = MemberQueryGenerator.GetFilterExpression(hierarchyUniqueName, filters); text = MemberQueryGenerator.GetSetWithFilter(baseSet, filterExpression); } else { text = baseSet; } string result; if (count > -1L) { result = MemberQueryGenerator.GetSetWithRange(text, start, count); } else { result = text; } return(result); }
private static string GetContainsFilter(string propertyReference, string propertyValue) { propertyValue = MemberQueryGenerator.EnquoteMdxString(propertyValue); return(string.Format(CultureInfo.InvariantCulture, "INSTR( {0}, {1} ) > 0", new object[] { propertyReference, propertyValue })); }
private static string GetEqualFilter(string propertyReference, string propertyValue) { propertyValue = MemberQueryGenerator.EnquoteMdxString(propertyValue); return(string.Format(CultureInfo.InvariantCulture, "{0} = {1}", new object[] { propertyReference, propertyValue })); }
private static string GetFilterExpression(string hierarchyUniqueName, MemberFilter[] filters) { string[] array = new string[filters.Length]; for (int i = 0; i < filters.Length; i++) { array[i] = "( " + MemberQueryGenerator.GetIndividualFilter(hierarchyUniqueName, filters[i]) + " )"; } return(string.Join(" AND ", array)); }
private static string GetEndsWithFilter(string propertyReference, string propertyValue) { int length = propertyValue.Length; propertyValue = MemberQueryGenerator.EnquoteMdxString(propertyValue); return(string.Format(CultureInfo.InvariantCulture, "RIGHT( {0}, {1} ) = {2}", new object[] { propertyReference, length, propertyValue })); }
private MemberCollection InternalGetMembers(long start, long count, string[] properties, params MemberFilter[] filters) { if (properties == null) { throw new ArgumentNullException("properties"); } if (filters == null) { throw new ArgumentNullException("filters"); } CubeDef parentCube = this.ParentHierarchy.ParentDimension.ParentCube; string baseSetLevelMembers = MemberQueryGenerator.GetBaseSetLevelMembers(this); string filteredAndRangedMemberSet = MemberQueryGenerator.GetFilteredAndRangedMemberSet(baseSetLevelMembers, this.ParentHierarchy.UniqueName, start, count, filters); return(parentCube.GetMembers(filteredAndRangedMemberSet, properties, this, null)); }
private static string GetPropertyReference(string hierarchyUniqueName, string propertyName) { string text; if (propertyName == "Name" || propertyName == "UniqueName") { text = propertyName; } else { propertyName = MemberQueryGenerator.EnquoteMdxString(propertyName); text = string.Format(CultureInfo.InvariantCulture, "Properties({0})", new object[] { propertyName }); } return(string.Format(CultureInfo.InvariantCulture, "{0}.CurrentMember.{1}", new object[] { hierarchyUniqueName, text })); }