how to Sort calculated columns with coding

Stimulsoft Reports.NET discussion
so29
Posts: 72
Joined: Mon Nov 02, 2009 1:29 pm

how to Sort calculated columns with coding

Post by so29 »

Hello,
Thank you

Please note this
calculated column made in report page
Not in the application


May
About code guide

Code: Select all


            ASC
            {Customers.CustomerID2}
          

Thank you
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

how to Sort calculated columns with coding

Post by Alex K. »

Hello,

You must add sorting by calculated column before calculation. This can be done the following ways:
1. Via the application code:

Code: Select all

StiReport report = new StiReport();
report.Load(@"D:\Report.mrt");
Stimulsoft.Report.Components.StiDataBand band = report.GetComponents()["DataProducts"] as Stimulsoft.Report.Components.StiDataBand;
band.Sort = new string[2] { "DESC", "{Products.Column}" };
report.Compile();
report.Show();
2. Open report using the editor (notepad, for example) and add the following code to the block of indicating the data band:

Code: Select all

            ASC
            {Customers.CustomerID2}
          
3. In the report designer in the Sort tab.

Thank you.
Post Reply