Row always at the same position: is this possible? |
Post Reply |
Author | |
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
Posted: 05 June 2007 at 2:58am |
Hello, everybody
I would like to know if there is a way NOT to sort a particular row in a report control. In particular: I have a report that has several rows, plus a row containing the total (sums) of all the values: I would like to keep this row a the last position even if other rows are sorted. I can't use the footer, since I need "special" formatting for that row (bold font, red forecolor, etc.). Any idea on how can I do this? Thanks in advance. |
|
LittleJK
Senior Member Joined: 13 April 2006 Status: Offline Points: 168 |
Post Options
Thanks(0)
|
look into sort priority to do that
|
|
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
Thanks for your reply... But, I tried to assign Item.SortPriority = 0 to the row that I don't want to move: this works, since all the items are sorted, excluding my row (that is, the row is not "mixed" anymore between the other rows) But, if the items are sorted in descending order, my row is the first one, and not the last one (as I expect / want). How can I manage this? Thanks. Marco |
|
mlatona
Senior Member Joined: 19 April 2005 Location: Germany Status: Offline Points: 124 |
Post Options
Thanks(0)
|
Hi,
I need this feature too. I will sort the rows but not the last row.
Is it possible for the next version?
|
|
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
Is there a workaround to implement this (even with some flickering)??
|
|
Zach
Groupie Joined: 19 July 2006 Status: Offline Points: 62 |
Post Options
Thanks(0)
|
That sounds like it its sorting.
A total row is going to be the highest value... making it the top row when sorted in descending order, the bottom row when sorted ascending...... I would think
|
|
Zach
Groupie Joined: 19 July 2006 Status: Offline Points: 62 |
Post Options
Thanks(0)
|
Oh - and a simple way to do it would be to make it so when its sorted... its the bottom row. Set the caption of the cell to what you want displayed.
When sorted descending ... give the row a value of something like -9999999 - when sorted ascending, give it a value of 99999999 (or whatever numbers are high enough, low enough)
That should accomplish what you want I would think.
|
|
Zach
Groupie Joined: 19 July 2006 Status: Offline Points: 62 |
Post Options
Thanks(0)
|
Just fyi... I originally ran across this while looking for something else... and now however many hours later... hum - ended up being a solution I needed as the Footer Row is to far away on tables with only 20 rows.... Data.Populate
It also seems like a much simplier method - if it would work in a way that it sorted something assigned a 0 always on top of something assigned a 1, on down the line - actually would be very cool - but it did not seem to do that (and it actually sctewed up all the sorting when I assigned it)
|
|
Godzilla
Newbie Joined: 12 September 2007 Location: United Kingdom Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Just been trying to do the same thing with totals in my report but without using the sort piority. I use a total line at the end of the report which is after a blank record. I have tried to do this by essentially assigning the value of each item of the total record to some var's and then deleting the old total row and finally readding the row at the end of the result list. I have tried doing this by adding the following code in the SortOrderChanged event:
iCount = data:records:count.
IF iCount <> 0 THEN
DO i = (iCount - 1) TO 0 BY -1:
IF data:records(i):tag= "total" OR data:Records(i):tag = "blank" THEN
data:Records:RemoveAt(i).
END.
iCount = data:records:COUNT
IF iCount <> 0 THEN
DO:
t-com1 = data:Records:INSERT(iCount).
t-com1:Tag = "blank".
iCount = iCount + 1.
t-com2 = data:Records:INSERT(iCount).
t-com2:Tag = "Total".
END.
....... I then add all the items.
I have found that if there are six or less records in the report the above code works fine however when there are more than six records the Total line is place at the top and the blank line at the bottom.. Not sure why this is happening - any advise would be appreciated |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Well, with recently released 11.2 -- it is better to use Footers rows collection for that...
-- WBR, Serge |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |