Simplicty and flexibility!

Exporting a report with group headers

Started by Godfrey
You will need to Sign In to be able to add or comment on the forum!

Exporting a report with group headers

How do i export a report with group headers to excel.

For example

for EmployeeDetails ;

list records

Department ;

DeptCode in groups ;

Employee No ;


BasicPay .


Written by Godfrey 25/11/20 at 10:12:13 Dataease [{8}]FIVE

Re:Exporting a report with group headers

Download Sample

Hi Godfrey

I don't know how familiar you are with this ,export thing that is a part of DQL in DFW.

To be honest, I have never really got my head around it and thought that I would include that in my sample this time but had to give up. Maybe somebody else could offer to help on that.

We simply created ExecDQL to begin with simply to come around all this.

Personally I've never understood how DQL could be implemented without the fantastic export feature that DQL itself was in DFD...

However ExecDQL do all of this so that is the solution we have offered up.

We have used LabelExecDQL here, but the syntax is the same for all of them.


MemoContianingDQL: (String)

Object name for the Label that contain the DQL you want to execute always in "" - "Labelname"

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: (String)

There is several different output modes for LabelExecDQL.

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: LabelExecDQL("DQL","","","","","C:\test.txt","Layout") or : LabelExecDQL("DQL","","","","","file:C:\test.txt","Layout")


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. LabelExecDQL("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.


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


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.


This is the Label where the layout format for the DQL is stored. Always in "" - "Layout"


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


Tags: [{column name}]
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}]

.page -- will send HTML page break.

Written by DataEase 25/11/20 at 12:30:43 Dataease [{8}]FIVE