Page 1 of 1

Runtime Sorting

Posted: Mon Jul 09, 2007 8:58 pm
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.

Runtime Sorting

Posted: Tue Jul 10, 2007 6:06 am
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.

Runtime Sorting

Posted: Tue Jul 10, 2007 10:56 am
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.

Runtime Sorting

Posted: Wed Jul 11, 2007 1:19 am
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.

Runtime Sorting

Posted: Thu Jul 12, 2007 3:42 am
by fkmfkm
Ok Thank you.