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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change report title/header - is it possible?

Status
Not open for further replies.

SitesMasstec

Technical User
Sep 26, 2010
470
1
18
BR
Hello colleagues!

When I run a REPORT FORM... I got the preview in the screen:

RelPortos2_fvrtag.jpg


Is it possible to change the text 'Report Preview - relportos.frx' for other text, in other language?
Also there is no need for the user to see the 'relportos.frx' text in the header.


Thank you,
SitesMasstec
 
I am sure there are few ways to do this, but a quick look at the Help might offer this for a predefined window...

Code:
REPORT FORM myReport1.frx PREVIEW WINDOW MyWindow

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
To follow up Griff's advice, take a look at my article: Taming the Visual FoxPro report preview window, especially the section headed "The IN WINDOW option".

Or, you might like to consider using FoxyPreviewer for your previews. That would solve this particular problem, and also give you a lot more options - but at the expense of fairly substantial changes to the appearance of your reports.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Regarding the title of the print preview toolbar, I think when you compile to EXE and use the language resource DLL for portuguese or spanish that would also get the spanish toolbar title.

Besides that, the buttons of the preview toolbar are copnfigurable within the VFP IDE. Jut go into View-Toolbars, then click "customize" and in the customize dialog you can pick the print preview and remove or add buttons.

This custom configuration is stored in a record of foxuser.dbf and you can provide that modified foxuser.dbf to change the buttons also for an EXE

Just do
Code:
USE SYS(2005) again alias myfoxuser
BROWSE FOR UPPER(Name) == 'PRINT PREVIEW'

That shows that record, the buttons of the toolbar are encode in binary within the Data memo, you know how to change that, not there but with the customize dialog. But that one record within the foxuser.dbf the EXE finally uses will make the preview the same as you customize it.

Mike is right that this and more is easier using FoxyPreviewer. It's not the look of the report themselves that will change, FoxyPreviewer prints the same FRXes with the same output, but the preview toolbar has quite a different look.

Chriss
 
Griff, Mike: I tried your solutions, but the report did not display as I expected (maximized):

Code:
THISFORM.LostFocus
SET ORDER TO NOMEPOR

LOCAL loPreview
loPreview = CREATEOBJECT("Form")

* At this point, you can customise the form in
* certain ways, for example by changing its
* size, position, caption or icon.

loPreview.Caption = "Relatório"
loPreview.Name = "MyPreview"
loPreview.Visible = .T.
loPreview.Width = 1000
loPreview.Height = 1600
loPreview.ScrollBars = 3
loPreview.TitleBar = 0

REPORT FORM RELPORTOS TO PRINTER PROMPT PREVIEW IN WINDOW MyPreview

RelPortos3_p0evej.jpg



Thank you,
SitesMasstec
 
Well,

your code sets a lot of properties of the preview window, but you don't maximize it. So why do you expect it to become maximized? Just because you set height and width? And what display would have a resolution of 1000x1600? Even if you use a display in portrait orientation.

Well, there's a better method to maximize a form, that's independent of the display resolution:

Code:
loPreview.WindowState=2 && 2= maximized, 1=normal, 0=minimized

Chriss
 
Chriss said:
And what display would have a resolution of 1000x1600?
Touché!

Criss: the result displayed exactly the same (not maximized).

Here is the code:
Code:
THISFORM.LostFocus
SET ORDER TO NOMEPOR

LOCAL loPreview
loPreview = CREATEOBJECT("Form")

* At this point, you can customise the form in
* certain ways, for example by changing its
* size, position, caption or icon.

loPreview.Caption = "Relatório"
loPreview.Name = "MyPreview"
loPreview.Visible = .T.
loPreview.ScrollBars = 3
loPreview.TitleBar = 0
loPreview.WindowState = 2    && 2= maximized, 1=normal, 0=minimized 

REPORT FORM RELPORTOS TO PRINTER PROMPT PREVIEW IN WINDOW MyPreview

Thank you,
SitesMasstec
 
It shouldn't make a difference by documentation, but for me dropping the IN works:

Code:
REPORT FORM RELPORTOS TO PRINTER PROMPT PREVIEW WINDOW MyPreview

Chriss
 
Also, all the buttons in the Print Preview became disabled.

So, I copied a previous backup FOXUSER.DBF/FPT back to the folder of the application.

I compiled the application and ran it. With the report preview opened I maximized manually the preview window. Now every time I click to see that report, the preview window is already maximized. So I will distribute my application with the FOXUSER.DBF/FPT generated in my computer. It seems to work.


Thank you,
SitesMasstec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top