Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Sorting depending on given conditions

edited September 2008 in General
FYI: Delphi 2007 for Win32/RB10.09

Hi all.

I'm having an issue with sorting a field.

Given some condition I need to be able to sort a field in a report.

Is there any way to do it, maybe throught DataPipeLine or any other method?

Thanks in advance.

Regards,

Fabio Reynoso

Comments

  • edited September 2008

    Typically you use SQL to sort data (the DataPipeline cannot sort data.)

    If you are using the RB Data workspace (DADE) to build queries, here is an
    example that shows how to use TdaSQLBuilder to sort data programmatically.

    www.digital-metaphors.com/tips/SQLBuilderSimpleOrderBy.zip


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2008
    Thanks a lot Nard. I really appreciate very much !!! your support.

    This example shows me how to add the fields I'd like to sort, but is there a
    way to specify the order? (Ascending, Descending).

    Because that is exactly what I want to achieve (of course, after your
    example).

    Thanks a lot again.

    Regards,

    Fabio Reynoso

  • edited September 2008

    According to the RBuilder Help topic for TdaSQLOrderByFields there ia an
    AddDescending method

    public function AddDescending(const aTableNameOrAlias: String; const
    aFieldNameOrAlias: String): TdaField; virtual;

    Adds a specified field to the Order By array and sets the TdaField.Ascending
    property to False.




    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2008
    Thank you very much Nard. I works exactly as I wanted to...

    Regards and thanks for your support.

    Fabio Reynoso

This discussion has been closed.