baldie
2nd June 2008, 13:49
In a report on detail level I read in an extra field. Not possible to do in programscript.
But this extra field should be the field on which to sort.
Is there a solution to do this?
I tried something like below, and added the extra field as a sort field in input, but had no luck with it:

declaration:
#DEFINE ORIGINAL.FUNCTION() originally.generated.r.write.seq.file()
#DEFINE r.write.seq.file() ORIGINAL.FUNCTION()

detail.1:
before.layout:

select tiitm001.kitm(=extra field)
from tiitm001
where tiitm001._index1 = {:tiitm001.item}
selectdo
endselect


functions:
#UNDEF r.write.seq.file()

function extern r.write.seq.file()
{
ORIGINAL.FUNCTION()
}

mark_h
2nd June 2008, 15:42
See the post by me in this thread (http://www.baanboard.com/baanboard/showthread.php?t=1908&highlight=report). This not something that is easy to do, but it is possible.

günther
2nd June 2008, 17:17
As I see, these defines came from a suggestion of mine (advanced customizing of reports (http://www.baanboard.com/baanboard/showthread.php?t=9090)).

The first thing that I wonder: Why do you determine kitm in the before layout part? You must do that in the function r.write.seq.file, before calling ORIGINAL.FUNCTION().

Then the rest of the report cannot decide, if the data came from the session (the normal way) or from the report (that's what you are doing here).
But that does not matter, so sorting should work.

Günther