Sorting then filtering a databand

Stimulsoft Ultimate discussion
Post Reply
bkalinovski
Posts: 6
Joined: Tue Jul 10, 2018 7:17 am

Sorting then filtering a databand

Post by bkalinovski »

Hello,
I'm trying to sort a DataBand and then to select first 5 rows but all I'm getting is that Stimulsoft first selects those 5 rows and then sorts them, but I need the opposite of that: 1. To sort; 2. To Select first 5 rows;
Can you help me with that!
B.K
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Sorting then filtering a databand

Post by HighAley »

Hello.

Unfortunately, the filtering works before the sorting.
You could stop showing the rows by calling the Last() method of the Data Source in the After Print event of the Data Band.
The Last() method moves a pointer to the last row of the Data Source and other rows will not be shown.
Your code should be like this:

Code: Select all

if (Line == 5) Categories.Last();
Please, look at the attached report template.

Thank you.
Attachments
Last.mrt
(7.73 KiB) Downloaded 173 times
Post Reply