
Re:New Sample : ExecDQL, LabelExecDQL, MemoExecDQL Showcased and explained!!!
Re:New Sample : ExecDQL, LabelExecDQL, MemoExecDQL Showcased and explained!!!
this is all very nice.
Does it work with "any" as well?
Example
for PERSONAL
with
( Austritt >= data-entry Field1 or
Austritt = blank ) and
Eintritt <= data-entry Field1 and
Freigabe = "J"and
any ZEITMODELL with ( MNR = PERSONAL MNR and Wochentag = Tag )
Sollstunden > 0 ;
list records
MANR : count ;
Name ;
any ERFASSUNG with ( Tag = Field1 and MANR = PERSONAL MANR ) BewegungsartNR ;
any ERFASSUNG Bewegungsart ;
any ERFASSUNG von .
Re:Re:New Sample : ExecDQL, LabelExecDQL, MemoExecDQL Showcased and explained!!!
Of course. You ca do anything you can in "traditional" DQL and then some.
It is however very awkward to include tags that [{any ERFASSUNG with ( Tag = Field1 and MANR = PERSONAL MANR ) BewegungsartNR}]
So the best cause of action is simply to do like this:
define "vBewegungsartNR" text .
define "vBewegungsart" text .
define "vVon" text . -- you can of course define it as any type of variable but as I don't know what they are the safest bet is always text.
for PERSONAL
with
( Austritt >= data-entry Field1 or
Austritt = blank ) and
Eintritt <= data-entry Field1 and
Freigabe = "J"and
any ZEITMODELL with ( MNR = PERSONAL MNR and Wochentag = Tag )
Sollstunden > 0 ;
vBewegungsartNR := any ERFASSUNG with ( Tag = Field1 and MANR = PERSONAL MANR ) BewegungsartNR .
vBewegungsart := any ERFASSUNG Bewegungsart .
vVon := any ERFASSUNG von .
list records
MANR : count ;
Name ;
vBewegungsartNR ;
vBewegungsart ;
vVon .
DQL Body.
.items
[{vBewegungsartNR}] [{vBegungsart}] etc.
.end
WHich is much much neater and easier to deal with.
In ExecDQL 2.0 we have fixed this by adding AS as a new keyword. To be honest, this is something that has been missing for a very long time.
for PERSONAL
with
( Austritt >= data-entry Field1 or
Austritt = blank ) and
Eintritt <= data-entry Field1 and
Freigabe = "J"and
any ZEITMODELL with ( MNR = PERSONAL MNR and Wochentag = Tag )
Sollstunden > 0 ;
list records
MANR : count ;
Name ;
any ERFASSUNG with ( Tag = Field1 and MANR = PERSONAL MANR ) BewegungsartNR AS "vArtNr" ;
any ERFASSUNG Bewegungsart AS "vBeweg" ;
any ERFASSUNG von AS "vVon" .
In ExecDQL 2.0 you will also be able to use "understandable" names on your Data-Entry fields.
Re:Re:Re:New Sample : ExecDQL, LabelExecDQL, MemoExecDQL Showcased and explained!!!
I tried to combine
MemoExecDQL(DQL,von,"","","","Web:Default,1",Body) with
retval := MemoExecDQL(any DQL with DQLnr=0003 DQL,data-entry field1,"","","","").
but the output I get only the group and not the item lines. see pdf 2 pages
define "retval" text.
define "TX" Text 20 .
retval := MemoExecDQL(any DQL with DQLnr=0003 DQL,data-entry field1,"","","","").
--retval := MemoExecDQL(any DQL with DQLnr=0004 DQL,data-entry field1,"","","","").
for ERFASSUNG_wrk with Tag = data-entry Field1 ;
if Anwesend = blank then
TX := "nicht gestempelt" .
end
if Anwesend = "J" then
TX := "Anwesend" .
end
if Anwesend = "N" then
TX := "Abwesend" .
end
list records
Tag ;
TX ;
Anwesend in groups ;
MANR in order : count ;
Name ;
BewegungsartNR ;
Bewegungsart ;
von .
end
Re:Re:Re:Re:New Sample : ExecDQL, LabelExecDQL, MemoExecDQL Showcased and explained!!!
The problem is the multi-view that is generated.
We base ExecDQL on the internal multiview in PRISM which is dynamic and extremly flexible.
When you add a dimension you add another level.
A dimention is a relational action like
FOR or Group etc.
It is also ALL or ANY.
retval := MemoExecDQL(any DQL with DQLnr=0003 DQL,data-entry field1,"","","","").
So the quick fix here is simply to add a .header and .footer to your layout.
Alternatively you have a "control" DQL that fire both DQLs
define "retval" text .
retval := MemoExecDQL(any DQL with DQLnr=0003 DQL,data-entry field1,"","","","").
retval := MemoExecDQL(any DQL with DQLnr=0004 DQL,data-entry field1,"","","","").
Where 0004 is the DQL you have listed above.
Re:Re:Re:Re:Re:New Sample : ExecDQL, LabelExecDQL, MemoExecDQL Showcased and explained!!!
I fire a "control" DQL that fire both DQLs with
MemoExecDQL(DQL,von,"","","","Web:Default,1",Body)
define "retval" text .
retval := MemoExecDQL(any DQL with DQLnr=0003 DQL,data-entry field1,"","","","").
retval := MemoExecDQL(any DQL with DQLnr=0004 DQL,data-entry field1,"","","","").
and the html LAYOUT Body is in the control dql or in the DQLnr=0004?
Re:Re:Re:Re:Re:Re:New Sample : ExecDQL, LabelExecDQL, MemoExecDQL Showcased and explained!!!
MemoExecDQL is a function and each function is self-contained.
Each of these could produce their own output. There is no "cross-over" between them and it is no voodoo or magic.
When you call the MemoExecDQL it will do its job with the arguments you enter, it doesn't inhert anything from the "control" DQL.
If you don't generate any output i.e. have a list records it is no point having a destination or a body
You fire this (there is no need to have unnecessary arguments in 8.5, you only need the ones up to the last one you put a values in)
MemoExecDQL(DQL,von)
retval := MemoExecDQL(any DQL with DQLnr=0003 DQL,data-entry field1,"","","",""). --data-entry field1 now equal the field von
retval := MemoExecDQL(any DQL with DQLnr=0004 named "dqltest" DQL,data-entry field1,"","","","web:",any dqltest Body ). -- i have guessed that this is the one generating the output
The entire point in ExecDQL is that it is part of the Runtime environment and not the rigid old GUI.
It follow the same rules as any other DataEase function so you get the Script and the formatting via normal string/memo/relational means rather than from a special document like in the old stuff.
So if you have stored the DQL and the Layout in different memos in the table DQL then you need to get them from there too.
There is no fixed rules, just the general data rules for DataEase.