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

REPORT PREVIEW

Status
Not open for further replies.

Mistral2

Technical User
Nov 12, 2002
21
TN
I want to restrict some users to have only to preview a report without printing

I used this command :

REPORT FORM MyReport PREV IN SCREEN TO FILE REPORT.tmp
DELETE FILE REPORT.tmp

I'm using VFP6.0

Thank you in advance
Mistral
 
Mistral2

Was there a question in there?
You may also consider removing the printer icon from the print preview toolbar. See faq184-1933. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
The problem is that using this command the report appear for short time (very short) after nothing is shown in the screen.
 
Mistral2

If you use:
REPORT FORM MyReport.FRX PREVIEW

Does it stay up? If not you may have a data problem. You have to make sure that the last thing you do before you send to printer is select the data related to the report.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Mistral,

Are you saying that you are happy for the user to preview the report on screen, but you don't want them to be able to print it to paper?

If so, you need to disable the Print button in the Report Preview toolbar. To do that, open the toolbar in the development environment, hold down the Alt key, and drag the Print button off the toolbar. This setting is saved in the resource files (FOXUSER.DBF and FOXUSER.FPT), so you would have to copy these files to the user's system.

I don't understand why you are printing to temp file and then deleting it. That seems unnecessary. Just do REPORT FROM MyReport PREVIEW.

If I have misunderstood the question, please clarify and I will try again.
Mike Lewis
Edinburgh, Scotland
 
Hi Mike,

When i use:
REPORT FORM MyReport.FRX PREVIEW

it stay up without any problems

Mistral
 
Mistral2

Then if you want to prevent the user to print the report, the recommend method is as I and Mike Lewis suggested, remove the printer icon from the preview toolbar. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
HI
I have a similar problem.
I would like to give rights to print to one group of users,
and other only to preview.
One methods is FAQ184-1933 to programic change the righs (appear and disappear the printer icon), but on this line:
Use foxuser.dbf Exclusive
I still see a announcement: File is in use.
I can't find what I do wrong.
Could You help me.

Sorry for my English
 
ketiv

Use foxuser.dbf Exclusive
I still see a announcement: File is in use.


Make sure you are using the right foxuser file. Check what path your VFP is using. Tools->options->File locations->Resource File.
For example mine is located here:
"c:\documents and settings\administrator\application data\microsoft\visual foxpro\foxuser.dbf" and in order to make changes you have to use SET RESOURCE OFF
Code:
SET RESOURCE off
USE foxuser.dbf EXCLUSIVE && Should not generate an error



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
OK It's working.
But I have other problem now.
My application starting from project is working good, when I want the printer button is visible, in other times is not. - OK
But when I'm starting this from *.exe, I never see this button. Why??
 
ketiv

My application starting from project is working good, when I want the printer button is visible, in other times is not. - OK

You should be using two "foxuser.dbf" resource fiels. One with the print button vaiable, and one with no print button. And depending on your considtion "switch" between resource files using:
SET RESOURCE TO "c:\noPrint.dbf:
or
SET REOURCE TO "C:\withPrint.dbf"

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top