Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports - Legacy - Preview and Header Font

Status
Not open for further replies.

TinLegs

Programmer
Jan 14, 2003
100
NZ
I would like to be able to set the Report Preview zoom setting to default to Full Page or 100% when the report preview first opens (as you can in ABC).

Also, I can change a reports font at run time using Fontdialog but would like this change to apply to the 'Header' section of a report only.

Are either of these possible in a Legacy app (C6.1)
Thanks in advance
 
Hi TinLegs,

The Report Preview procedure in Legacy is in the STANDARD FUNCTIONS generated source file (the one with <AbbreviatedAppName>_SF.CLW). Since this file is generated always, you need to edit the STDFUNC.TPW in the Template folder.

Change the line below from :

ZoomNoZoom = True
DO ChangeDisplay

to :

Zoom100 = True
DO ChangeDisplay

Note that this change will APPLY TO ALL YOUR LEGACY APPLICATIONS.

To change the font of a Report Band, you need to change the individual font of all the Controls in the Band. Try this :

SETTARGET(Report, ?PageHeader) !where ?PageHeader is the USE variable of the Page Header Band

LOOP F# = FIRSTFIELD() TO LASTFIELD()
F#{PROP:FontName} = 'Arial'
F#{PROP:FontSize} = 10
F#{PROP:FontColor} = COLOR:Red
F#{PROP:FontStyle} = FONT:Bold
END

SETTARGET()

Regards



Regards
 
Hi Shankar,

What is the advantage to using the 2nd argument in SETTARGET in this case? SETTARGET(report, band)

Do FIRSTFIELD() / LASTFIELD() restrict their FEQs to just the current band?

For that matter, when looping over FEQs it is now recommended to use PROP:NextField. As you probably know, there is NO Guarranty that the FEQs simply increment, and have no gaps.

That said, I would do something like this:

FEQ EQUATE(SIGNED)
TargetFEQ FEQ
CurrFEQ FEQ
ParentFEQ FEQ
CODE
TargetFEQ = ?PageHeader

CLEAR(CurrFEQ,-1)
LOOP
CurrFEQ = Report{prop:NextField, CurrFEQ}
IF CurrFEQ = 0 THEN BREAK END

ParentFEQ = CurrFEQ
LOOP
ParentFEQ = ParentFEQ{prop:parent}

IF ParentFEQ = 0
BREAK

ELSIF ParentFEQ = TargetFEQ
Report$CurrFEQ{prop:FontName} = 'Arial'
Report$CurrFEQ{prop:FontSize} = 10
Report$CurrFEQ{prop:FontColor}= COLOR:Red
Report$CurrFEQ{prop:FontStyle}= FONT:Bold
BREAK
END

END !LOOP Parent
END !LOOP CurrFEQ


!-- note the above code is Untested...


- Mark Goldberg
 
Hi Mark,

From the Help on FIRSTFIELD or LASTFIELD:

The FIRSTFIELD procedure returns the lowest field number in the currently active window (or REPORT) as specified by SETTARGET. This does not include any controls in a TOOLBAR or MENUBAR.

The LASTFIELD procedure returns the highest field number in the currently active window (or REPORT) as specified by SETTARGET. This does not include any controls in a TOOLBAR or MENUBAR.

---------

I have not tried the code suggested by me but based it on the help. I am aware that there have been reports in the NGs about inconsistencies of FIRSTFIELD() and LASTFIELD() but have not experienced them myself. Your approach is possibly a safer one to use.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top