| Name | Initial value | Comment |
|---|---|---|
| ^afieldlist[1,4] | .f. | |
| cfontnamedetail | ||
| cfontnamedetailtitle | ||
| cfontnamepagetitle | ||
| cfontnamepagetitle_2 | ||
| cfontstyledetail | ||
| cfontstyledetailtitle | ||
| cfontstylepagetitle | ||
| cfontstylepagetitle_2 | ||
| cpagetitle | ||
| cpagetitle_2 | ||
| crepnamelandscape | rtmpland | |
| crepnameportrait | rtmpport | |
| creportname | ||
| creporttemplate | ||
| lnhpos | .F. | |
| lpagenumbernotonfirstpage | .F. | |
| lprintdate | .T. | |
| lprintpagenumber | .T. | |
| lprinttime | .T. | |
| lrepeatpagetitle | .T. | |
| lrepeatpagetitle_2 | .T. | |
| lusefontdetail | .f. | |
| lusefontdetailtitle | .f. | |
| lusefontpagetitle | .F. | |
| lusefontpagetitle_2 | .f. | |
| nfontsizedetail | 0 | |
| nfontsizedetailtitle | 0 | |
| nfontsizepagetitle | 0 | |
| nfontsizepagetitle_2 | 0 | |
| norientation | .f. |
THIS.setdefaultproperties()
IF !THIS.createnewreport()
RETURN .F.
ENDIF
LOCAL lnselect, lcalias, lnvpos, lalable, lafield, lni
DIMENSION lalable[1,1], lafield[1,1]
lnselect = SELECT(0)
WITH THIS
.creporttemplate = STRTRAN(.creporttemplate,".frx","")
.creporttemplate = STRTRAN(.creporttemplate,".frt","")
.creportname = STRTRAN(.creportname,".frx","")
.creportname = STRTRAN(.creportname,".frt","")
USE (.creporttemplate+".frx") IN 0 ALIAS tempreport
SELECT tempreport
COPY TO (.creportname+".frx")
USE IN tempreport
lcalias = "X"+SUBSTR(SYS(2015),4,7)
USE (.creportname+".frx") IN 0 ALIAS (lcalias) EXCLUSIV
SELECT (lcalias)
GO TOP
REPLACE TAG WITH "",tag2 WITH "",EXPR WITH "ORIENTATION="+STR(.norientation,1)
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "PAGETITLE"
IF FOUND()
REPLACE EXPR WITH IIF(!EMPTY(.cpagetitle), .cpagetitle, ""), ;
supexpr WITH IIF(!.lrepeatpagetitle, "_pageno = 1", supexpr)
IF .lusefontpagetitle
.setfont(.T., .F., EXPR, .cfontnamepagetitle, .nfontsizepagetitle, .cfontstylepagetitle)
ENDIF
ENDIF
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "PAGETITLE_2"
IF FOUND()
REPLACE EXPR WITH IIF(!EMPTY(.cpagetitle_2), .cpagetitle_2, ""), ;
supexpr WITH IIF(!.lrepeatpagetitle_2, "_pageno = 1", supexpr)
IF .lusefontpagetitle
.setfont(.T., .F., EXPR, .cfontnamepagetitle_2, .nfontsizepagetitle_2, .cfontstylepagetitle_2)
ENDIF
ENDIF
DO CASE
CASE !.lprintpagenumber
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"PAGE"'
IF FOUND()
DELETE
ENDIF
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "_PAGENO"
IF FOUND()
DELETE
ENDIF
OTHERWISE
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"PAGE"'
IF FOUND()
REPLACE EXPR WITH '"'+cap_page+'"'
ENDIF
IF .lpagenumbernotonfirstpage
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"PAGE"'
IF FOUND()
REPLACE supexpr WITH "_pageno <> 1"
ENDIF
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "_PAGENO"
IF FOUND()
REPLACE supexpr WITH "_pageno <> 1"
ENDIF
ENDIF
IF .lusefontdetailtitle
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"PAGE"'
.setfont(.T., .T., EXPR, .cfontnamedetailtitle, .nfontsizedetailtitle, .cfontstyledetailtitle)
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "_PAGENO"
.setfont(.T., .F., EXPR, .cfontnamedetailtitle, .nfontsizedetailtitle, .cfontstyledetailtitle)
ENDIF
ENDCASE
DO CASE
CASE !.lprintdate
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"DATE"'
IF FOUND()
DELETE
ENDIF
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "DATE()"
IF FOUND()
DELETE
ENDIF
CASE .lusefontdetailtitle
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"DATE"'
REPLACE EXPR WITH '"'+cap_date+'"'
.setfont(.T., .T., EXPR, .cfontnamedetailtitle, .nfontsizedetailtitle, .cfontstyledetailtitle)
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "DATE()"
.setfont(.T., .F., EXPR, .cfontnamedetailtitle, .nfontsizedetailtitle, .cfontstyledetailtitle)
OTHERWISE
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"DATE"'
REPLACE EXPR WITH '"'+cap_date+'"'
ENDCASE
DO CASE
CASE !.lprinttime
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"TIME"'
IF FOUND()
DELETE
ENDIF
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "TIME()"
IF FOUND()
DELETE
ENDIF
CASE .lusefontdetailtitle
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"TIME"'
REPLACE EXPR WITH '"'+cap_time+'"'
.setfont(.T., .T., EXPR, .cfontnamedetailtitle, .nfontsizedetailtitle, .cfontstyledetailtitle)
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "TIME()"
.setfont(.T., .F., EXPR, .cfontnamedetailtitle, .nfontsizedetailtitle, .cfontstyledetailtitle)
OTHERWISE
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == '"TIME"'
REPLACE EXPR WITH '"'+cap_time+'"'
ENDCASE
LOCATE FOR objtype = 5 AND UPPER(TRIM(EXPR)) == '"DETAILTITLE"'
IF FOUND()
lnhpos = hpos
SCATTER MEMO TO lalable
DELETE
ENDIF
LOCATE FOR objtype = 8 AND UPPER(TRIM(EXPR)) == "DETAIL"
IF FOUND()
lnhpos = hpos
SCATTER MEMO TO lafield
DELETE
ENDIF
FOR lni = 1 TO ALEN(.afieldlist, 1)
IF EMPTY(.afieldlist)
EXIT
ENDIF
INSERT INTO (lcalias) FROM ARRAY lalable
REPLACE uniqueid WITH SYS(2015), ;
EXPR WITH IIF(ALLTRIM(.afieldlist[lni, 2])#"''", .afieldlist[lni, 2], "' '"), ;
hpos WITH lnhpos
.setfont(.lusefontdetailtitle, .T., EXPR, .cfontnamedetailtitle, .nfontsizedetailtitle, ;
.cfontstyledetailtitle)
INSERT INTO (lcalias) FROM ARRAY lafield
REPLACE uniqueid WITH SYS(2015), ;
EXPR WITH IIF(!EMPTY(.afieldlist[lni, 1]), .afieldlist[lni, 1], ""), ;
hpos WITH lnhpos,;
picture with iif(!empty(.aFieldList[lni, 4]), .aFieldList[lni, 4], "")
.setfont(.lusefontdetail, .T., EXPR, .cfontnamedetail, .nfontsizedetail, ;
.cfontstyledetail, .afieldlist[lni, 3])
lnhpos = lnhpos + WIDTH + 500
NEXT lni
PACK
USE IN (lcalias)
SELECT (lnselect)
ENDWITH
LOCAL lcreportname
lcreportname = TRIM(THIS.creportname) + ".frx"
DELETE FILE (lcreportname)
lcreportname = TRIM(THIS.creportname) + ".frt"
DELETE FILE (lcreportname)
LPARAMETERS tlreplacefont, tlreplacewidth, tcexpr, tcfontname, tnfontsize, tcfontstyle, tnfieldlen
IF tlreplacefont
REPLACE fontface WITH tcfontname, ;
FONTSIZE WITH tnfontsize, ;
fontstyle WITH .getnumericfontstyle(tcfontstyle), ;
HEIGHT WITH (FONTMETRIC(1, fontface, FONTSIZE, tcfontstyle) + 1) * 100
ENDIF
IF tlreplacewidth
IF !EMPTY(tnfieldlen)
REPLACE WIDTH WITH tnfieldlen * 110
ELSE
REPLACE WIDTH WITH FONTMETRIC(6, fontface, FONTSIZE, .getcharacterfontstyle(fontstyle)) * ;
TXTWIDTH(TRIM(tcexpr), fontface, FONTSIZE, ;
.getcharacterfontstyle(fontstyle)) * 100
ENDIF
ENDIF
WITH THIS
* Reportname
IF EMPTY(.creportname)
.creportname = "x"+SUBSTR(SYS(2015),4,7)
ENDIF
* Orientation
IF EMPTY(.norientation)
.norientation = 0
ENDIF
* Reporttemplate
IF EMPTY(.creporttemplate)
IF .norientation = 0
.creporttemplate = .crepnameportrait
ELSE
.creporttemplate = .crepnamelandscape
ENDIF
ENDIF
* Font, Size, Style
IF !EMPTY(.cfontnamepagetitle)
.lusefontpagetitle = .T.
ENDIF
IF !EMPTY(.cfontnamepagetitle_2)
.lusefontpagetitle_2 = .T.
ENDIF
IF !EMPTY(.cfontnamedetailtitle)
.lusefontdetailtitle = .T.
ENDIF
IF !EMPTY(.cfontnamedetail)
.lusefontdetail = .T.
ENDIF
ENDWITH
LPARAMETERS tcfontstyle
LOCAL lnfontstyle
DO CASE
CASE "B" $ tcfontstyle AND "I" $ tcfontstyle
lnfontstyle = 3
CASE "B" $ tcfontstyle
lnfontstyle = 1
CASE "I" $ tcfontstyle
lnfontstyle = 2
OTHERWISE
lnfontstyle = 0
ENDCASE
RETURN (lnfontstyle)
LPARAMETERS tnfontstyle
LOCAL lcfontstyle
DO CASE
CASE tnfontstyle = 3
lcfontstyle = "BI"
CASE tnfontstyle = 1
lcfontstyle = "B"
CASE tnfontstyle = 2
lcfontstyle = "I"
OTHERWISE
lcfontstyle = "N"
ENDCASE
RETURN (lcfontstyle)
DIMENSION afieldlist[1, 4]
afieldlist = .F.
| Name | Initial value |
|---|---|
| AutoCenter | .T. |
| Caption | "Grid Report" |
| DataSession | 1 |
| DoCreate | .T. |
| WindowType | 1 |
| lmultiinstance | .F. |
| lsaveposition | .F. |
| Name | Initial value | Comment |
|---|---|---|
| ^afontstyle[1,1] | .f. | Enthällt mögliche Fontstyles. |
| currentdatasession | .f. |
DODEFAULT()
SET DATASESSION TO THISFORM.currentdatasession
PARAMETERS toobjfrm, toobjgrd, tlpreview
IF VARTYPE(toObjFrm) # "O" OR UPPER(toobjfrm.BASECLASS) # "FORM"
RETURN .F.
ENDIF
IF VARTYPE(toObjGrd) # "O" OR UPPER(toobjgrd.BASECLASS) # "GRID"
LOCAL lnpagelist, llusegrid, llusepanel
lnpagelist = IIF(pemstatus(toobjfrm,'nPageList',5), toobjfrm.npagelist, 0)
llusegrid = IIF(TYPE("toObjFrm.pgfPageFrame")="O",toobjfrm.pgfpageframe.lusegrid,.F.)
llusepanel = IIF(TYPE("toObjFrm.cntPanel")="O",.T.,.F.)
IF llusegrid AND lnpagelist > 0
*!* Delayed instatiation: grid may not be instantiated...
IF TYPE("toObjFrm.pgfPageFrame.pages(toObjFrm.nPageList).grdGrid") # "O"
toobjfrm.pgfpageframe.PAGES(toobjfrm.npagelist).ACTIVATE()
ENDIF
IF TYPE("toObjFrm.pgfPageFrame.pages(toObjFrm.nPageList).grdGrid") = "O"
toobjgrd = toobjfrm.pgfpageframe.PAGES(toobjfrm.npagelist).grdgrid
ELSE
RETURN .F.
ENDIF
ELSE
IF llusepanel
IF TYPE("toObjFrm.cntPanel.grdGrid") = "O"
toobjgrd = toobjfrm.cntpanel.grdgrid
ELSE
RETURN .F.
ENDIF
ELSE
RETURN .F.
ENDIF
ENDIF
ELSE
RETURN .F.
ENDIF
THISFORM.currentdatasession = SET("datasession")
SET DATASESSION TO toobjfrm.DATASESSIONID
*-- Variablen definieren
LOCAL lcreportname, lcpagetitle, lcpagetitle_2, lcfnptitle, lcfnptitle_2, ;
lcfndtitle, lcfndetail, lcfsptitle, lcfsdtitle_2, lcfsdtitle, lcfsdetail, ;
lnorientation, lnfsptitle, lnfsptitle_2, lnfsdtitle, lnfsdetail, lcprintkind
LOCAL llrptitle, llrptitle_2, llppnumber, llpnnfpage, llpdate, llptime
LOCAL cmdpickrep, cmddone, cmdcancel
*-- Initialisiere die lokalen Variablen
WITH THISFORM.pgfpageframe.page1
* .lcReportName.value = ""
.lcpagetitle.VALUE = toobjfrm.CAPTION
.lcpagetitle_2.VALUE = ""
* .lcFNPTitle.value = ""
* .lcFNPTitle_2.Value = ""
* .lcFNDTitle.value = ""
* .lcFNDetail.value = ""
* .lcFSPTitle.value = ""
* .lcFSDTitle_2.value = ""
* .lcFSDTitle.value = ""
* .lcFSDetail.value = ""
.lnorientation.VALUE = 1
.lcprintkind.VALUE = IIF(tlpreview,1,2)
* .lnFSPTitle.value = 0
* .lnFSPTitle_2.value = 0
* .lnFSDTitle.value = 0
* .lnFSDetail.value = 0
* .llRPTitle.Value = .T.
* .llRPTitle_2.value = .T.
.llppnumber.VALUE = .T.
.llpnnfpage.VALUE = .F.
.llpdate.VALUE = .T.
.llptime.VALUE = .T.
ENDWITH
*-- initialisiere das Array mit den Feldern, die in dem Report erscheinen sollen
DIMENSION THISFORM.afontstyle(1,2)
THISFORM.afontstyle = ""
*-- verschiedenen FontStyles hier definieren
DIMENSION THISFORM.afontstyle(4,2)
THISFORM.afontstyle(1,1) = "N" && Regular
THISFORM.afontstyle(2,1) = "I" && Italic
THISFORM.afontstyle(3,1) = "B" && Bold
THISFORM.afontstyle(4,1) = "BI" && Bold,Italic
THISFORM.afontstyle(1,2) = "Regular"
THISFORM.afontstyle(2,2) = "Italic"
THISFORM.afontstyle(3,2) = "Bold"
THISFORM.afontstyle(4,2) = "Bold,Italic"
*-- Felder zum ausdrucken aus dem Grid lesen
LOCAL lctable, lcfield,osourse, oselected, omover, lcccontr
osource = THISFORM.pgfpageframe.page2.cmover1.lstsource
oselected = THISFORM.pgfpageframe.page2.cmover1.lstselected
omover = THISFORM.pgfpageframe.page2.cmover1
LOCAL ladummy
DIMENSION ladummy(1,1)
ladummy = ""
FOR i=1 TO toobjgrd.COLUMNCOUNT
DIMENSION ladummy(i,4)
FOR j=1 TO toobjgrd.COLUMNCOUNT
IF toobjgrd.COLUMNS(j).COLUMNORDER = i
lcccontr = toobjgrd.COLUMNS(j).CURRENTCONTROL
*!* New support of checkboxes and calculated fields.
IF UPPER(toobjgrd.COLUMNS(j).&lcccontr..COMMENT)="*CALCULATED FIELD"
ladummy(i,2) = toobjgrd.COLUMNS(j).&lcccontr..PARENT.CONTROLSOURCE
ELSE
IF LOWER(toobjgrd.COLUMNS(j).&lcccontr..BASECLASS)="checkbox"
ladummy(i,2) = "IIF("+toobjgrd.COLUMNS(j).&lcccontr..PARENT.CONTROLSOURCE+",'×',' ')"
ELSE
ladummy(i,2) = toobjgrd.COLUMNS(j).&lcccontr..COMMENT
ENDIF
ENDIF
ladummy(i,1) = "'" + ALLTRIM(toobjgrd.COLUMNS(j).header1.CAPTION) + "'"
ladummy(i,3) = toobjgrd.COLUMNS(j).WIDTH
laDummy(i,4) = toObjGrd.columns(j).&lcCContr..inputmask
ENDIF
ENDFOR
ENDFOR
*--
omover.SETDATA(@ladummy, @ladummy)
RELEASE ladummy
THIS.VISIBLE=.T.
RETURN DODEFAULT()
**__VFX_WIZARD_HEADER - 30.08.1998 14:21:37
thisForm.Caption = CAP_FRMGRIDREPORT
thisform.pgfpageframe.page1.Caption = CAP_OPTIONS
thisform.pgfpageframe.page1.clabel2.Caption = CAP_LBLTITLE
thisform.pgfpageframe.page1.clabel1.Caption = CAP_LBLPRINT
thisform.pgfpageframe.page1.lnorientation.option1.Caption = CAP_PORTRAIT
thisform.pgfpageframe.page1.lnorientation.option2.Caption = CAP_LANDSCAPE
thisform.pgfpageframe.page1.llppnumber.Caption = CAP_PAGENUMBER
thisform.pgfpageframe.page1.llpdate.Caption = CAP_DATE
thisform.pgfpageframe.page1.llptime.Caption = CAP_TIME
thisform.pgfpageframe.page1.llpnnfpage.Caption = CAP_NOTINFIRSTPAGE
thisform.pgfpageframe.page1.lcprintkind.option1.Caption = CAP_PREVIEW
thisform.pgfpageframe.page1.lcprintkind.option2.Caption = CAP_PRINT
thisform.pgfpageframe.page2.Caption = CAP_ADVANCED
thisform.pgfpageframe.page2.cmover1.lblsource.Caption = CAP_LBLFIELDS
thisform.pgfpageframe.page2.cmover1.lblselected.Caption = CAP_LBLSELECTED
thisform.cmddone.Caption = CAP_CMDOK
thisform.cmdcancel.Caption = CAP_CMDCANCEL
return .T.
**__VFX_WIZARD_FOOTER
***********************************************************
| Baseclass | Class | Object name |
|---|---|---|
| commandbutton | ccommandbutton | crepgen.cmdCancel |
| crepgen.cmdDone | ||
| pageframe | cpageframe | crepgen.pgfPageFrame |
| Name | Initial value |
|---|---|
| Caption | "Cancel" |
| FontBold | .F. |
RELEASE THISFORM
| Name | Initial value |
|---|---|
| Caption | "OK" |
| FontBold | .F. |
LOCAL ogenrep, lcrep, lnrec
ogenrep = CREATEOBJECT("cGenFrx")
WITH THIS.PARENT.pgfpageframe.page1
*-- Standard property's setzen
ogenrep.norientation = .lnorientation.VALUE-1
*-- Now it is possible to use ' and " in the titles
IF "'" $ .lcpagetitle.VALUE
ogenrep.cpagetitle = '"'+ TRIM(.lcpagetitle.VALUE) +'"'
ELSE
ogenrep.cpagetitle = "'"+ TRIM(.lcpagetitle.VALUE) +"'"
ENDIF
IF "'" $ .lcpagetitle_2.VALUE
ogenrep.cpagetitle_2 = '"'+ TRIM(.lcpagetitle_2.VALUE) +'"'
ELSE
ogenrep.cpagetitle_2 = "'"+ TRIM(.lcpagetitle_2.VALUE) +"'"
ENDIF
*--
ogenrep.lrepeatpagetitle = .T.
ogenrep.lrepeatpagetitle_2 = .T.
ogenrep.lprintpagenumber = .llppnumber.VALUE
ogenrep.lpagenumbernotonfirstpage = .llpnnfpage.VALUE
ogenrep.lprintdate = .llpdate.VALUE
ogenrep.lprinttime = .llptime.VALUE
ogenrep.cfontnamepagetitle = "Courier New"
ogenrep.cfontnamepagetitle_2 = "Times New Roman"
ogenrep.cfontnamedetailtitle = "Times New Roman"
ogenrep.cfontnamedetail = "Courier New"
ogenrep.nfontsizepagetitle = 20
ogenrep.nfontsizepagetitle_2 = 16
ogenrep.nfontsizedetailtitle = 8
ogenrep.nfontsizedetail = 8
ogenrep.cfontstylepagetitle = "BI"
ogenrep.cfontstylepagetitle_2 = "IN"
ogenrep.cfontstyledetailtitle = "BI"
ogenrep.cfontstyledetail = "N"
*-- Felder zum ausdrucken setzen
DIMENSION lagetdata(1,1)
lagetdata = ""
THISFORM.pgfpageframe.page2.cmover1.GETDATA(@lagetdata)
FOR i=1 TO ALEN(lagetdata,1)
IF EMPTY(lagetdata(i,1))
LOOP
ENDIF
*!* Skip empty controlsources/comments.
IF EMPTY(lagetdata(i,2))
LOOP
ENDIF
DIMENSION ogenrep.afieldlist(i,4)
ogenrep.afieldlist(i,1) = lagetdata(i,2)
ogenrep.afieldlist(i,2) = lagetdata(i,1)
ogenrep.afieldlist(i,3) = lagetdata(i,3)
ogenrep.afieldlist(i,4) = lagetdata(i,4)
ENDFOR
RELEASE lagetdata
ENDWITH
*-- Report generieren
ogenrep.generatereport()
lcrep = ogenrep.creportname
LOCAL lcDefault
lcDefault=SYS(5)+SYS(2003)
IF THISFORM.pgfpageframe.page1.lcprintkind.VALUE = 1
DEFINE WINDOW _preview FROM 0, 0 TO 10, 10;
TITLE ALLTRIM(THISFORM.pgfpageframe.page1.lcpagetitle.VALUE)+" ("+cap_preview+")";
IN SCREEN CLOSE GROW SYSTEM FLOAT
ZOOM WINDOW _preview MAX
previewon()
REPORT FORM (m.lcrep) PREVIEW NOCONSOLE WINDOW _preview
previewoff()
RELEASE WINDOW _preview
ELSE
lnrec = IIF(EOF(),0,RECNO())
REPORT FORM (lcrep) NOCONSOLE TO PRINTER
IF lnrec != 0
GOTO RECORD lnrec
ENDIF
RELEASE THISFORM
ENDIF
SET DEFAULT TO (lcDefault)
*-- Report löschen
ogenrep.deletecreatedreport()
| Name | Initial value |
|---|---|
| ErasePage | .T. |
| PageCount | 2 |
| Baseclass | Class | Object name |
|---|---|---|
| zzz | zzz | crepgen.pgfPageFrame.Page1 |
| crepgen.pgfPageFrame.Page2 |
| Name | Initial value |
|---|---|
| Caption | "Options" |
| Name | Initial value |
|---|---|
| AutoSize | .T. |
| Caption | "Date" |
| FontBold | .F. |
| TabIndex | 9 |
| Name | Initial value |
|---|---|
| AutoSize | .T. |
| Caption | "not on first page" |
| FontBold | .F. |
| TabIndex | 8 |
| Name | Initial value |
|---|---|
| AutoSize | .T. |
| Caption | "Page number" |
| FontBold | .F. |
| TabIndex | 7 |
IF !THIS.VALUE
THIS.PARENT.llpnnfpage.VALUE = .F.
THIS.PARENT.llpnnfpage.ENABLED = .F.
ELSE
THIS.PARENT.llpnnfpage.ENABLED = .T.
ENDIF
| Name | Initial value |
|---|---|
| AutoSize | .T. |
| Caption | "Time" |
| FontBold | .F. |
| TabIndex | 10 |
| Name | Initial value |
|---|---|
| BackStyle | 1 |
| Caption | "Print" |
| FontBold | .F. |
| FontSize | 9 |
| TabIndex | 4 |
| Name | Initial value |
|---|---|
| BackStyle | 1 |
| Caption | "Title" |
| FontBold | .F. |
| FontSize | 9 |
| TabIndex | 3 |
| Name | Initial value |
|---|---|
| BorderColor | 192,192,192 |
| ControlSource | "" |
| SpecialEffect | 1 |
| TabIndex | 5 |
| Baseclass | Class | Object name |
|---|---|---|
| zzz | zzz | crepgen.pgfPageFrame.Page1.lcPrintKind.Option1 |
| crepgen.pgfPageFrame.Page1.lcPrintKind.Option2 |
| Name | Initial value |
|---|---|
| BackStyle | 0 |
| Caption | "Preview" |
| FontBold | .F. |
| Value | 1 |
| Name | Initial value |
|---|---|
| BackStyle | 0 |
| Caption | "Print" |
| FontBold | .F. |
| Value | 0 |
| Name | Initial value |
|---|---|
| BorderColor | 192,192,192 |
| ControlSource | "" |
| SpecialEffect | 1 |
| TabIndex | 6 |
| Baseclass | Class | Object name |
|---|---|---|
| zzz | zzz | crepgen.pgfPageFrame.Page1.lnOrientation.Option1 |
| crepgen.pgfPageFrame.Page1.lnOrientation.Option2 |
| Name | Initial value |
|---|---|
| BackStyle | 0 |
| Caption | "Portrait" |
| FontBold | .F. |
| Value | 1 |
| Name | Initial value |
|---|---|
| BackStyle | 0 |
| Caption | "Landscape" |
| FontBold | .F. |
| Value | 0 |
| Name | Initial value |
|---|---|
| BackStyle | 1 |
| BorderColor | 192,192,192 |
| SpecialEffect | 1 |
| Name | Initial value |
|---|---|
| BackStyle | 1 |
| BorderColor | 192,192,192 |
| SpecialEffect | 1 |
| Name | Initial value |
|---|---|
| BackStyle | 1 |
| BorderColor | 192,192,192 |
| SpecialEffect | 1 |
| Name | Initial value |
|---|---|
| FontBold | .F. |
| TabIndex | 1 |
| Name | Initial value |
|---|---|
| FontBold | .F. |
| TabIndex | 2 |
| Name | Initial value |
|---|---|
| Caption | "Advanced" |
| Baseclass | Class | Object name |
|---|---|---|
| container | cmover | crepgen.pgfPageFrame.Page2.Cmover1 |
| shape | cshape | crepgen.pgfPageFrame.Page2.Cshape1 |
| Name | Initial value |
|---|---|
| FontBold | .F. |
| FontSize | 9 |
| Name | Initial value |
|---|---|
| Caption | "\<Fields" |
| FontBold | .F. |
| FontSize | 9 |
| Name | Initial value |
|---|---|
| BoundColumn | 2 |
| ColumnCount | 2 |
| ColumnWidths | "200,0" |
| Name | Initial value |
|---|---|
| AutoCenter | .T. |
| BufferMode | 2 |
| Caption | "Reports" |
| DataSession | 1 |
| DoCreate | .T. |
| WindowType | 1 |
| Name | Initial value | Comment |
|---|---|---|
| ddate | {} | |
| ocalledfrom |
LPARAMETERS tnreporttype
LOCAL lnselect, lcnewfile
lnselect = SELECT(0)
IF EMPTY(tnreporttype)
tnreporttype = VAL(THISFORM.cboreporttype.LIST[thisform.cboreporttype.listindex,3])
ENDIF
SELECT vfxrtype
LOCATE FOR rtypeid = tnreporttype
SELECT vfxrtemp
SEEK STR(tnreporttype,10) ORDER TAG filename DESCENDING IN vfxrtemp
SEEK STR(tnreporttype,10) ORDER TAG filename DESCENDING IN vfxrtemp
SELECT vfxrep
SEEK STR(tnreporttype,10) ORDER TAG filename DESCENDING IN vfxrep
SEEK STR(tnreporttype,10) ORDER TAG filename DESCENDING IN vfxrep
lcnewfile = TRIM(vfxrtype.filename) + ;
PADL(MAX(INT(VAL(RIGHT(TRIM(vfxrep.filename),3)))+1, ;
INT(VAL(RIGHT(TRIM(vfxrtemp.filename),2)))+1),3,"0")
SELECT (lnselect)
RETURN (lcnewfile)
LPARAMETERS tloutput
DO CASE
CASE THISFORM.chktoascii.VALUE = 1
LOCAL lcasciifile
lcasciifile = PUTFILE(MSG_SUPPLYFILENAME, "OUTPUT.TXT", "TXT")
IF !EMPTY(lcasciifile)
* delete file if it already exists !
IF FILE(lcasciifile)
DELETE FILE &lcasciifile
ENDIF
REPORT FORM (.lstreports.LIST[thisform.lstreports.listindex,2]) NOCONSOLE TO FILE &lcasciifile ASCII
ENDIF
CASE tloutput = 1
REPORT FORM (.lstreports.LIST[thisform.lstreports.listindex,2]) NOCONSOLE TO PRINTER PROMPT
OTHERWISE
LOCAL lconerror, llfailed, lcwinpath
lcwinpath = STRTRAN(ALLTRIM(GETENV("windir")) + "\system32", "\\", "\")
IF !FILE(lcwinpath + "\foxuser.dbf")
COPY FILE "_foxuser.*" TO lcwinpath + "\foxuser.*"
ENDIF
lcerror = ON("error")
llfailed = .F.
ON ERROR llfailed = .T.
SET RESOURCE ON
ON ERROR &lcerror
*!* Display preview in full size window.
DEFINE WINDOW _preview FROM 0, 0 TO 10, 10;
TITLE THIS.CAPTION+" ("+cap_preview+")" IN SCREEN CLOSE GROW SYSTEM FLOAT
ZOOM WINDOW _preview MAX
previewon()
REPORT FORM (.lstreports.LIST[thisform.lstreports.listindex,2]) NOCONSOLE PREVIEW WINDOW _preview
previewoff()
RELEASE WINDOW _preview
IF !llfailed
SET RESOURCE OFF
ENDIF
ENDCASE
LPARAMETERS tocalledfrom, tcreporttypelist
IF EMPTY(tcreporttypelist)
MESSAGEBOX(MSG_NOREPORTTYPE, 16, _SCREEN.CAPTION)
RETURN .F.
ENDIF
IF !USED("vfxrtype")
USE vfxrtype IN 0 SHARED AGAIN
ENDIF
CURSORSETPROP("buffering", 3, "vfxrtype")
IF !USED("vfxrtemp")
USE vfxrtemp IN 0 SHARED AGAIN
ENDIF
CURSORSETPROP("buffering", 3, "vfxrtemp")
IF !USED("vfxrep")
USE vfxrep IN 0 SHARED AGAIN
ENDIF
CURSORSETPROP("buffering", 3, "vfxrep")
LOCAL lccursor, lcreporttypelist, lcreporttype, lcreporttypelist, lni, lnselect
THISFORM.ocalledfrom = tocalledfrom
lnselect = SELECT(0)
lccursor = "reporttype" + SYS(2015)
lni = 1
lcreporttypelist = ""
lcreporttype = getarg(tcreporttypelist, lni, ",")
DO WHILE !EMPTY(lcreporttype)
lcreporttypelist = lcreporttypelist + STR(VAL(lcreporttype))
lni = lni +1
lcreporttype = getarg(tcreporttypelist, lni, ",")
ENDDO
THISFORM.cboreporttype.ROWSOURCE = "select descr, filename, rtypeid from vfxrtype" + ;
" where str(rtypeid) $ '" + lcreporttypelist + ;
"' into cursor " + lccursor
THISFORM.cboreporttype.REQUERY()
SELECT (lccursor)
LOCATE FOR rtypeid = THISFORM.ocalledfrom.nreporttype
IF !FOUND()
LOCATE
ENDIF
THISFORM.cboreporttype.VALUE = rtypeid
SELECT (lnselect)
THISFORM.cboreporttype.INTERACTIVECHANGE(THISFORM.ocalledfrom.nreportid)
RETURN DODEFAULT()
**__VFX_WIZARD_HEADER - 10.09.98 23:58:31
thisForm.Caption = CAP_FRMREPORTS
thisform.cmdprint.Caption = CAP_PRINT
thisform.cmdpreview.Caption = CAP_PREVIEW
thisform.cmdcancel.Caption = CAP_CMDCANCEL
thisform.cmdexport.Caption = CAP_CMDEXPORT
thisform.cmdimport.Caption = CAP_CMDIMPORT
thisform.cmdmodify.Caption = CAP_CMDMODIFY
thisform.cmdcopy.Caption = CAP_CMDCOPY
thisform.cmdcopytousers.Caption = CAP_CMDCOPYTOOTHERUSERS
thisform.cmddelete.Caption = CAP_CMDDELETE
thisform.clabel1.Caption = CAP_LBLSELECTTHEREPORTTYPE
thisform.clabel2.Caption = CAP_LBLAVAILABLEREPORTSFORSELECTEDREPORTTYPE
thisform.chktemplate.Caption = CAP_TEMPLATE
thisform.clabel4.Caption = CAP_LBLREPORTSELECTION
thisform.chktoascii.Caption = CAP_TOASCII
return .T.
**__VFX_WIZARD_FOOTER
***********************************************************
| Baseclass | Class | Object name |
|---|---|---|
| checkbox | ccheckbox | crselection.chkToAscii |
| crselection.chktemplate | ||
| combobox | ccombobox | crselection.cboreporttype |
| commandbutton | ccommandbutton | crselection.cmdcancel |
| crselection.cmdcopy | ||
| crselection.cmdcopytousers | ||
| crselection.cmddelete | ||
| crselection.cmdexport | ||
| crselection.cmdimport | ||
| crselection.cmdmodify | ||
| crselection.cmdpreview | ||
| crselection.cmdprint | ||
| editbox | ceditbox | crselection.lstdescr |
| label | clabel | crselection.Clabel1 |
| crselection.Clabel2 | ||
| crselection.Clabel4 | ||
| listbox | clistbox | crselection.lstreports |
| shape | cshape | crselection.Cshape1 |
| Name | Initial value |
|---|---|
| Caption | "To ASCII" |
| TabIndex | 19 |
| ZOrderSet | 15 |
| Name | Initial value |
|---|---|
| Caption | "Template" |
| TabIndex | 21 |
| ZOrderSet | 15 |
LOCAL lnselect, llfound
lnselect = SELECT(0)
IF THIS.VALUE
SELECT vfxrep
LOCATE FOR reportid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
llfound = FOUND()
IF llfound
INSERT INTO vfxrtemp (rtypeid, rtemplid, filename, DESCR, USER) ;
VALUES (vfxrep.rtypeid, VAL(getnewid("vfxrtemp")), vfxrep.filename, vfxrep.DESCR, ;
vfxrep.USER)
DELETE IN vfxrep
ENDIF
ELSE
SELECT vfxrtemp
LOCATE FOR rtemplid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
llfound = FOUND()
IF llfound
INSERT INTO vfxrep (rtypeid, reportid, filename, DESCR, USER) ;
VALUES (vfxrtemp.rtypeid, VAL(getnewid("vfxrep")), vfxrtemp.filename, vfxrtemp.DESCR, ;
vfxrtemp.USER)
DELETE IN vfxrtemp
ENDIF
ENDIF
IF llfound
BEGIN TRANSACTION
IF TABLEUPDATE(1,.T.,"vfxrtemp") AND ;
TABLEUPDATE(1,.T.,"vfxrep")
END TRANSACTION
ELSE
ROLLBACK
ENDIF
THIS.PARENT.cboreporttype.INTERACTIVECHANGE()
ENDIF
SELECT (lnselect)
DODEFAULT()
THIS.VISIBLE = gu_userlevel=1
THIS.ENABLED = !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
THISFORM.lstreports.LISTINDEX > 2
THIS.VALUE = THISFORM.lstreports.LIST[thisform.lstreports.listindex,6]=".t."
| Name | Initial value |
|---|---|
| BoundColumn | 3 |
| BoundTo | .T. |
| RowSourceType | 3 |
| Style | 2 |
| TabIndex | 3 |
| ZOrderSet | 2 |
| lautosetup | .F. |
WAIT WINDOW THIS.VALUE
LPARAMETERS tnreportid
DODEFAULT()
THISFORM.lstreports.CLEAR()
THISFORM.lstreports.ADDLISTITEM(MSG_REPORTTEMPLATES, 1, 1)
THISFORM.lstreports.ADDLISTITEM(MSG_TEMPLATE,2,1)
THISFORM.lstreports.ADDLISTITEM(THIS.LIST[this.listindex,2],2,2)
THISFORM.lstreports.ADDLISTITEM(THIS.LIST[this.listindex,1],2,3)
THISFORM.lstreports.ADDLISTITEM(THIS.LIST[this.listindex,1],2,4)
THISFORM.lstreports.ADDLISTITEM(".t.",2,6)
SELECT rtemplid, LEFT(DESCR,30) FROM vfxrtemp ;
WHERE STR(vfxrtemp.rtypeid,10)+UPPER(LEFT(vfxrtemp.DESCR,10))=STR(VAL(THIS.LIST[this.listindex,3]),10) ;
INTO CURSOR c_temp ORDER BY 2
SELECT c_temp
SET ORDER TO ID IN vfxrtemp
SET RELATION TO rtemplid INTO vfxrtemp
LOCAL lni, lnlistindex
lni = 3
SCAN
IF CHR(13)$vfxrtemp.DESCR
THISFORM.lstreports.ADDLISTITEM(LEFT(SUBSTR(vfxrtemp.DESCR,1,AT(CHR(13),vfxrtemp.DESCR)-1),60), lni, 1)
ELSE
THISFORM.lstreports.ADDLISTITEM(LEFT(vfxrtemp.DESCR,60), lni, 1)
ENDIF
THISFORM.lstreports.ADDLISTITEM(vfxrtemp.filename, lni, 2)
THISFORM.lstreports.ADDLISTITEM(STR(vfxrtemp.rtypeid,10), lni, 3)
THISFORM.lstreports.ADDLISTITEM(vfxrtemp.DESCR, lni, 4)
THISFORM.lstreports.ADDLISTITEM("", lni, 5)
THISFORM.lstreports.ADDLISTITEM(".t.", lni, 6)
THISFORM.lstreports.ADDLISTITEM(STR(vfxrtemp.rtemplid), lni, 7)
lni = lni +1
ENDSCAN
SELECT reportid, LEFT(DESCR,30) FROM vfxrep ;
WHERE STR(vfxrep.rtypeid,10)+UPPER(vfxrep.USER) = STR(VAL(THIS.LIST[this.listindex,3]),10)+UPPER(gu_user) ;
INTO CURSOR c_temp ORDER BY 2
SELECT c_temp
SET ORDER TO ID IN vfxrep
SET RELATION TO reportid INTO vfxrep
THISFORM.lstreports.ADDLISTITEM(MSG_OWNREPORTS, lni, 1)
lni = lni +1
SCAN
IF !EMPTY(tnreportid) AND tnreportid = vfxrep.reportid
lnlistindex = lni
ENDIF
IF CHR(13)$vfxrep.DESCR
THISFORM.lstreports.ADDLISTITEM(LEFT(SUBSTR(vfxrep.DESCR,1,AT(CHR(13),vfxrep.DESCR)-1),60), lni, 1)
ELSE
THISFORM.lstreports.ADDLISTITEM(LEFT(vfxrep.DESCR,60), lni, 1)
ENDIF
THISFORM.lstreports.ADDLISTITEM(vfxrep.filename, lni, 2)
THISFORM.lstreports.ADDLISTITEM(STR(vfxrep.rtypeid,10), lni, 3)
THISFORM.lstreports.ADDLISTITEM(vfxrep.DESCR, lni, 4)
THISFORM.lstreports.ADDLISTITEM(vfxrep.USER, lni, 5)
THISFORM.lstreports.ADDLISTITEM(".f.", lni, 6)
THISFORM.lstreports.ADDLISTITEM(STR(vfxrep.reportid), lni, 7)
lni = lni +1
ENDSCAN
IF gu_userlevel = 1
SELECT reportid, LEFT(DESCR,30) FROM vfxrep ;
WHERE STR(vfxrep.rtypeid,10) = STR(VAL(THIS.LIST[this.listindex,3]),10) AND ;
UPPER(vfxrep.USER) <> UPPER(gu_user) ;
INTO CURSOR c_temp ORDER BY 2
SELECT c_temp
SET RELATION TO reportid INTO vfxrep
THISFORM.lstreports.ADDLISTITEM(MSG_OTHERUSERREPORTS, lni, 1)
lni = lni +1
SCAN
IF !EMPTY(tnreportid) AND tnreportid = reportid
lnlistindex = lni
ENDIF
IF CHR(13)$vfxrep.DESCR
THISFORM.lstreports.ADDLISTITEM(TRIM(LEFT(SUBSTR(vfxrep.DESCR,1,AT(CHR(13),vfxrep.DESCR)-1),54))+ ;
"/"+TRIM(vfxrep.USER), lni, 1)
ELSE
THISFORM.lstreports.ADDLISTITEM(TRIM(LEFT(vfxrep.DESCR,54))+"/"+TRIM(vfxrep.USER), lni, 1)
ENDIF
THISFORM.lstreports.ADDLISTITEM(vfxrep.filename, lni, 2)
THISFORM.lstreports.ADDLISTITEM(STR(vfxrep.rtypeid,10), lni, 3)
THISFORM.lstreports.ADDLISTITEM(vfxrep.DESCR, lni, 4)
THISFORM.lstreports.ADDLISTITEM(vfxrep.USER, lni, 5)
THISFORM.lstreports.ADDLISTITEM(".f.", lni, 6)
THISFORM.lstreports.ADDLISTITEM(STR(vfxrep.reportid), lni, 7)
lni = lni +1
ENDSCAN
ENDIF
USE IN c_temp
SET ORDER TO 0 IN vfxrtemp
SET ORDER TO 0 IN vfxrep
SELECT vfxrep
THISFORM.lstreports.LISTINDEX = IIF(EMPTY(lnlistindex),2,lnlistindex)
THISFORM.lstreports.INTERACTIVECHANGE()
| Name | Initial value |
|---|---|
| Caption | "\<Cancel" |
| TabIndex | 12 |
| ZOrderSet | 5 |
THISFORM.ocalledfrom.nreporttype = THISFORM.cboreporttype.VALUE
THISFORM.ocalledfrom.nreportid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
THISFORM.RELEASE()
| Name | Initial value |
|---|---|
| Caption | "Copy" |
| TabIndex | 14 |
| ZOrderSet | 7 |
DODEFAULT()
IF !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
FILE(goprogram.creportdir + TRIM(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) + ".frx")
THIS.ENABLED = .T.
ELSE
THIS.ENABLED = .F.
ENDIF
LOCAL lcoldfile
lcoldfile = TRIM(THISFORM.lstreports.LIST[thisform.lstreports.listIndex,2])
IF !(FILE(goprogram.creportdir + lcoldfile + ".frx") AND ;
FILE(goprogram.creportdir + lcoldfile + ".frt"))
WAIT WINDOW MSG_CANNOTFINDREPORT+ " " + lcoldfile + "!"
ELSE
LOCAL lnreporttype, lcfilename, lcnewfile, lcoldreport, lcnewreport, lnrecno
lnreporttype = VAL(THISFORM.cboreporttype.LIST[thisform.cboreporttype.listindex,3])
lcfilename = TRIM(THISFORM.lstreports.LIST[thisform.lstreports.listindex,2])
lcnewfile = THISFORM.getnewfilename()
lcoldreport = goprogram.creportdir + lcoldfile + ".frx"
lcnewreport = goprogram.creportdir + lcnewfile + ".frx"
COPY FILE (lcoldreport) TO (lcnewreport)
lcoldreport = goprogram.creportdir + lcoldfile + ".frt"
lcnewreport = goprogram.creportdir + lcnewfile + ".frt"
COPY FILE (lcoldreport) TO (lcnewreport)
INSERT INTO vfxrep (rtypeid, reportid, filename, DESCR, USER) ;
VALUES (lnreporttype, VAL(getnewid("vfxrep", 10)), lcnewfile, ;
MSG_ENTERREPORTDESCRIPTION, gu_user)
BEGIN TRANSACTION
IF TABLEUPDATE(1,.T.,"vfxrep")
END TRANSACTION
ELSE
ROLLBACK
TABLEREVERT(.T.,"vfxrep")
MESSAGEBOX(MSG_TABLEUPDATEFAILED, 64, _SCREEN.CAPTION)
ENDIF
THISFORM.cboreporttype.INTERACTIVECHANGE(vfxrep.reportid)
THISFORM.lstdescr.SETFOCUS()
ENDIF
| Name | Initial value |
|---|---|
| Caption | "Copy to other Users ..." |
| TabIndex | 17 |
| WordWrap | .T. |
| ZOrderSet | 8 |
DODEFAULT()
THIS.ENABLED = !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
THISFORM.lstreports.LIST[thisform.lstreports.listindex,6]<>".t."
IF THISFORM.lstreports.LIST[thisform.lstreports.listindex,6] = ".t."
MESSAGEBOX(MSG_TEMPLATESALLUSERS, 64, THISFORM.CAPTION)
ELSE
LOCAL lcoldfile
lcoldfile = TRIM(THISFORM.lstreports.LIST[thisform.lstreports.listIndex,2])
IF !(FILE(goprogram.creportdir + lcoldfile + ".frx") AND ;
FILE(goprogram.creportdir + lcoldfile + ".frt"))
WAIT WINDOW MSG_CANNOTFINDREPORT+" " + lcoldfile + "!"
ELSE
LOCAL lasource, laselected, lnmode
DIMENSION lasource[1,1]
DIMENSION laselected[1,1]
SELECT vfxusr.user_name, vfxusr.USER FROM vfxusr ;
INTO ARRAY lasource
IF _TALLY > 0
lomover = CREATEOBJECT("CMoverDialog")
lomover.CAPTION = MSG_SELECTUSERS
lomover.cntmover.ncoltoview = 1
lomover.cntmover.lstsource.MULTISELECT = .T.
IF !EMPTY(laselected)
lomover.cntmover.SETDATA(@lasource, @laselected)
ELSE
lomover.cntmover.SETDATA(@lasource)
ENDIF
lomover.SHOW()
IF !(TYPE(_gamoverlist)="C" AND _gamoverlist == "[CANCEL]")
IF !EMPTY(_gamoverlist)
LOCAL lnreporttype, lcnewfile, lcoldreport, lcnewreport
FOR i = 1 TO ALEN(_gamoverlist,1)
IF !EMPTY(_gamoverlist[i,1])
LOCAL lnreporttype, lcfilename, lcnewfile, lcoldreport, lcnewreport, lnrecno
lnreporttype = VAL(THISFORM.cboreporttype.LIST[thisform.cboreporttype.listindex,3])
lcfilename = TRIM(THISFORM.lstreports.LIST[thisform.lstreports.listindex,2])
lcnewfile = THISFORM.getnewfilename()
lcoldreport = goprogram.creportdir + lcoldfile + ".frx"
lcnewreport = goprogram.creportdir + lcnewfile + ".frx"
COPY FILE (lcoldreport) TO (lcnewreport)
lcoldreport = goprogram.creportdir + lcoldfile + ".frt"
lcnewreport = goprogram.creportdir + lcnewfile + ".frt"
COPY FILE (lcoldreport) TO (lcnewreport)
INSERT INTO vfxrep (rtypeid, reportid, filename, DESCR, USER) ;
VALUES (lnreporttype, VAL(getnewid("vfxrep", 10)), lcnewfile, ;
vfxrep.DESCR, _gamoverlist[i,2])
BEGIN TRANSACTION
IF TABLEUPDATE(1,.T.,"vfxrep")
END TRANSACTION
ELSE
ROLLBACK
TABLEREVERT(.T.,"vfxrep")
ENDIF
ENDIF
NEXT
ENDIF
ENDIF
ELSE
=MESSAGEBOX(MSG_NOUSERAVAILABLE , 64, THISFORM.CAPTION)
ENDIF
RELEASE _gamoverlist, lasource, laselected
ENDIF
ENDIF
| Name | Initial value |
|---|---|
| Caption | "Delete" |
| TabIndex | 15 |
| ZOrderSet | 8 |
THIS.ENABLED = !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
THISFORM.lstreports.LISTINDEX > 2 AND ;
(THISFORM.lstreports.LIST[thisform.lstreports.listindex,5]=gu_user OR gu_userlevel=1)
IF MESSAGEBOX(MSG_DELETEREPORT, 36, THISFORM.CAPTION) = 6
LOCAL lnselect, lnindemid, lnlistindex, lcfilename, lnreportid
lnselect = SELECT(0)
lnlistindex = THISFORM.lstreports.LISTINDEX
lnitemid = THISFORM.lstreports.INDEXTOITEMID(lnlistindex)
lcfilename = TRIM(THISFORM.lstreports.LIST[lnlistindex,2])
lnreportid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
IF THISFORM.lstreports.LIST[thisform.lstreports.listindex,6]=".t."
SELECT vfxrtemp
LOCATE FOR rtemplid = lnreportid
IF FOUND()
DELETE
ENDIF
ELSE
SELECT vfxrep
LOCATE FOR reportid = lnreportid
IF FOUND()
DELETE
ENDIF
ENDIF
BEGIN TRANSACTION
IF TABLEUPDATE(1,.T.,"vfxrtemp") AND ;
TABLEUPDATE(1,.T.,"vfxrep")
END TRANSACTION
DELETE FILE (goprogram.creportdir+lcfilename+".*")
THISFORM.lstreports.REMOVELISTITEM(lnitemid)
THISFORM.lstreports.LISTINDEX = MIN(lnlistindex, THISFORM.lstreports.LISTCOUNT)
THISFORM.lstreports.INTERACTIVECHANGE()
ELSE
ROLLBACK
TABLEREVERT(.T.,"vfxrtemp")
TABLEREVERT(.T.,"vfxrep")
ENDIF
THISFORM.lstreports.SETFOCUS()
SELECT (lnselect)
ENDIF
| Name | Initial value |
|---|---|
| Caption | "Export" |
| TabIndex | 23 |
| ZOrderSet | 6 |
LOCAL lcoldfile
lcoldfile = TRIM(THISFORM.lstreports.LIST[thisform.lstreports.listIndex,2])
IF !(FILE(goprogram.creportdir + lcoldfile + ".frx") AND ;
FILE(goprogram.creportdir + lcoldfile + ".frt"))
WAIT WINDOW MSG_CANNOTFINDREPORT +" "+ lcoldfile + "!"
ELSE
LOCAL lcdir, latemp, lcnewtable, lcreportname, lnreportid, lnselect, lcalias, ;
lcoldreport, lcnewreport, lnrecno
DIMENSION latemp[1]
lnselect = SELECT(0)
lcdir = GETDIR(SET("DEFAULT"), MSG_SELECTEXPORTDIRECTORY)
IF !EMPTY(lcdir)
WAIT WINDOW MSG_EXPORTISRUNNING NOWAIT
lcnewtable = lcdir + "_report.dbf"
lcalias = "_report"
IF !FILE(lcnewtable)
AFIELDS(latemp, "vfxrep")
CREATE TABLE (lcnewtable) FREE FROM ARRAY latemp
ELSE
USE (lcnewtable) IN 0 ALIAS (lcalias) SHARED AGAIN
ENDIF
IF THISFORM.lstreports.LIST[thisform.lstreports.listindex,6]=".t."
SELECT vfxrtemp
LOCATE FOR rtemplid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
IF FOUND()
lnreportid = vfxrtemp.rtemplid
ENDIF
INSERT INTO (lcalias) (reportid, rtypeid, filename, DESCR, USER) ;
VALUES (vfxrtemp.rtemplid, vfxrtemp.rtypeid, vfxrtemp.filename, ;
vfxrtemp.DESCR, gu_user)
ELSE
SELECT vfxrep
LOCATE FOR reportid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
IF FOUND()
lnreportid = vfxrep.reportid
ENDIF
INSERT INTO (lcalias) (reportid, rtypeid, filename, DESCR, USER) ;
VALUES (vfxrep.reportid, vfxrep.rtypeid, vfxrep.filename, ;
vfxrep.DESCR, gu_user)
ENDIF
USE IN (lcalias)
lcreportname = THISFORM.lstreports.LIST[thisform.lstreports.listIndex,2]
lcoldreport = goprogram.creportdir + TRIM(lcreportname) + ".frx"
lcnewreport = lcdir + TRIM(lcreportname) + ".frx"
COPY FILE (lcoldreport) TO (lcnewreport)
lcoldreport = goprogram.creportdir + TRIM(lcreportname) + ".frt"
lcnewreport = lcdir + TRIM(lcreportname) + ".frt"
COPY FILE (lcoldreport) TO (lcnewreport)
SELECT (lnselect)
WAIT CLEAR
MESSAGEBOX(MSG_EXPORTCOMPLETED, 64, THISFORM.CAPTION)
ENDIF
ENDIF
DODEFAULT()
THIS.VISIBLE = gu_userlevel=1
THIS.ENABLED = THISFORM.lstreports.LISTINDEX > 2 AND ;
!EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2))
| Name | Initial value |
|---|---|
| Caption | "Import" |
| TabIndex | 24 |
| ZOrderSet | 7 |
LOCAL lnselect, lcdir, llok
llok = .T.
lnselect = SELECT(0)
lcdir = GETDIR(SET("DEFAULT"), MSG_SELECTIMPORTDIRECTORY)
IF EMPTY(lcdir)
RETURN .F.
ELSE
WAIT WINDOW MSG_IMPORTISRUNNING NOWAIT
LOCAL lcaliasreport, lcaliasexport, lcaliasexfield, lnnewreportid, ;
lcnewfilename, lcoldreport, lcnewreport, lnrecno
lcaliasreport = SYS(2015)
lcaliasexport = SYS(2015)
lcaliasexfield = SYS(2015)
IF !FILE(lcdir+"_report.dbf")
MESSAGEBOX(MSG_CANNOTFINDTABLE+" " + lcdir + "_report.dbf!", 16, THISFORM.CAPTION)
RETURN
ENDIF
USE lcdir+"_report" IN 0 ALIAS (lcaliasreport) SHARED AGAIN
SELECT (lcaliasreport)
SCAN
IF !(FILE(lcdir+TRIM(filename)+".frx") AND FILE(lcdir+TRIM(filename)+".frt"))
IF MESSAGEBOX(MSG_CANNOTFINDREPORT+" " + lcdir + TRIM(filename)+"!", 21, THISFORM.CAPTION) = 2
llok = .F.
EXIT
ELSE
LOOP
ENDIF
ENDIF
lcnewfilename = THISFORM.getnewfilename(&lcaliasreport..rtypeid)
lnnewreportid = VAL(getnewid("vfxrep"))
INSERT INTO vfxrep (reportid, rtypeid, filename, DESCR, USER) ;
VALUES (lnnewreportid, &lcaliasreport..rtypeid, lcnewfilename, ;
&lcaliasreport..DESCR, gu_user)
lcoldreport = lcdir + TRIM(filename) + ".frx"
lcnewreport = goprogram.creportdir + TRIM(lcnewfilename) + ".frx"
COPY FILE (lcoldreport) TO (lcnewreport)
lcoldreport = lcdir + TRIM(filename) + ".frt"
lcnewreport = goprogram.creportdir + TRIM(lcnewfilename) + ".frt"
COPY FILE (lcoldreport) TO (lcnewreport)
ENDSCAN
IF USED(lcaliasreport)
USE IN (lcaliasreport)
ENDIF
IF USED(lcaliasexport)
USE IN (lcaliasexport)
ENDIF
IF USED(lcaliasexfield)
USE IN (lcaliasexfield)
ENDIF
ENDIF
IF llok
BEGIN TRANSACTION
IF TABLEUPDATE(1, .T., "vfxrep")
END TRANSACTION
DO CASE
CASE vfxrep.rtypeid = 1 OR vfxrep.rtypeid = 2
THISFORM.cboreporttype.LISTINDEX = vfxrep.rtypeid
CASE vfxrep.rtypeid = 3
THISFORM.cboreporttype.LISTINDEX = vfxrep.rtypeid +1
CASE vfxrep.rtypeid = 4 OR vfxrep.rtypeid = 5
THISFORM.cboreporttype.LISTINDEX = vfxrep.rtypeid +2
CASE vfxrep.rtypeid = 6
THISFORM.cboreporttype.LISTINDEX = 5
CASE vfxrep.rtypeid = 8
THISFORM.cboreporttype.LISTINDEX = 3
OTHERWISE
THISFORM.cboreporttype.LISTINDEX = vfxrep.rtypeid
ENDCASE
THISFORM.cboreporttype.INTERACTIVECHANGE(vfxrep.reportid)
WAIT CLEAR
MESSAGEBOX(MSG_IMPORTCOMPLETED, 64, THISFORM.CAPTION)
ELSE
llok = .F.
ROLLBACK
MESSAGEBOX(MSG_IMPORTNOTCOMPLETED, 16, THISFORM.CAPTION)
ENDIF
ENDIF
IF !llok
TABLEREVERT(.T., "vfxrep")
ENDIF
SELECT (lnselect)
DODEFAULT()
THIS.VISIBLE = gu_userlevel=1
| Name | Initial value |
|---|---|
| Caption | "Modify" |
| TabIndex | 13 |
| ZOrderSet | 6 |
DODEFAULT()
THIS.ENABLED = !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
(THISFORM.lstreports.LIST[thisform.lstreports.listindex,5]=gu_user OR gu_userlevel=1)
PUSH MENU _MSYSMENU
SET SYSMENU TO DEFAULT
WITH THISFORM
.ocalledfrom.onpreprintreport(.cboreporttype.VALUE)
MODIFY REPORT (goprogram.creportdir + TRIM(.lstreports.LIST(.lstreports.LISTINDEX,2)))
.ocalledfrom.onpostprintreport(.cboreporttype.VALUE)
THISFORM.cmdprint.REFRESH()
THISFORM.cmdpreview.REFRESH()
THISFORM.cmdcopy.REFRESH()
ENDWITH
POP MENU _MSYSMENU
| Name | Initial value |
|---|---|
| Caption | "Pre\<view" |
| TabIndex | 11 |
| ZOrderSet | 4 |
WITH THISFORM
LOCAL lnselect
lnselect = SELECT(0)
.HIDE()
IF .ocalledfrom.onpreprintreport(.cboreporttype.VALUE)
.ocalledfrom.onprintreport(IIF(THISFORM.chktoascii.VALUE=1,0,2), .lstreports.LIST[thisform.lstreports.listindex,2])
ENDIF
.ocalledfrom.onpostprintreport(.cboreporttype.VALUE)
.SHOW()
ENDWITH
DODEFAULT()
IF !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
FILE(goprogram.creportdir + TRIM(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) + ".frx")
THIS.ENABLED = .T.
ELSE
THIS.ENABLED = .F.
ENDIF
| Name | Initial value |
|---|---|
| Caption | "\<Print" |
| TabIndex | 11 |
| ZOrderSet | 4 |
DODEFAULT()
IF !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
FILE(goprogram.creportdir + TRIM(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) + ".frx")
THIS.ENABLED = .T.
ELSE
THIS.ENABLED = .F.
ENDIF
WITH THISFORM
LOCAL lnselect
lnselect = SELECT(0)
.HIDE()
IF .ocalledfrom.onpreprintreport(.cboreporttype.VALUE)
.ocalledfrom.onprintreport(IIF(THISFORM.chktoascii.VALUE=1,0,1), .lstreports.LIST[thisform.lstreports.listindex,2])
ENDIF
.ocalledfrom.onpostprintreport(.cboreporttype.VALUE)
.SHOW()
ENDWITH
| Name | Initial value |
|---|---|
| ControlSource | "thisform.lstreports.list[thisform.lstreports.listindex,4]" |
| DisabledForeColor | 0,0,0 |
| SelectOnEntry | .T. |
| TabIndex | 6 |
| ZOrderSet | 11 |
| lautosetup | .F. |
DODEFAULT()
THIS.ENABLED = !EMPTY(THISFORM.lstreports.LIST(THISFORM.lstreports.LISTINDEX,2)) AND ;
THISFORM.lstreports.LISTINDEX > 2 AND ;
(THISFORM.lstreports.LIST[thisform.lstreports.listindex,5]=gu_user OR gu_userlevel=1)
LOCAL lnselect
lnselect = SELECT(0)
IF THISFORM.lstreports.LIST[thisform.lstreports.listindex,6]=".t."
SELECT vfxrtemp
LOCATE FOR rtemplid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
ELSE
SELECT vfxrep
LOCATE FOR reportid = VAL(THISFORM.lstreports.LIST[thisform.lstreports.listindex,7])
ENDIF
IF FOUND()
IF CHR(13)$THIS.VALUE
THISFORM.lstreports.LIST[thisform.lstreports.listindex,1] = ;
LEFT(SUBSTR(THIS.VALUE,1,AT(CHR(13),THIS.VALUE)-1),50)
ELSE
THISFORM.lstreports.LIST[thisform.lstreports.listindex,1] = ;
LEFT(THIS.VALUE,50)
ENDIF
THISFORM.lstreports.LIST[thisform.lstreports.listindex,4] = THIS.VALUE
IF THISFORM.lstreports.LIST[thisform.lstreports.listindex,6]=".t."
REPLACE vfxrtemp.DESCR WITH THIS.VALUE
TABLEUPDATE(1,.T.,"vfxrtemp")
ELSE
REPLACE vfxrep.DESCR WITH THIS.VALUE
TABLEUPDATE(1,.T.,"vfxrep")
ENDIF
THISFORM.lstreports.REFRESH()
ENDIF
SELECT (lnselect)
| Name | Initial value |
|---|---|
| Caption | "Select the Report Type" |
| TabIndex | 2 |
| ZOrderSet | 9 |
| Name | Initial value |
|---|---|
| Caption | "Available Reports for selected Report Type" |
| TabIndex | 4 |
| ZOrderSet | 10 |
| Name | Initial value |
|---|---|
| BackStyle | 1 |
| Caption | "Report Selection" |
| TabIndex | 1 |
| ZOrderSet | 16 |
| Name | Initial value |
|---|---|
| TabIndex | 5 |
| ZOrderSet | 3 |
| lautosetup | .F. |
DODEFAULT()
THISFORM.cmdprint.REFRESH()
THISFORM.cmdpreview.REFRESH()
THISFORM.cmdmodify.REFRESH()
THISFORM.cmdcopy.REFRESH()
THISFORM.cmddelete.REFRESH()
THISFORM.cmdcopytousers.REFRESH()
THISFORM.chktemplate.REFRESH()
THISFORM.cmdexport.REFRESH()
THISFORM.lstdescr.REFRESH()
| Name | Initial value |
|---|---|
| ZOrderSet | 1 |