Simplicty and flexibility!


Function::Memo

MemoExecDQL
MemoExecDQL(DQLMemoField,"Data-Entry Field1","Data-Entry Field2","Data-Entry Field3","Data-Entry Field3","Export File")
MemoExecDQL(MyMemo,MyDataEntry1)


MemoExecDQL is the most used ExecDQL function simply because you can make your own editor form in an application where you store all your DQLs and then you transfere them to the form where they are needed via a simple lookup to a virtual memo field.

When it is looked up in the virtual memo field, you can simply execute it in the form via MemoExecDQL().

You can execute a DQL up to 64k in length this way.

Parameters


MemoContianingDQL: (Field)

Field name (Memo field) that contain the DQL you want to execute.

Data-Entry Field1: (String)

This is the parameter that you can reference inside the DQL script as Data-Entry field1.

Data-Entry Field2: (String)

This is the parameter that you can reference inside the DQL script as Data-Entry field2.

Data-Entry Field3: (String)

This is the parameter that you can reference inside the DQL script as Data-Entry field3.

Data-Entry Field4: (String)

This is the parameter that you can reference inside the DQL script as Data-Entry field4.

Output: (Field)

There is several different output modes for MemoExecDQL.

File: (Default)

If you use the reserved keyword file: or refrain from using a reserved keyword in the Output argument the argument will be interpreted as a text file and the export will be saved in this file name.

ex: MemoExecDQL(DQL,"","","","","C:\test.txt",Layout) or : MemoExecDQL(DQL,"","","","","file:C:\test.txt",Layout) 

 Web:

This is the HTML mode. The output will now be interpreted as HTML and you can either Print it or Preview the output in the IE object. When using the Web: keyword you have extra formatting.

Web:<printer>,<mode> ex. MemoExecDQL(DQL,"","","","","web:Default,1",Layout) -- this will preview the Result in the IE object.

<printer> -- Default, Printer1..Printer4, Actual name of printer. -- The default printer in WIndows will be changed to this printer.
<mode> -- 0,1 - Preview, 2 - Print Directly to printer without dialog, 3 - printer dialogue.

 PDF:

Print directly to PDF. PDF:<filename>. Ex. MemoExecDQL(DQL,"","","","","PDF:c:\test\mypdf.pdf",Layout)

Memo:

Will put the output directly into a Memo GUI control in the active form. If the GUI control is a WebField it will display HTML correctly.
PS! If you output formatted text to a text memo, remember to use COURIER or another fixed position font.

Layout:

This is a Memo where the layout format for the DQL is stored. Format:

Report Header: Free text that will come at the beginning of the report. Never repeated!

.header.
,items
.footer
.end

Tags: [{column name}]
EkstraTags: 
Position: LRW ex. L30, R20, C10
[{Price:R15}] -- print Price R oriented 15 spaces.
[{Price:R15 sum}] -- print the sum off Price listed in List Records Price : sum ;
Integer to float European: [{var1:F999 999 999,99}]
Integer to float C type: [{var2:F999999999.99}]
Integer fixed leading 0s: [{var3:F00000}]
Integer to with fixed length: [{var4:F99999999}]
Float just formatet: [{var5:F999 999 999,99}]
Float to Integer: [{var6:F99999}]
Float C more dec: [{var7:F999999.999999}]
Float European more dec: [{var7:F999999,999999}]

When combining formatting and statistical the statistical need to come last.

[{Price:R15 Sum}] or [{Price:F99999.99 sum}] or [{CustomerNr:L4 Count}]

.page -- will send HTML page break.

<br><br><pre></pre>

If you use this tag around your output, the resulting code will be treated as TEXT i.e. space, line feed and position will be honoured (DFD mode)

Returns/Result


Nothing

Examples


Example 1: Simple Order printed to Memo.

DQL:
for OrderHead with OrderNr = Data-entry field1 ;

list records

OrderNr ;

Customer ;

Address ;

Address1 ;

PostCode ;

Town ;

Terms;

OrderTotal ;

DueDate .

for OrderLine

list records

Description ;

Price ;

Count ;

LineTotal : item sum ;

LineTotal*0.2 : sum ;

LineTotal+LineTotal* 0.2 : sum .

end

Body:

.header

Order nr.: [{OrderNr}]

To:

[{Customer}]

[{Address}]

[{Address1}]

[{PostCode}]

[{Town}]

Terms: [{Terms}] days. Due date: [{DueDate}]

Description Price0 Count LineTotal

-----------------------------------------------------------------------------------------------------

.items

[{Description:L40}][{Price:R10}][{Count:R8}][{LineTotal:R17}]

.footer

-----------------------------------------------------------------------------------------------------

OrderTotal : [{LineTotal:R50 sum}]

=====================================================================================================

.end

End of report....


Button Code:

MemoExecDQL(DQL,OrderNr,"","","","Memo:Result",Body)

Reference

See Also



CHR()


GetValue()

ExecDQL()

LabelExecDQL()

TextExecDQL()

StringEscape()

On the forum about MemoExecDQL

[@EOF@]...

Product: . Written by alembagheri tahmas 07/12/13 at 13:37:32

Hi there,I am trying to use an external MySQL DB in dataease. I have successfully create the ODBC link and added the DB to dataease. I can also access the DB from dataease. Now, just for testing purposes, I am trying to create a simple report b...

Product: DataEase for Windows 7.x. Written by George Washington 11/04/14 at 08:26:17

no se pude exportar ahora archivos a pdf, ni a excel o otros cosa mala. en verdad creo que hace faltaen las versiones anteriores me funcionaba mas o menos bien.&nbsp;le hace falta a los aplicativos que se desarrollan en Dataeasegr...

Product: DataEase 8 Reporter. Written by eduardo paez 02/05/14 at 14:40:11

Thanks. Anyway I'm trying to use this fuction but it seems to me that it doesn't work on 8.2. I tried also in a DQL.There's something wrong?<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAJ3CAYAAAB4NWk3AAAAAXNSR0IArs4...

Product: . Written by Marco Marchesi 15/02/16 at 14:50:46

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Chamil Rajindra 21/02/19 at 10:17:46

Thanks for the very good explanation!AS...

Product: . Written by afonso santos 28/10/19 at 00:50:14

I am pleased to see that the migration from Dos 4.53 is then sa 5.5 works. A really useful thing would be a compiler of SQL languages. Will you get there?Original Text:Mi compiaccio a vedere che la migrazione da Dos 4.53 รจ poi sa 5.5 funzio...

Product: . Written by Grossi Gioacchino 18/11/19 at 14:33:44

How can i delete a Style sheet?...

Product: Dataease [{8}]FIVE. Written by Rainer 22/03/21 at 11:13:10

I run W7 and since a few days&nbsp;Dataease 8.5 is not starting any more, do you have an idea? i installed it again but that did not help....

Product: Dataease [{8}]FIVE. Written by Rainer 08/06/21 at 14:12:40

[@EOF@]...

Product: . Written by Hiralal Rampul 01/12/21 at 17:47:10

On the blog about MemoExecDQL


dg3_HelpView