"order by" from code (C#)

Stimulsoft Ultimate discussion
Post Reply
mirmidone
Posts: 15
Joined: Thu Mar 29, 2012 8:55 am

"order by" from code (C#)

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

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

Post by Alex K. »

Hello,

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

Thank you.
Attachments
DrillDownSorting.mrt
(22.93 KiB) Downloaded 388 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
Post Reply