Thankyou very much once more for your help! Now it works perfectly and the window Foxweb1 does not open.
Sent by FoxWeb Support on 02/22/2007 05:33:33 PM:
You should not use the "Allow service to interact with desktop" option. What you need to do instead, is change the service's Log On properties, so that it runs as a user that has rights to print to this particular printer and also has the printer definition. To test this, simply enter your own userid and password in the Log On tab of the FoxWeb service.
For details, please refer to the Running as a System Service section in the Operating the FoxWeb Server topic of the FoxWeb documentation.
Sent by Carlos Fuertes on 02/22/2007 07:51:00 AM:
You are right! it work when running as regular application. I have been looking at the Foxweb service properties and I can see in the Log On page a checkbox with this text: Allow service to interact with desktop. Do you think printing will work fine running the service if I check it?
Also, when printing occurs, a foxweb window opens in the server's screen, but it doesn't close automatically. What can I do?
Thanks a lot
Sent by FoxWeb Support on 02/21/2007 09:21:58 PM:
Does your code work from a regular VFP program? If not, then you need to solve that part first.
Are you running FoxWeb as a service? If yes, have you tried running as a regular application? The problem may be the printer definitions for the service user.
Sent by FoxWeb Support on 02/21/2007 10:27:16 AM:
I'm trying to print a report to the server's printer using the REPORT FORM command, but it doesn't work. I create a table in the same folder where the foxweb scripts reside, and also the frx file is located there.
My server runs Windows 2003 server and I have installed three printers:
1 HP LaserJet 1200 marked as Default printer (I want the report to print here)
1 Microsoft Office Document Image Writer
Well, when I execute the script, none is printed but I can see the number of documents near the Fax icon is increased!!!
Please, could you tell me if anyone has experienced something like this?
I attach my code for reference (this is called from an fwx script):
PARAMETERS lcNumparteLOCAL lnNumparte
lnNumparte = VAL(lcNumparte)IF FILE("Partpend.dbf")
DELETE FILE Partpend.*
USE &wcEspPath.\CENTROS.DBF IN 0 SHARED ALIAS CENTROS
ENDIFSELECT Partes.Centro_id, Partes.Prioridad, Partes.Especialid, Partes.Edificio, Partes.Departam, Partes.parte_num, Partes.tipo_parte, Partes.Mantenedor,;
Partes.fecha_part, Partes.persona, Partes.avería, Partes.técnico1, Partes.técnico2, Partes.Observa, Partes.Trabajo, Partes.totalhoras, Partes.Totalhdes, ;
Partes.Técnico3, Partes.Técnico4, Centros.descentro, Centros.telefono, Centros.nif, Partes.Facturar, Partes.Cliente_id, Partes.Referencia, ;
Centros.direccion, Centros.ciudad, Centros.delegacion, Centros.Deleg_id, Centros.código_postal, Centros.ruta_id, Partes.horas_tec1, Partes.Hdes_tec1, Partes.horas_tec2, Partes.Hdes_tec2, Partes.horas_tec3, Partes.Hdes_tec3, Partes.horas_tec4, Partes.Hdes_tec4, Partes.Fecha_term, ;
Centros.provincia, Centros.tipocontrato, Centros.contrato_num;
FROM partes, centros;
INTO TABLE partpend;
WHERE Partes.centro_id = Centros.centro_id;
HAVING Partes.Parte_num = lnNumparte;
ORDER BY Partes.parte_num
*-- Añadir campos a partpend para evitar erroresALTER TABLE Partpend ADD Refecruz c(30)
ALTER TABLE Partpend ADD Clave c(5)ALTER TABLE Partpend ADD numero n(3)
ALTER TABLE Partpend ADD orden n(3)ALTER TABLE Partpend ADD inicial n(3) ALTER TABLE Partpend ADD final n(3)
ALTER TABLE Partpend ADD calibra l(1)
USE IN Partes
USE IN Centros
GO TOPIF FILE("&wcEspPath.\EMPRESA.DBF")
USE &wcEspPath.\EMPRESA.DBF IN 0 SHARED ALIAS EMPRESA
SET PRINTER TO "HPLaserJ"REPORT FORM ParteCl.FRX NOCONSOLE TO PRINTER NOWAIT
USE IN Empresa
USE IN Partpend
The table partpend is always well generated, but printing doesn't happen
Thanks in advance