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!

Removing tool bar 'Window Preview'

Status
Not open for further replies.

COBART

MIS
Sep 7, 2000
33
0
0
ID
I have a form for print a report.
When i want preview the report the Tool Bar 'Window Preview'
automatic show.
How to hide the 'Window Preview' from the command :
Report Form lcname.Frx Preview.

Because, I want user only can preview the report Not Printing the report.

Please Help Me !

Thank's

Rudi


 
Rudi

Go to the command window

Click on toolbars on the view option of the menu

Select Print Preview

Click OK

Click on toolbars on the view option of the menu

Click on the customize button

Drag the print icon off the toolbar

Close the dialog

Close the toolbar

Chris :)
 
PMFJI, but Chris, dont forget he'll have to distribute that copy of foxuser.dbf as well. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Rudi

Just to endorse what Jon said, and I omitted, the changes made to the toolbar are specific to only that version of Foxuser.dbf and you will need to ensure it's distributed.

Chris :)
 
Heloo Chriss,

Your Idea not succes
On the my report preview, Toolbar 'Window Preview' still show.

How to hide Toolbar 'Window Preview' programaticaly from
print procedure ?

Can you help me !

Thank's

Rudi
 
Rudi

Make sure that you are using a resource file. The default filename is Foxuser.dbf.

SET RESOURCE TO n:\path\Foxuser.dbf

Next check, through Windows Explorer, that Foxuser.dbf is not read only.

Run the original routine again and drag the Print Preview toolbar onto the screen, and then close it.

Your changes should have been saved in Foxuser.dbf

Chris :)
 
Chris

This is my question !
When I isue the command "REPORT FORM XXXX.FRX PREVIEW"
The report is display on the screen. On the top,there is a Tollbar "Print Preview". In this Toolbar there many icon. Next Page,Last Page,Print,Close and other.

How to hide automatically from program or procedure print these toolbar hiden ?
I am not need the "Print Preview" Tollbar is show.

Because i want a manage where user can print a report and can't print the report

Thank's

Rudi
 
Rudi

I misunderstood your original question.

That toolbar will come up by default if "PREVIEW" is in the command line, and I doubt if you will be able to remove it programatically.

If you remove it by stripping out all the icons, your user will not be able to zoom or go through the pages in the report.

You could try positioning it to the far right of the screen with only a tiny stub available.

I personally use a form for previewing single page reports - you can scale the report objects, rather than zooming which, if you use graphics, will not necessarily show the images correctly

Another option might be to open up Foxuser.dbf, locate the reference to the Preview toolbar, and within the relevant memo field, change the coordinates to position it off the screen.

Chris :)
 
Rudi

Another option might be to open up Foxuser.dbf, locate the reference to the Preview toolbar, and within the relevant memo field, change the coordinates to position it off the screen.

Sorry - the coordinates are not visible in the memo field

Chris :-(

 
Hi Rudi,

I'd suggest you read the following FAQ:
How to prevent printing from the Print Preview window

AFA suppressing the preview toolbar entirely, I'd highly recommend you reconsider. What if the report consists of multiple pages? Will you force the user to <Page Down> until he reaches the end of the report(All the while, he/she could have selected the movelast or goto page button from the toolbar). If the toolbar is unappealing to the user, he/she can simply close it.

Limit the available options the user can select from the toolbar. Omitting it completely, IMO, opens the door to future complaints/criticisms from your end-users. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
You may use this:

DEACTIVATE WINDOW &quot;Print Preview&quot;

 
Hello Chris, Jon Hawkin !

Thank's for your tips ...

Rudi

 
To be more specific to this....

1. Make a routine in your main.prg at the end.

PROCEDURE PreViewClose
DEACTIVATE WINDOW &quot;Print Preview&quot;
RETURN &quot;&quot;
ENDPROC

2. In the reports, create a expression (as you do for fields) and build for display
PreViewClose()

This shall be the first reporting expression.. so that the deactivation takes place immediately.

Since the return value of the function is nothing, nothing will be output. But the routine will close the preview window.

ramani
 
Ramani

I misunderstood what Rudi was trying to acheive the first time and I suspect you also have misunderstood.

What he wants is to show the print preview screen WITHOUT the toolbar.

The subsequent problems that acheiving this might bring have been pointed out - but reading your post, and without trying it out, you are removing the print preview window and not simply the print preview toolbar?

Chris :)
 
Chris

My routine was tested by me and then posted here.

What I achieved by this routine is
1. Get the screen report (report cast into the preview window)
2. The print preview tool bar is removed from the report output.

Only problem is to scroll to end of page etc which are provided in the tool bar. But what I understand is that COBART wants to achieve only this.

ramani
 
Ramani

Rudi owes you thanks for solving his problem, I owe you apologies for doubting your understanding of the same.

Chris :)

 
hey chris,

No apologies.... Sorry if I sounded that way in my post. Most of the time, in software, I do reply very curt.. yes/no typical of programming. Thanks for being a sport anyway !

ramani
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top