herculanojs Posted August 12, 2016 Posted August 12, 2016 Friends, I am breaking the cebça and can not understand what happens. In unigui application, the printer returned as standard has nothing to do as it is. For I added unigui application screens and vcl. The code to get the default printer is the same in both applications. And I'm doing the test on the server itself. unigui: if Printer.Printers.Count > 0 then Result := Printer.Printers[Printer.PrinterIndex]; vcl: if Printer.Printers.Count > 0 then Memo1.lines.add(Printer.Printers[Printer.PrinterIndex]); What can it be? The application is being executed on the machine where it installed the web server, and will be performed only at this station. Quote
Sherzod Posted August 13, 2016 Posted August 13, 2016 Hi, If the default printer is changed, then maybe you need to restart the application.. Best regards. Quote
ZigZig Posted August 13, 2016 Posted August 13, 2016 It is possible that the default printer of IIS_USR (which is the default user of a web process running in IIS, such as uniGUI) is not defined. Maybe you could define the default printer with a GPO. Quote
Administrators Farshad Mohajeri Posted August 13, 2016 Administrators Posted August 13, 2016 If it is an IIS app then you must check if IUSR account has access to all printers. Quote
herculanojs Posted August 15, 2016 Author Posted August 15, 2016 If it is an IIS app then you must check if IUSR account has access to all printers. Where exactly should be set that? The User IUSR this with full access to the application folder. Quote
Administrators Farshad Mohajeri Posted August 15, 2016 Administrators Posted August 15, 2016 Printer must be given access to IUSR account. Quote
herculanojs Posted August 15, 2016 Author Posted August 15, 2016 Farshad, I have done the following: In this printer as the default, I granted access to IUSR (full). In the application folder, this too full. Debugging the plication, print normally, but when the ISAPI aplciação, does not print. I'm not printing the client, I am directly on the machine where the server is installed, the printer is installed on it. The ISAPI application will only be used in this season, so it should not have any problem to use machine resources. Always falls on the exception Code: Try Report.AllowPrintToFile := false; Report.AllowPrintToArchive := false; Report.DeviceType := 'Printer'; Report.PrintReport; except on e:exception do begin AddToLog('PrintReport: Erro ao imprimir: '+e.Message); Report.AllowPrintToFile := True; Report.DefaultFileDeviceType := 'PDF'; Report.DeviceType := 'PDF'; Report.TextFileName := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', AUrl); Report.Print; ReportPreview(Titulo,AUrl,'',nil); end; End; Quote
ZigZig Posted August 15, 2016 Posted August 15, 2016 It is possible that the default printer of IIS_USR (which is the default user of a web process running in IIS, such as uniGUI) is not defined. Maybe you could define the default printer with a GPO. Quote
herculanojs Posted August 16, 2016 Author Posted August 16, 2016 People I no longer know what to do. Makes 2 days I'm trying a solution to this problem. The application in standalone mode, prints normally. However ISAPI does not print anything. Already granted permission where it could no longer know what to do. For God's sake, it's just a simple application that should print a report on the machine which is installed IIS using the default printer that is there. Nothing else. The IUSR user already has access to a printer, you have access the folder, the more it must have access to be able to print? Gente eu já não sei mais o que fazer. Faz 2 dias que estou tentando uma solução para esse problema. A aplicação em modo standalone, imprime normalmente. Contudo em ISAPI não imprime nada. Já concedi permissão onde poderia, já não sei mais o que fazer. Pelo amor de Deus, é apenas uma simples aplicação que deveria imprimir um relatório, na máquina onde esta instalado o IIS, utilizando a impressora padrão que encontra-se ali. Nada mais. O usuário IUSR já tem acesso a impressora, tem acesso a pasta, a que mais ele deve ter acesso para poder imprimir? Quote
herculanojs Posted August 16, 2016 Author Posted August 16, 2016 Is something wrong people! I created an application to run the ISAPI. I tested the performance in various ways, and simply ISAPI does not run. It is not a question of security because all aobsolutamente all users are with permission on the folder where the application is being executed, and in IIS. I ask? I can not run an application? I can not print? Please could someone give me a help towards. What should I set this server? The setting is within the standard of unigui documentation. What is missing then? I am about to leave the ungui and move on to another solution. simple things and is giving a huge headache, and there is no documentation, etc. I can guide. And please, I am not wanting to print anything on the Web, just want to print a pdf document on a printer that is installed on the server. Nothing else I thought it was something about the impression. I created an application to run the report print, and no run. Simple: the isapi application does not run. procedure PrintPDF; begin Report.AllowPrintToFile := True; Report.DefaultFileDeviceType := 'PDF'; Report.DeviceType := 'PDF'; Report.TextFileName := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', AUrl); Report.Print; if FileExists(Report.TextFileName) then begin AUrl := PathSistema+'wprint.exe "'+PrinterName+'|'+Report.TextFileName+'|'+IntToStr(Report.PrinterSetup.Copies)+'"'; CreateProcessSimple(aurl); AddToLog(aurl); WinExec(pansichar(AUrl),0); end; end; Quote
ZigZig Posted August 16, 2016 Posted August 16, 2016 It is possible that the default printer of IIS_USR (which is the default user of a web process running in IIS, such as uniGUI) is not defined. Maybe you could define the default printer with a GPO. Quote
zilav Posted August 16, 2016 Posted August 16, 2016 http://stackoverflow.com/questions/24174023/win2008-r2-iis-7-5-no-default-printer-installed-error-from-isapi-web-service Quote
ZigZig Posted August 16, 2016 Posted August 16, 2016 http://stackoverflow.com/questions/24174023/win2008-r2-iis-7-5-no-default-printer-installed-error-from-isapi-web-service In the same way: https://forums.iis.net/t/1168200.aspx Quote
radiocab Posted September 30, 2016 Posted September 30, 2016 If you create report by FastReport then don't export report in PDF format.Try to save Prepared Report in FP3 format and print using my PrintDocum appAnd don't forget to setup the right Application Pooling Identity PrintDocum.zip Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.