Page 1 of 1

"order by" from code (C#)

Posted: Thu Oct 29, 2015 3:05 pm
by mirmidone
I want to set the Report order by from (C#) code... through the click of two radio buttons.
The string "select * from employee order by last_name" (or order by first_name) of the datatable , not work.
Is There a method of classes to set the sort order of a specific field from (C#) code ?

Help please
Many thanks
Enio Donci

Re: "order by" from code (C#)

Posted: Fri Oct 30, 2015 6:01 am
by Alex K.
Hello,

In this case, you can use the interactive sorting. Please see the sample report in the attachment.

Thank you.

Re: "order by" from code (C#)

Posted: Fri Oct 30, 2015 6:19 am
by HighAley
Hello.

You could add a variable to your report and use it in the query next way:

Code: Select all

select * from employee order by {sortVariable}
By setting the value of the variable you could change the query.

Thank you.