Cannot print on net-work printer 
Author Message
 Cannot print on net-work printer

Hi, I have problem on printing at a network printer in
VFP 6.0.

Statement is :-

***
SET PRIN TO \\Peter\HPprint
REPORT FORM REPORT01 NOEJECT NOCONSOLE TO PRINTER
***
It always print to the LOCAL Printer

But the following is success :-

***
SET PRIN TO \\Peter\HPprint
SET PRINT ON
? "TESTING........................."
?
SET PRIN OFF
SET PRIN TO DEFA

Can anyone help ?

Regard
Sammy



Tue, 06 Sep 2005 16:24:39 GMT  
 Cannot print on net-work printer
Hello, Sammy!
You wrote  on Fri, 21 Mar 2003 00:24:39 -0800:

 S> Statement is :-

 S> ***
 S> SET PRIN TO \\Peter\HPprint
 S> REPORT FORM REPORT01 NOEJECT NOCONSOLE TO PRINTER
 S> ***
 S> It always print to the LOCAL Printer

 S> But the following is success :-

 S> ***
 S> SET PRIN TO \\Peter\HPprint
 S> SET PRINT ON
 S> ? "TESTING........................."
 S> ?
 S> SET PRIN OFF
 S> SET PRIN TO DEFA

 S> Can anyone help ?

 S> Regard
 S> Sammy

Why are you hard-coding the printer name? Try  REPORT FORM ... TO PRINTER
PROMPT
---
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Tue, 06 Sep 2005 16:29:07 GMT  
 Cannot print on net-work printer

Quote:
>-----Original Message-----
>Hello, Sammy!
>You wrote  on Fri, 21 Mar 2003 00:24:39 -0800:

> S> Statement is :-

> S> ***
> S> SET PRIN TO \\Peter\HPprint
> S> REPORT FORM REPORT01 NOEJECT NOCONSOLE TO PRINTER
> S> ***
> S> It always print to the LOCAL Printer

> S> But the following is success :-

> S> ***
> S> SET PRIN TO \\Peter\HPprint
> S> SET PRINT ON
> S> ? "TESTING........................."
> S> ?
> S> SET PRIN OFF
> S> SET PRIN TO DEFA

> S> Can anyone help ?

> S> Regard
> S> Sammy

>Why are you hard-coding the printer name? Try  REPORT
FORM ... TO PRINTER
>PROMPT
>---
>Eric den Doop
>www.foxite.com - The Home Of The Visual FoxPro Experts -
Powered By VFP8

Hi, Eric.

I understand what you told me, but in this case, I have 3
different report formats in the report like this :-

***
report form ... to print && a summary report
report form ... to print && a retail report
report form ... to print && a wholesale report
***

If I put a "PROMPT" there, I have to choose printer every
time the report form change, so that's why I hard-coding
the printer for the document printing, and the other one
for the pre-printed form printing.

Regard
Sammy



Tue, 06 Sep 2005 19:21:11 GMT  
 Cannot print on net-work printer
Hello, Sammy!
You wrote  on Fri, 21 Mar 2003 03:21:11 -0800:

 S> Hi, Eric.

 S> I understand what you told me, but in this case, I have 3
 S> different report formats in the report like this :-

 S> ***
 S> report form ... to print && a summary report
 S> report form ... to print && a retail report
 S> report form ... to print && a wholesale report
 S> ***

 S> If I put a "PROMPT" there, I have to choose printer every
 S> time the report form change, so that's why I hard-coding
 S> the printer for the document printing, and the other one
 S> for the pre-printed form printing.
 S>
 S> Regard
 S> Sammy

Ahh I understand. Try this:

lcPrinterName = GETPRINTER()
SET PRINTER TO NAME (lcPrinter)
REPORT FORM ... TO PRINTER
REPORT FORM ... TO PRINTER
REPORT FORM ... TO PRINTER

As you can see, you do not have to hardcode the printer name!
---
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Tue, 06 Sep 2005 19:47:37 GMT  
 Cannot print on net-work printer
Hello, Eric!
You wrote to Sammy on Fri, 21 Mar 2003 12:47:37 +0100:

Sorry, I made a small error. Let me try again.

lcPrinterName = GETPRINTER()
SET PRINTER TO NAME (lcPrinterName) &&(lcPrinter)
REPORT FORM ... TO PRINTER
REPORT FORM ... TO PRINTER
REPORT FORM ... TO PRINTER

---
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Tue, 06 Sep 2005 19:50:37 GMT  
 Cannot print on net-work printer
Eric and Sammy,

Maybe the DEVICE= has to be taken out of the expr field in the first record
of REPORT01.frx

There's a kb article somewhere

I alwyas use this

