Printing/reporting a very simple thing which we used to do it in clipper & DOS has turned out to be a very complicated thing in Windows environment.
![Surprised :o](./images/smilies/icon_surprised.gif)
Regards
Anser
No installation/setup is necessary – if your Fivewin application executes on the client machine also the report is working!
Do you mean that we don't have to install EasyReport on each client machine ? Instead, all the contents of the Folder Distribution (ErStart.Exe, many DLL's etc) and the .vrd file (Report File) should be distributed along with our FWH application
no this is all handled automatically.and from FWH we can call EasyReport using the following command
ShellExecute( 0, "Open", "ERStart.exe", "-File=.\test.vrd -PREVIEW", NIL, 1 )
Any idea where should be the Distribution folder copied while we distribute the FWH application ?
Can we use EasyReport to create reports using the data from MySQL tables ?
Code: Select all | Expand
function f_paket
local oVRD
local lPreview :=.t.
local cPrinter := GetPvProfString( "DRUCKER","Standard","Standard", ".\INI\WINHOTEL.INI" )
local cCompany := ""
local cAddr1 := ""
local cAddr2 := ""
local cAddr3 := ""
local cAnrede := ""
local cName := ""
local cStrasse := ""
local cOrt := ""
local cLandFeld := ""
cCompany := ALLTRIM(setup->company)
cAddr1 := ALLTRIM(setup->addr1)
cAddr2 := ALLTRIM(setup->addr2)
cAddr3 := ALLTRIM(setup->addr3)
cAnrede := kunden->anrede
cName := ALLTRIM(kunden->name)+" "+ALLTRIM(kunden->vorname)+" "+Trim(kunden->titel)
cStrasse := kunden->strasse
cOrt := ALLTRIM(kunden->plz)+" "+kunden->ort
cLandFeld := f_landfeld(kunden->lkz)
//----------------------------------------------------------------------------//
EASYREPORT oVRD NAME ".\xVRD\Paketaufkleber.vrd" ;
PREVIEW lPreview TO cPrinter OF oWnd PRINTDIALOG IIF( lPreview, .F., .F. )
PRINTAREA 1 OF oVRD ;
ITEMIDS { 101,102,103,104,204,205,206,207,208 } ;
ITEMVALUES { cCompany,cAddr1,cAddr2,cAddr3,cAnrede,cName,cStrasse,cOrt,cLandFeld }
oVRD:End()
RETURN NIL
//----------------------------------------------------------------------------//
Code: Select all | Expand
//Print position header
PRINTAREA 2 OF oVRD
Code: Select all | Expand
do while .not. eof()
PRINTAREA 3 OF oVRD ;
ITEMIDS { 101,102,105,106,107 } ;
ITEMVALUES { cMenge, ;
cBezeichnung, ;
cPreis, ;
cWert, ;
cRabatt }
enddo
Code: Select all | Expand
//Print order footer
cText1 := "Fortsetzung Seite: " + ALLTRIM(str(nSeite))
cText2 := "Zwischensumme " + ALLTRIM(transform( rgsumm ,"999,999.99")) //text Fortsetzungsblatt
PRINTAREA 9 OF oVRD ;
ITEMIDS { 101, 102 } ;
ITEMVALUES { cText1, cText2 }
IF oVRD:nNextRow > oVRD:nPageBreak
nSeite := nSeite + 1
//Print order footer
cText1 := "Fortsetzung Seite: " + ALLTRIM(str(nSeite))
cText2 := "Zwischensumme " + ALLTRIM(transform( rgsumm ,"999,999.99")) //text Fortsetzungsblatt
PRINTAREA 9 OF oVRD ;
ITEMIDS { 101, 102 } ;
ITEMVALUES { cText1, cText2 }
PAGEBREAK oVRD
//Print position header
cText1 := "Seite: " + ALLTRIM(str(nSeite))
cText2 := "Rechnung-NR: " + cOrderNr
PRINTAREA 6 OF oVRD ;
ITEMIDS { 101, 102,105 ,106} ;
ITEMVALUES { cText1, cText2,"Übertrag:",ALLTRIM(transform( rgsumm ,"999,999.99")) }
PRINTAREA 2 OF oVRD
Code: Select all | Expand
REPORT oReport;
HEADER ;
"Invoice: "+trim(::invno), "Page: "+;
ltrim(str(oReport:nPage,3)) RIGHT;
TITLE ::oSysdata:company, ;
::oSysdata:address,;
trim(::oSysdata:city)+", "+trim(::oSysdata:state)+" "+::oSysdata:zip,;
" "," ",;
"Ship to:", ;
" ",;
::oCustomer:Contact,;
::oCustomer:company,;
trim(::oCustomer:address1)+if(!empty(::oCustomer:address2),", "+::oCustomer:address2,""),;
trim(::oCustomer:city)+", "+trim(::oCustomer:state)+" "+::oCustomer:zip,;
::oCustomer:phone," "," ",;
"PO No: "+::oInvmast:PONum+" Invoice date: "+dtoc(::oInvmast:invdte)+;
" Terms: "+::oInvmast:pterms LEFT;//+" Salesperson: "," " LEFT;
FOOTER cFooter1,cFooter2 CENTER;
FONT oFont;
TO DEVICE oDevice
IF oVRD:nNextRow > oVRD:nPageBreak
Code: Select all | Expand
[General]
EditProperties=1
EditAreaProperties=1
EditLanguage=1
DeveloperMode=1
InsertMode=1
Title=Rechnung
Measure=1
GridWidth=1
GridHeight=1
ShowGrid=0
TopMargin=26
LeftMargin=11
Expressions=1
GeneralExpressions=EasyReport General.dbf
UserExpressions=EasyReport User.dbf
DataExpressions=EasyReport Database.dbf
PageBreak=240
Orientation=1
ShowInfoMsg=1
PrintIDs=1
Group=Order
AreaFilesDir=.\xVRD\
PaperSize=9
PaperWidth=0
PaperHeight=0
[Fonts]
// maximal 20
// Parameters: name| nWidth| nHeight| bold| italic| underline| strikeout| escapement
1=Arial| 0| -12| 0| 0| 0| 0| 0
2=Arial| 0| -20| 1| 0| 0| 0| 0
3=Arial| 0| -9| 0| 0| 0| 0| 0
4=Arial| 5| -12| 0| 1| 1| 0| 0
5=Arial| 0| -18| 1| 1| 1| 0| 200
6=Arial| 0| -7| 0| 0| 0| 0| 0
7=Arial| 0| -12| 0| 0| 0| 0| 0
8=Arial| 0| -12| 0| 0| 0| 0| 2700
9=Arial| 0| -12| 0| 0| 0| 0| 900
10=Arial| 0| -14| 1| 0| 0| 0| 0
11=Arial| 0| -8| 0| 0| 0| 0| 0
[Colors]
// Parameters: RGB - A numeric (RGB) value corresponding to the red| green
// and blue values specified.
1=0
2=16777215
3=0
4=4227072
5=8421376
6=65535
7=13500148
8=16250871
9=8355711
11=0
[Infos]
Author=Mag. Otto Atzwanger
Company=Atzwanger Tourismussoftware
Comment=Rechnung
Revision=1996
SaveDate=20.05.2009
SaveTime=08:30:47
[Areas]
1=rechnung.v01
2=rechnung.v02
3=rechnung.v03
4=rechnung.v04
5=rechnung.v05
6=rechnung.v06
7=rechnung.v07
8=rechnung.v08
9=rechnung.v09
10=rechnung.v10
11=rechnung.v11
12=rechnung.v12
13=rechnung.v13
14=rechnung.v14
15=rechnung.v15
16=rechnung.v16
17=rechnung.v17
oprn:line() && for printing line
PRINT oPRN NAME "Title"
PAGE
oprn:say() && for printing text
oprn:line() && for printing line
ENDPAGE
ENDPRINT
anserkk wrote:From where can I get the Class TCLIPPRT so that I can also test printing using the class
What about printing a vertical line ? Boxes
Code: Select all | Expand
#include "FiveWin.ch"
#INCLUDE "VRD.CH"
static oWnd
//----------------------------------------------------------------------------//
function Main()
local oBar
local oPopup
DEFINE WINDOW oWnd FROM 1, 10 TO 20, 60 ;
TITLE "Printing an invoice"
@ 3,10 BUTTON "invoice" size 100,50 OF oWnd ACTION PrintInvoice()
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
function PrintInvoice()
local oVRD
local company := "ABC Company"
local add1 := "Address 12/123445"
local add2 := "That Street"
local Pincode := "Pincode : 999999"
local InvoiceNo := "23"
local InvoiceDt := "15-05-2009"
local I := 0
local nTotal := 0
local aArr := {;
{"1" , "Item 1", "3", "10.00" , " 4%" , "0.40", "10.40" },;
{"2" , "Item 2", "5", "15.00" , " 4%" , "0.40", "15.40" },;
{"3" , "Item 3", "2", "20.00" , " 4%" , "0.40", "20.40" } }
EASYREPORT oVRD NAME ".\xVRD\invoice.vrd"
PRINTAREA 1 OF oVRD;
ITEMIDS { 101,102,103,104,105,106 } ;
ITEMVALUES { company,add1,add2,Pincode,InvoiceNo,InvoiceDt }
PRINTAREA 2 OF oVRD
FOR I = 1 to len(aArr)
IF oVRD:nNextRow > oVRD:nPageBreak
PAGEBREAK oVRD
endif
nTotal := nTotal + VAL(aArr[I,7])
PRINTAREA 3 OF oVRD ;
ITEMIDS { 101,102,103,104,105,106,107 } ;
ITEMVALUES { aArr[I,1],aArr[I,2],aArr[I,3],aArr[I,4],aArr[I,5],aArr[I,6],aArr[I,7] }
next
PRINTAREA 4 OF oVRD ;
ITEMIDS { 107 } ;
ITEMVALUES { str(nTotal) }
oVRD:End()
return nil
I feel you are not convinced.
Look in the bottom of the first page of your post: Manuel Mercado directly suggest you tu use TCLIPPRT class and wrote you the link .