Welcome to OpenXML Developer Sign in | Join | Help

(Info)Sorting And Filtering Data

Last post 09-15-2008, 9:34 AM by zeljc. 1 replies.
Sort Posts: Previous Next
  •  09-25-2006, 1:40 PM 693

    (Info)Sorting And Filtering Data


    The data in Spreadsheet can be either sorted or values can be filtered,to arrange data so that it's easier to analyze,done from the 'Editing' group of 'Home' tab.
    or you can add the following in the node 'worksheet'

    <autoFilter ref="A1:A4">
         <filterColumn colId="0">
             <filters>
                  <filter val="a" />
                  <filter val="c" />
              </filters>
          </filterColumn>
    </autoFilter>

    The values not to be filtered are mentioned as values in 'filter' node,i.e here the row to be filtered is 4,having value,'s'.The 1st 3 columns contain 'v' , 'a' and 'c',with 'v' in cell A1,set as the referance,from where the filtering is done.

    set attribute 'hidden' as 1 to hide the row to be filtered

    <row r="4" spans="1:2" hidden="1">

    also set 'filter mode' as 1,

    <worksheet xmlns=". . . . ">
    <sheetPr filterMode="1" enableFormatConditionsCalculation="0" />
    ...
    ...
    </worksheet>

    Data in cells can be sorted by inserting
    <worksheet xmlns=". . . . ">
    ....
    .....
        <sortState ref="A1:B3">
              <sortCondition ref="A1" />
        </sortState>
    </worksheet>

    here sorting is done considering column A,1st row.The other columns would be arranged as per the arrangement in 1st column.To arrange the data in descending order,set descending="1" as the attribute of 'sortCondition'

    Regards,
    Vijayeta
  •  09-15-2008, 9:34 AM 3699 in reply to 693

    Re: (Info)Sorting And Filtering Data

    hi

    i have tried the sorting:
        <sortState ref="A2:C7">
              <sortCondition ref="B2" />
        </sortState>

    but it doesn't work. what am i missing?

    any help appriciated, thanks.
View as RSS news feed in XML