Page 2 of 2

how to Sort calculated columns with coding

Posted: Wed Aug 18, 2010 8:05 am
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

how to Sort calculated columns with coding

Posted: Thu Aug 19, 2010 12:54 am
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.