DataEase 8 - Best Practice Dynamic Document Generation/Editing ExecDQL/Memo/SetVclass (Ver 8.0.0.1273)
I have been playing around a little with DataEase 8 and generated a simple sample on how to generate documents for further editing by combining the new function classes in DataEase 8. I hope and think that this will show that the time of generating Word documents and that stuff is over. You can get a better result directly in DataEase. You will need the latest 8 to insure that you are not outversioned...;-)
Usermode:
Username: User
Password: User
Developer Mode:
Username: High
Password: High
The system explained.
1. Templates. We have templates that is designed in the HTMLEditor in any way you like. You then put in tags in the document that you will later replace. So far quite straight forward.... But the cool bit is that in templates next to the document there is a little DQL editor where you put in the DQL that will manipulate the document and do the further "actions" this script will be called from the Generate Agreement button in the LoanAgreementsView form. In practice this DQL can do whatever it want. define temp "retval" text.
define temp "retval" text. for LoanAgreement with Agreement Number=data-entry field1 ; modify records<br>dummy :=MemoMemoCopy(Agreement , any relTemplate Template ,1) ; dummy :=MemoReplace(Agreement,"[lender]",LenderName) ; dummy :=MemoReplace(Agreement,"[borroweraddress]",Address); dummy :=MemoReplace(Agreement,"[lenderaddress]",Address2); dummy :=MemoReplace(Agreement,"[day]",day(AgreementDate)) ; dummy :=MemoReplace(Agreement,"[month]",month(AgreementDate)) ; dummy :=MemoReplace(Agreement,"[year]",year(AgreementDate)) ; dummy :=MemoReplace(Agreement,"[loan amount text]",AmountSpelt2 ); dummy :=MemoReplace(Agreement,"[loan amount]",LoanAmount ); dummy :=MemoReplace(Agreement,"[borrower]",BorrowerName). retval := SetGlobal("AgreementNumber", Agreement Number) . retval := DocumentOpen("LoanAgreementEdit") .
The nifty bit is that DQLs called with ExecDQL (here specifically MemoExecDQL) will have two contexts. The Data cursor context of the DQL and the Form context from the form it is called from. I.e all field/column transactions will be in the DQL context, and the object/gui functions will have the Form context. This is a completely new situation and it is only relevant for new push functions like SetValue(), SetState(),SetColor etc (All Form Context) and old GUI functions like DocumentOpen(), FormOpenRelated() etc,. Functions like MemoMemoCopy(), MemoCopy(), MemoReplace() etc which all have DQL/PRISM context. Any easy way to identify the context is to see if it reference a column/table directly i.e. now quotes or if it reference a form or object (with quotes ""). If we look at the example above (remember thsi is just the DQL for this particular Template, each template can have its own distinctive programming!!!) ;-) define temp "retval" text. -- Just Defines a temp variable we can use to allocate the return value of a function when we call it. You can't call a function in DQL without something to allocate it too.
define temp "retval" text. -- Just Defines a temp variable we can use to allocate the return value of a function when we call it. You can't call a function in DQL without something to allocate it too. for LoanAgreement with Agreement Number=data-entry field1 ; -- Here we basically tell the DQL that we want to do transaction on the same table and record as we called it from. modify records -- then we tell it that we want to modify the data of the current record. dummy :=MemoMemoCopy(Agreement , any relTemplate Template ,1) ; -- Memofunctions need to have a Record context and since a Memo function is a manipulative function rather than a function that return a value, it need to be called inside the Modify records, and the only way to do that is by allocating the return value to a column, dummy, that is just...a dummy the real transaction is the Memo being copied from Tempalte to the internal Agreement memo. dummy :=MemoReplace(Agreement,"[lender]",LenderName) ; -- here we replace the TAG [lender] with the content of the field Lendername and the next lines to the same for other tags. dummy :=MemoReplace(Agreement,"[borroweraddress]",Address); dummy :=MemoReplace(Agreement,"[lenderaddress]",Address2); dummy :=MemoReplace(Agreement,"[day]",day(AgreementDate)) ; dummy :=MemoReplace(Agreement,"[month]",month(AgreementDate)) ; dummy :=MemoReplace(Agreement,"[year]",year(AgreementDate)) ; dummy :=MemoReplace(Agreement,"[loan amount text]",AmountSpelt2 ); dummy :=MemoReplace(Agreement,"[loan amount]",LoanAmount ); dummy :=MemoReplace(Agreement,"[borrower]",BorrowerName). retval := SetGlobal("AgreementNumber", Agreement Number) . -- Here we set a global variable called AgreementNumber with the new SetGlobal function with the agreement number for this agreement, this we will pick up and use as filter in the LoanAgreementEdit form. retval := DocumentOpen("LoanAgreementEdit") . -- We could use FormOpenRelated() here directly and that would be cool as the relationship context is between the FORM and the new FORM we want to open, rather than between the form and the DQL, but here we open a form without a relational restraint and use AgreementNumber (global) as filter in the form we open.
dataease 7.2 y 7.1
eldataease 7.2 y 7.1 trabajan en windows de 64 bits ?