A number of questions...
How do I select a specific printer for a report? i.e. Let's say I want to
print badges, on a printer that is designed for badges. However default
reports to not print there.
I know about set printer to name... but is there a better way as users may
not name the same printer on the network with the same name.
How do I select a special paper size i.e. 5 1/2" by 11" wide?
How do I select a specific tray on a printer.. i.e. one tray may have legal
in it the other normal... I need to select based on the report.
I assume some sort of table holding the type of report, and the related
printer would work to store the info... is this the best way to go?
Does the improved report writer in VFP9 help in any of the above issues?
TIA,
Mike
>
> How do I select a specific tray on a printer.. i.e. one tray may have legal
> in it the other normal... I need to select based on the report.
>
It's been a while, but I used to use the SET PRINTER TO NAME server\printer
I think you can also use the IP address of the printer if it has one -
anyone else tried that?
Using a table will make your application more configurable. I use
config tables like there going out of style for these type of things.
>...users may not name the same printer on the network with the same name.
so if users know which printers/forms are where, but you don't, just use
... to printer prompt
(if you do specify paper sizes that aren't on the default printer/tray
things will just hang with a 'load paper...' message on the printer
console).
Andrew Davies MBCS CITP
- AndyD 8-)#
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
Please contact internet.administrators@notes.manchester.gov.uk with any queries
**********************************************************************
Michael Savage wrote:
>A number of questions...
>
>How do I select a specific printer for a report? i.e. Let's say I want to
>print badges, on a printer that is designed for badges. However default
>reports to not print there.
>I know about set printer to name... but is there a better way as users may
>not name the same printer on the network with the same name.
>
>How do I select a special paper size i.e. 5 1/2" by 11" wide?
>
>How do I select a specific tray on a printer.. i.e. one tray may have legal
>in it the other normal... I need to select based on the report.
>
>I assume some sort of table holding the type of report, and the related
>printer would work to store the info... is this the best way to go?
>
>Does the improved report writer in VFP9 help in any of the above issues?
>
>
If you want a report to always print to a particular printer, that is
easy. You just save the information in page setup/print setup when
designing the report layout and the report will alway print to this
printer. If you want it to print to several printers, you will have to
clear out the printer information stored in the TAG TAG2 and EXPR fields
of your report. E.G mylayout.frx Open this like any table and first
record should be objtype=1 AND objcode=53, clear out these three fields
then use SET PRINTER TO NAME ... and the report will go to that name.
My code is:
SELECT 0
USE (x_home+cReportname) EXCLUSIVE
LOCATE FOR objtype=1 AND objcode=53
IF FOUND()
replace tag WITH ''
replace tag2 WITH ''
replace expr WITH 'DRIVER=Winspool' + ps_crlf + ;
'DEVICE=' + ALLTRIM(cPrinter) + ps_crlf + ;
'OUTPUT=' + ALLTRIM(prnlist.port) + ps_crlf + ;
'ORIENTATION=' + cOrientation + ps_crlf + ;
'PAPERSIZE=' + ALLTRIM(prnlist.papersize) + ps_crlf + ;
'DEFAULTSOURCE=' + ALLTRIM(prnlist.defsource) +
ps_crlf
use
ELSE
MESSAGEBOX('Could not find/update report record')
ENDIF
To get round users having different printer names on their machines, you
can set up a table of printers in your app and only allow the user to
pick printers from this table. In the above code my table is PRNLIST,
which has some defaults for each printer. These are written back to the
EXPR field.
A special papersize would go in the EXPR field above in PAPERSIZE=
To get the right setting you would set the printer up with this
papersize, then design your layout and pick this printer and save it.
Then look in the expr field to get the setting.
I assume if you pick a different tray, DEFAULTSOURCE will change, but
not tested that.
Hope that has given you some pointers
Peter
---------------------------------------------------------------
This communication and the information it contains is intended for the person or organisation to whom it is addressed.Its contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful.If you have received this message in error, please notify us immediately by telephone or email.
While Rajan Imports has taken every reasonable precaution to minimise the risk of virus transmission through email, we cannot accept liability for any damage which you sustain as a result of software viruses.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Rajan Imports Ltd
61 Great Ducie Street, Manchester M3 1RR.
Tel:0161 831 3700 Fax:0161 831 3715 www.rajan-group.co.uk
The record in the FRX with the EXPR, TAG & TAG2 info is always the first
physical row. At least I've never seen it in any other row in an FRX (or
LBX for that matter). So if you roll your own code, or use Peter's
solution, for hacking an FRX you shouldn't have to do a locate for that
record. Second, W98 stores custom form information with the printer you
have defined whereas NT/W2K/XP store custom forms globally. IOW, once
you create a custom form it is available to all installed printers on
that system. The difference in behavior between them can cause you a
great deal of grief if your custom form reports have to print in a mixed
environment. For example, if you design your report on a 98 box, it will
have one value for PAPERSIZE. It will work on any other 98 box that has
that same printer with the same custom form installed. But if you design
it on an NT box, the PAPERSIZE value is stored in the registry in a
different place and is specific to the machine you were on. That value
is not likely to exist on a different system and means absolutely
nothing to your 98 systems. That won't stop the report from printing. It
will just come out on a standard letter format instead of your carefully
designed custom form size. The best solution I've found so far is to set
up a shared printer on a NT/W2K box and create the form on that system.
Designate the custom form as the default form for that shared printer
and make sure your users know that in order to print that particular
report, they have to use that shared printer.
Peter Cushing wrote:
> If you want a report to always print to a particular printer, that is
> easy. You just save the information in page setup/print setup when
> designing the report layout and the report will alway print to this
> printer. If you want it to print to several printers, you will have
> to clear out the printer information stored in the TAG TAG2 and EXPR
> fields of your report. E.G mylayout.frx Open this like any table and
> first record should be objtype=1 AND objcode=53, clear out these three
> fields then use SET PRINTER TO NAME ... and the report will go to that
> name.
> <snip>
> A special papersize would go in the EXPR field above in PAPERSIZE=
> To get the right setting you would set the printer up with this
> papersize, then design your layout and pick this printer and save it.
> Then look in the expr field to get the setting.
> I assume if you pick a different tray, DEFAULTSOURCE will change, but
> not tested that.
>
--
Richard Kaye
RFC Systems
Voice: 973.761.0868
Fax: 973.761.4329
For the fastest response time, please send your tech support
queries to techsupport@rfcsystems.com
---------------------------------------------------------
---------------------------------------------------------
Richard Kaye wrote:
> The record in the FRX with the EXPR, TAG & TAG2 info is always the
> first physical row. At least I've never seen it in any other row in an
> FRX (or LBX for that matter).
I have never seen it in another position either. The reason I put that
locate in, is that I'm sure I saw it in someone else's solution, so
thought there must be occasions when it varies.
I got round the problem of various OS's printing various layouts to
various printers by designing a print/email app to do all the printing
for me. This is a workstation at my desk that just serves up the print
jobs and emails where necessary. This has lots of advanges:
- You set up the printers on this machine only, everyone picks from that
list.
- You can easily control all the printing from the screen next to you.
- If you need extra software E.g. I use Virtual PDF printer. You only
need 1 licence.
- If you are doing office automation etc. you only need 1 machine with
office installed. Machines without office installed or on an older
version can still produce output.
- If you change some of the code that does the printing, you can install
it without kicking everyone out. Just stop your printing app and
install the new version.
- Jobs that take a long time to print or spool can seem to print
instantly - the machine in the background does all the work.
- If the machine that prints dies, you just install the printers and PDF
driver on the new machine and you are up and running.
- You can have multiple versions of your EXE and run 1 for a test job,
then go back to the real EXE.
etc
Peter
Sounds like a good strategy if you're in a single environment that you
can maintain that level of control.
Peter Cushing wrote:
> I got round the problem of various OS's printing various layouts to
> various printers by designing a print/email app to do all the printing
> for me. This is a workstation at my desk that just serves up the
> print jobs and emails where necessary. This has lots of advanges:
>
> - You set up the printers on this machine only, everyone picks from
> that list.
> - You can easily control all the printing from the screen next to you.
> - If you need extra software E.g. I use Virtual PDF printer. You only
> need 1 licence.
> - If you are doing office automation etc. you only need 1 machine
> with office installed. Machines without office installed or on an
> older version can still produce output.
> - If you change some of the code that does the printing, you can
> install it without kicking everyone out. Just stop your printing app
> and install the new version.
> - Jobs that take a long time to print or spool can seem to print
> instantly - the machine in the background does all the work.
> - If the machine that prints dies, you just install the printers and
> PDF driver on the new machine and you are up and running.
> - You can have multiple versions of your EXE and run 1 for a test job,
> then go back to the real EXE.
> etc
--
Richard Kaye
RFC Systems
Voice: 973.761.0868
Fax: 973.761.4329
For the fastest response time, please send your tech support
queries to techsupport@rfcsystems.com
---------------------------------------------------------
---------------------------------------------------------