Michael,
What you have to do is modify the resource file:
Set up a table MyTable with a couple of fields in it and create a simple
report MyReport with these fields in.

Run the following program with table Mytable and report MyReport names
appropriately set.

***********
* Start of Program
*
Clear
Close Tables all

* Put the location of a dummy report here
MyReport="reports\MyReport"
Use MyTable again In 0

cResource_Old=addbs(justpath(sys(2005)))+Juststem(sys(2005))
? "Old: "+cResource_old

cResource_New="foxuser_temp"
set resource off

copy file(cResource_Old +".dbf") to (cResource_New+".dbf")
copy file(cResource_Old +".fpt") to (cResource_New+".fpt")

Select 0
use (cResource_New) exclu
zap
use in (cResource_New)

set resource to (cResource_New)

? "New Resource: "+addbs(justpath(sys(2005)))+Juststem(sys(2005))

Select customer
report Form (Myreport) Preview nowait

set resource to (cResource_Old)
Set Resource on
*
* End of Program
*****************

Note you must have the "nowait" report parameter.

When you preview the report, right click on the print preview toolbar and
select cur "customize" option. Now, simply drag the print preview icon off
the "Print Preview" toolbar in your report - don't do anything with the
customize menu. 

Now, close down your report. You will now have a resource file
"Foxuser_temp" resource file on your drive.

Do the following at the command line:

set resource to Foxuser_new
report form <<any report>> preview

...and the print button will not be there. Don't forget to reset the
resource file back to the default immediately afterwards though. This new
resource file you can now embed into your project/Exe and point to whenever
required.

Hope this helps
Dave


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of MB Software Solutions General Account
Sent: 29 May 2008 05:50
To: ProFox Email List
Subject: Suppressing the printing option in VFP9 for reports

This is the code snippet I was expecting to work:

IF oUtils.lTrial THEN
        REPORT FORM (tcRpt) NOCONSOLE PREVIEW WINDOW (.Name)
ELSE
        REPORT FORM (tcRpt) TO PRINTER PROMPT NOCONSOLE PREVIEW WINDOW
(.Name)
ENDIF



...but even though it falls into the first part of the IF because 
oUtils.lTrial = .T., it still shows the Printer button enabled on the 
Report toolbar.  How can I disable this?

tia,
--Michael


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to