*-----------------
function ReportsCleanUp()
 local reports[1], n, s, j, lines, newexpr, t, KeepLine

 s = select(0)
 select 0

 n = adir(reports, '.\Report\*.??x')
 t = therm(n, 'Cleaning up reports...')

 for i = 1 to n
  if( !inlist(justExt(reports[i,1]), 'FRX', 'LBX') )
   loop
  endif

  =t.update(i, juststem(reports[i,1]))

  use ('.\' + reports[i,1]) excl
  go top
  locate for (ObjType = 1) and (ObjCode = 53)
  assert found()

  lines = memlines(expr)
  newexpr = ''
  for j = 1 to lines

   do case
   case at('DRIVER=',mline(expr,j)) == 1
    KeepLine = FALSE
   case at('ORIENTATION=',mline(expr,j)) == 1
    KeepLine = TRUE
   case at('PAPERSIZE=',mline(expr,j)) == 1
    KeepLine = TRUE
   case at('COPIES=',mline(expr,j)) == 1
    KeepLine = TRUE
   otherwise
    KeepLine = FALSE
   endcase

   do case
   case KeepLine
    newexpr = newexpr + mline(expr,j) + chr(13) + chr(10)
   endcase

  endfor

  if( empty(at('DRIVER', newexpr) ) )
   newexpr = 'DRIVER=winspool' + chr(13) + chr(10) + newexpr
  endif

  repl expr with newexpr, tag with '', tag2 with ''
  pack
  use
  do case
  case inlist(justExt(reports[i,1]), 'FRX')
   compile report ('.\' + reports[i,1])
  case inlist(justExt(reports[i,1]), 'LBX')
   compile label  ('.\' + reports[i,1])
  otherwise
   assert FALSE
  endcase

 endfor

 select (s)
endfunc
*--------------------------------------------------------------------------

Quote:

> >-----Original Message-----
> >Hello, Sammy!
> >You wrote  on Fri, 21 Mar 2003 00:24:39 -0800:

> > S> Statement is :-

> > S> ***
> > S> SET PRIN TO \\Peter\HPprint
> > S> REPORT FORM REPORT01 NOEJECT NOCONSOLE TO PRINTER
> > S> ***
> > S> It always print to the LOCAL Printer

> > S> But the following is success :-

> > S> ***
> > S> SET PRIN TO \\Peter\HPprint
> > S> SET PRINT ON
> > S> ? "TESTING........................."
> > S> ?
> > S> SET PRIN OFF
> > S> SET PRIN TO DEFA

> > S> Can anyone help ?

> > S> Regard
> > S> Sammy

> >Why are you hard-coding the printer name? Try  REPORT
> FORM ... TO PRINTER
> >PROMPT
> >---
> >Eric den Doop
> >www.foxite.com - The Home Of The Visual FoxPro Experts -
> Powered By VFP8

> Hi, Eric.

> I understand what you told me, but in this case, I have 3
> different report formats in the report like this :-

> ***
> report form ... to print && a summary report
> report form ... to print && a retail report
> report form ... to print && a wholesale report
> ***

> If I put a "PROMPT" there, I have to choose printer every
> time the report form change, so that's why I hard-coding
> the printer for the document printing, and the other one
> for the pre-printed form printing.

> Regard
> Sammy



Tue, 06 Sep 2005 19:55:22 GMT  
 Cannot print on net-work printer
Hi Sammy

I think you just left out the keyword 'NAME'.

Try
 SET PRIN TO NAME \\Peter\HPprint

Cheers
John


Quote:
> Hi, I have problem on printing at a network printer in
> VFP 6.0.

> Statement is :-

> ***
> SET PRIN TO \\Peter\HPprint
> REPORT FORM REPORT01 NOEJECT NOCONSOLE TO PRINTER
> ***
> It always print to the LOCAL Printer

> But the following is success :-

> ***
> SET PRIN TO \\Peter\HPprint
> SET PRINT ON
> ? "TESTING........................."
> ?
> SET PRIN OFF
> SET PRIN TO DEFA

> Can anyone help ?

> Regard
> Sammy



Sat, 10 Sep 2005 13:02:41 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. rdp cannot print to network printer ?

2. FPW2.6 printing to network printer w/SET DEVICE TO PRINTER

3. Help: cannot print to the printer I want

4. Printing to specific network printer.

5. FoxPro 2.6 DOS using NT 4.0 Printing to Network Printers

6. FPW26 printing to network printer causes GPF

7. Printing Directly To A Network Printer

8. Problem Printing to Network Printer

9. FPW2.6 Print a file to network printer

10. FoxPro Dos printing to network printers

11. Printing report on differents printers on the network

12. printing to different network printers in win95

 

 
Powered by phpBB® Forum Software