How is Sorting based on Expression

Stimulsoft Reports.NET discussion
Post Reply
MARIMUTHU K
Posts: 101
Joined: Wed Jul 26, 2006 8:03 am
Location: CHENNAI-TN, INDIA

How is Sorting based on Expression

Post by MARIMUTHU K »

Hi hi hi


How is sort based on Codition or Expression?

If Possible Sort data based on Some Expression?

Following code is Example.

1. If field1.Text="A" then
DataBand1.Sort Ascending Based on field2.Text
Else if field1.Text="B" then
DataBand1.Sort Ascending Based on field3.Text
Else if field.Text="C" then
DataBand1.Sort Decending order Based on field4.Text
else
DataBand1.Sort Decending

Above code is possible or other way of sorting data in Dynamic


Please Provide Solution For that Problem.


Thanks of Advance.


Regards,
KMarimuthu.
Marimuthu K
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How is Sorting based on Expression

Post by Edward »

KMarimuthu wrote:Hi hi hi


How is sort based on Codition or Expression?

If Possible Sort data based on Some Expression?

Following code is Example.

1. If field1.Text="A" then
DataBand1.Sort Ascending Based on field2.Text
Else if field1.Text="B" then
DataBand1.Sort Ascending Based on field3.Text
Else if field.Text="C" then
DataBand1.Sort Decending order Based on field4.Text
else
DataBand1.Sort Decending

Above code is possible or other way of sorting data in Dynamic


Please Provide Solution For that Problem.


Thanks of Advance.


Regards,
KMarimuthu.
Please use following code in BeforeRender Event of DataBand2 in StimulReport.Net:

Code: Select all

DataBand2.Sort = new string[] {"ASC","ProductName","DESC","UnitPrice"};
DESC - sorting in descending order
ASC - sorting in ascending order
Address, UnitPrice - are Columns from your Datasource.
Thanks.
Post Reply