Dynamic distribution RRS feed

  • Question

  • I was struck with a problem


    i need to display list of page links grouped by the first letter of one of the fields.

    display group headers for all 26 letters of the alphabet.If letter does not have any names no need to display.

    always start a column with a new letter.Display output evenly over 5columns (best distribution method).

    i tried by dividing 26letters into 5columns giving 5letters each..but according to the above condition if there no entries for f,g,h,i,j that column will be empty violating the rule of evenly distributing into 5columns.

    so the distribution should be dynamic in such a way that even if there are no entries for some letters the rest should be distributed in this 5columns.

    plz help me if you have best approach or code that gives some idea.

    Friday, March 30, 2012 11:11 PM

All replies

  • In Access, I could do it in 102 lines of code.  In SharePoint, I could beat my forehead with a 6 lbs sledgehammer.

    The algorithm is: Determine the number of letters then divide by 5. 
    The hard part is determining the number of letters. 

    I guess I'd start with a calculated field to pull off the starting lettter.
    Assuming this can be manually dynamic, store the uniqiue number of letters in a list elsewhere.

    From there, a Data View Web Part with some extensive XSLT (pun) to do the rest of the math.

    Unless Visual Studio is an option, then coding it becomes less blows to the forehead.

    Steve Clark, MCTS | Twin-Soft.com
    Easy Bins Dumpster Rentals of Northern VA. (Specializing in driveway-sized roll-off dumpsters.)
    Be sure to click one of them there forum buttons that artificially inflates my narcissitic ego... I mean gives me points.

    Tuesday, August 14, 2012 8:15 PM