5 Replies Latest reply on Feb 7, 2013 6:19 AM by AlexAnd

    Sorting an RTF File

    989422
      Hello,

      this is my first post here, i have an RTF Report and I wanted to sort it by the class start date.

      At the top of the report before the table, this code is written: *<?for-each-group@section:G_TRAINHIST_DATA;DEPARTMENT?>*

      then inside the table, in the first column, this code is written: *<?for-each:current-group()?>*

      note:- class start date value is *<?CLASS_START_DATE?>*



      Best Regards,
      Khalid.
        • 1. Re: Sorting an RTF File
          AlexAnd
          >
          this is my first post here,
          >
          welcome

          in the next time use appropriate forum
          BI Publisher - BI Publisher
          E-Business Suite - https://forums.oracle.com/forums/category.jspa?categoryID=3

          for sorting in table by CLASS_START_DATE
          <?for-each:current-group()?><?sort:CLASS_START_DATE;'ascending'?>
          also you can sort in group like above

          for more info
          Sorting Data
          http://docs.oracle.com/cd/E29505_01/bi.1111/e22254/create_rtf_tmpl.htm#sortings
          • 2. Re: Sorting an RTF File
            989422
            thanks for the quick reply, I will post next time in the correct section.

            Please note that the sorting is working fine now but i did face another issue, the date is not being sorted correctly, it's taking the day first, month & at last the year.

            e.g. if we have the following 3 dates:-

            --> 30/Apr/2013
            --> 15/Aug/2012
            --> 17/Oct/2010

            the sorting is coming as, although i did change the format of the field to date (yyyy-MM-dd)

            1) 15/Aug/2012
            2) 17/Oct/2010
            3) 30/Apr/2013




            Thanks,
            Khalid.
            • 3. Re: Sorting an RTF File
              AlexAnd
              <?for-each:current-group()?><?sort:CLASS_START_DATE;'ascending';data-type='date'?>
              • 4. Re: Sorting an RTF File
                989422
                thanks but it's still showing the same results, sorting didn't change after adding the data type.



                Regards,
                Khalid.
                • 5. Re: Sorting an RTF File
                  AlexAnd
                  >
                  thanks but it's still showing the same results, sorting didn't change after adding the data type.
                  >
                  hm


                  >
                  e.g. if we have the following 3 dates:-

                  --> 30/Apr/2013
                  --> 15/Aug/2012
                  --> 17/Oct/2010
                  >
                  it's in xml as is?
                  or it's result output formatting?

                  if it's in xml as is then it's string(!). it's not date
                  so if you want sort table by date then date must be in some format

                  as example
                  for
                  <?xml version="1.0" ?> 
                  <ROWSET>
                  <ROW>
                  <VAL>1</VAL>
                  <DT>30-04-2013</DT>
                  </ROW>
                  <ROW>
                  <VAL>2</VAL>
                  <DT>15-08-2012</DT>
                  </ROW>
                  <ROW>
                  <VAL>3</VAL>
                  <DT>17-10-2012</DT>
                  </ROW>
                  </ROWSET>
                  and output
                  15-08-2012
                  17-10-2012
                  30-04-2013
                  if you need in output date with other mask then use xdoxslt:format_date

                  if you have some issues then post plz sample xml