PWCT 1.9 Art Documentation ( http://doublesvsoop.sourceforge.net )

2006-2019, Mahmoud Fayed ( msfclipper@users.sourceforge.net )

_____________________________________________________________________________________

Table of contents

1 - Introduction

2 - Implementation steps

3 - Final Steps Tree

4 - Application during the runtime

1 - Introduction

In this lesson we are going to learn how to export reports to HTML and Excel files.

2 - Implementation Steps

Open CustomersReport.SSF

s1.JPG

Fig. 1

s2.JPG

Fig. 2

s3.JPG

Fig. 3

s4.JPG

Fig. 4

s5.JPG

Fig. 5

s6.JPG

Fig. 6

s7.JPG

Fig. 7

s8.JPG

Fig. 8

s9.JPG

Fig. 9

s10.JPG

Fig. 10

s11.JPG

Fig. 11

s12.JPG

Fig. 12

Open method SizeReport

s13.JPG

Fig. 13

s14.JPG

Fig. 14

s15.JPG

Fig. 15

s16.JPG

Fig. 16

Press CTRL+R to generate the source code file.

s17.JPG

Fig. 17

3 - Final Steps Tree

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

CustomersReport.SSF

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

Set Class Name & Window Name

                PWCT-Code Generator: Replace String (MyClassName) with (CustomersReportClass)

                PWCT-Code Generator: Replace String (MyWindowName) with (&(self:cWindowName))

Class

                Define Class MyClassName From Report_Base

                                Declare Class Data

                                                Data ReportName Init Value "Customers_All"

                                                Data cWindowName Init Value "CustomersReportWindow"

                                Declare Class Methods

                                                Method showwindow

                                                Method closewindow

                                                Method SizeReport

                                End of Class

                                Class Methods

                                                Define Method ShowWindow Class MyClassName

                                                                Start Here

                                                                                Define New Window ( MyWindowName ) , Title : "Customers Report"

                                                                                                Window Events

                                                                                                                Event: ON INIT : Action self:ShowReport()

                                                                                                                Event: ON SIZE : Action self:SizeReport()

                                                                                                                Event: ON MAXIMIZE : Action self:SizeReport()

                                                                                                Window Properties

                                                                                                Window Controls

                                                                                                                Define New Button ( btn1 ) , Caption : "Close"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:CloseWindow()

                                                                                                                                Button Properties

                                                                                                                Define New Button ( btn2 ) , Caption : "Print"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:PrintReport()

                                                                                                                                Button Properties

                                                                                                                Define New Button ( btn3 ) , Caption : "Refresh"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:ShowReport()

                                                                                                                                Button Properties

                                                                                                                Active Control ( self:oActiveX )

                                                                                                                Define New Button ( btn4 ) , Caption : "Export to HTML"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:ExportReport()

                                                                                                                                Button Properties

                                                                                                                Define New Button ( btn5 ) , Caption : "Export to Excel"

                                                                                                                                Button Events

                                                                                                                                                Event: ON CLICK : Action self:ExportReport2()

                                                                                                                                Button Properties

                                                                                                End Of Window

                                                                                                MyWindowName.Maximize ( )

                                                                                                Activate window

                                                                End of Method (Return 0)

                                                Define Method CloseWindow Class MyClassName

                                                                Start Here

                                                                                MyWindowName.Release ( )

                                                                End of Method (Return 0)

                                                Define Method SizeReport Class MyClassName

                                                                Start Here

                                                                                Local tempvar1,tempvar2

                                                                                tempvar1 = MyWindowName.Width

                                                                                tempvar2 = MyWindowName.Height

                                                                                self:oactivex.nWidth := tempvar1 - 84

                                                                                self:oactivex.nHeight := tempvar2 - 125

                                                                                MyWindowName.btn1.Row := tempvar2-88

                                                                                MyWindowName.btn2.Row := tempvar2-88

                                                                                MyWindowName.btn3.Row := tempvar2-88

                                                                                MyWindowName.btn4.Row := tempvar2-88

                                                                                MyWindowName.btn5.Row := tempvar2-88

                                                                                self:oactivex.Show ( )

                                                                End of Method (Return 0)

4 - Application during the runtime

runtime1.JPG

Fig.18

runtime2.JPG

Fig.19

runtime3.JPG

Fig.20

runtime4.JPG

Fig.21