Runtime Sorting

Stimulsoft Reports.NET discussion
Post Reply
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Runtime Sorting

Post by fkmfkm »

Hi,

I have seen this post somewhere..
Please use following code in BeforeRender Event of DataBand2 in StimulReport.Net:

Code:
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.

I am new here..how can i access the BeforeRender event. I am using StiReportWeb.

Thank you.
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

Runtime Sorting

Post by Guest »

If you want to set sort of databand in runtime from your web application, you may use the following code on, for example, Page_Load event:

Code: Select all

StiReport report = StiWebReport1.GetReport();
StiDataBand databand = (report.Pages[0].Components["DataBand2"] as StiDataBand);
databand.Sort = new string[] { "ASC", "UnitPrice" };
StiWebViewer1.Report = report; 
If you want to set sort of databand in the designer your can double click on databand and choose sort tab.
If you select databand and select right button on property grid, you see all events of databand, including BeginRenderEvent.

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Runtime Sorting

Post by fkmfkm »

Good it works..

2 Question.

1. The event window..so small got other editor or other way ?
2. Can I code in VB ?

Thank you.
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

Runtime Sorting

Post by Guest »

If you choose a report in the property grid you may set "Script Language" to VB.
Concerning event window, you can resize it.

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Runtime Sorting

Post by fkmfkm »

Ok Thank you.
Post Reply