Source language: Translate to:

Two printers in one pub and in one session....

General questions about NeoBook

Moderator: Neosoft Support

Two printers in one pub and in one session....

Postby ebear » Tue Feb 18, 2014 4:47 pm

Hello All,

I know that this issue is already several times discussed, but I like to know if someone has found a workaround on this.

I need to print "without user interaction" a label from a label printer and a A4 from a laser printer. Both printers are connected to the same PC.
Both printouts will be generated from a report template build with the DBPro report designer. (Labels for bags and A4 sheets on boxes.)


I understand from the discussions that Neobook isn't able to change the printer in session.
Also I read a old 2009 discussion where Dave told in a newer version he will implement the possibility.

I have tried out several things but nothing works. The possibility to use two printers from one application is very important, without this my complete application will be garbish.

Best regards,

Eric
Last edited by ebear on Wed Feb 19, 2014 6:09 pm, edited 1 time in total.
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Two printer in one pub

Postby Cipolla » Wed Feb 19, 2014 12:55 am

Hello Eric,

neobook use the standard printer for the print action. What i have done in the past ist to change the default printer with a command line action:

Code: Select all
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printer"


A google search will give you even more ideas. Keywords:

command line change default printer
Greetings from Germany
Klaus
User avatar
Cipolla
 
Posts: 166
Joined: Fri Apr 01, 2005 1:45 am
Location: Germany

Re: Two printer in one pub

Postby ebear » Wed Feb 19, 2014 8:55 am

Hello Cipolla,

Thanks for your reaction.

I did this but it looks that Neobook at start determines which printer is default and uses this printer during the whole session. In session default printer change does not change Neobooks behavior.

My application is an production logistics app, which needs to print label through an Epson LQ-1050 and in the same session print box labels on a laser printer A4.
In short: bags with items will have a sticky label, 10 bags go in a box with a A4 sheet. All this has to be done in-one, with an in session printer change....

Regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Two printer in one pub

Postby HPW » Wed Feb 19, 2014 10:34 am

Hello,

I used this vbscripts found here on the Forum:

SetPrinter
Code: Select all
{NeoBook Function}
Version=5,80
Language=VBScript
Param=[%PrinterName]|Text|Printer Name
{End}
Set WshNetwork = CreateObject("Wscript.Network")
WshNetwork.SetDefaultPrinter "[%PrinterName]"


GetDefaultPrinter
Code: Select all
{NeoBook Function}
Version=5,80
Language=VBScript
Param=[%Variable]|Variable|Printer Name to store default printer:
{End}
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer")

For Each objPrinter in colPrinters
  If (objPrinter.Attributes AND 4) = 4 Then
    publication.nbSetVar "[%Variable]", objPrinter.Name
  End If
Next


In neobook book propertys you disable the Printer dialogs.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Two printer in one pub

Postby dec » Wed Feb 19, 2014 11:22 am

.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Two printer in one pub

Postby ebear » Wed Feb 19, 2014 6:08 pm

Hello All,

Or I do really something wrong, but it doesn't work. As I already wrote before, it seems that a change of default printer during a session does not trigger Neobook to change the printer.
It really looks like when the app starts, Neobook takes the default printer and uses this until the app is closed.

I tried the new function of David in npUtils (thanks a lot David), in "devices and printers" I see the default printer changing, but Neobook stays printing on the printer which was default at start.

This function I didn't need until now, but I think that something that simple should really work. In my case it isn't possible to let the user every time choose the needed printer with the Printer Dialog???
Maybe Neobook can give a reaction on this issue.....

Regards,

Eric
Last edited by ebear on Wed Feb 19, 2014 6:44 pm, edited 1 time in total.
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Two printers in one pub and in one session.... Solution?

Postby ebear » Wed Feb 19, 2014 6:38 pm

Hello All,

I think I found a solution, at least for the report designer......

From the DBPro Help:

The Printer selected here is used to calculate the available paper sizes and print margins. This specific printer is used only for design and testing purposes and is not required to print the report. However, you should keep in mind that the features and capabilities of different printer models can vary widely.


In the Report properties is a checkbox with "Select when report is loaded". From the help (above) I would think this selection is only "for design and testing", but it works really.....
The disadvantage is that for each PC-printer configuration a custom report is needed, this also means that for each customer a customized report is needed???

My idea was to create a settings menu to select the printers for label and A4 printing and to save this per PC configuration in the register. This looks now impossible.

Ok I can live with this... but to create a universal application I don't think this is the solution. And for the DBPro reports it works, but what if someone wants to print on different printers "in the same session" without using the DBPro reports.
If it is impossible to trigger Neobook in session to change the default printer..... I think something to think about.

Thanks a lot for all your kind reactions. And again if I'm doing something wrong yet, please let me (us) know.

Best regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Two printers in one pub and in one session.... Solution?

Postby dec » Wed Feb 19, 2014 7:58 pm

Hello,

What about if we use a separate NeoBook publication to do the printer job? I am think you can understand what I want to try. Maybe you cannot change the default printer and expected to work from the same publication, but, maybe is possible to change the default printer from one publication, and then, launch another publication which are responsible to do the printer job. I think this second publication may can use the previously established default printer.

At the least this is the idea... ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Two printers in one pub and in one session....

Postby ebear » Thu Feb 20, 2014 9:10 am

Hello David,

I was also thinking about this solution, but it is a database application this means that the printer app needs to connect to the SQL server, login etc etc and this only to print a sheet....
On the moment I'm fine I think because as I already wrote before the function in the report designer (select when report is loaded).

But of cause it would be so simple if there was a possibility to tell Neobook "PrintThisDocumentOnThisPrinter" ;-) or at least when Neobook could monitor the change of the default printer.....
All other software selects the default printer at printer job start and not at program start.

Okay I will do it with separate Report Designer templates per PC-configuration, but I think if you sell your applications to several customer the maintenance would be a hell.....

Best regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Two printers in one pub and in one session....

Postby dec » Thu Feb 20, 2014 9:16 am

Hello,

ebear wrote:All other software selects the default printer at printer job start and not at program start.


I am not sure Eric. When I change the default printer from a publication using the refered npUtil actions and try to print from my Small Editor program, this do not take the changes made by the NeoBook publication until the program is restarted. I do not try to change the printer from the Small Editor, and therefore I have here only some "virtual printer", but I think this is not an exclusive NeoBook "problem". I am not sure.

P.S. Of course I think that the "launched" publication need to be configured to access the database, etc. But, if this solution can work... maybe we can expend the neccesary efforts, because at the least we can do exactly what we wanted. I repeat, this without know if the proposed solution can work or not.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Two printers in one pub and in one session....

Postby Neosoft Support » Thu Feb 20, 2014 11:30 am

I have successfully used the SetPrinter function (posted by HPW) to print to multiple printers in NeoBook. NeoBook's internal print actions also let the user select a printer prior to printing.

When designing a DBPro report that will be printed on a variety of printers, you should select the "Generic Printer" option in Report Designer. This should then force the report to be printed to the default printer which can be set with the SetPrinter function.

It's a good idea to save the user's default printer using the GetDefaultPrinter function, then restore it when you're done printing.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Two printers in one pub and in one session....

Postby ebear » Thu Feb 20, 2014 1:30 pm

Hello All,

Dave I tried the HPW function already before and doesn't work. And I dont want the user at each printjob to select a printer for the job, this doesn't work in a workfloor situation.
The only thing that works is to create PC-configuration dependent reports with the special printer selected and the check box "select when report is loaded" on.

In my case it's a workaround but I resumed the discussion to find out if there are other solutions, mainly for situations where the software is commercial or if other than report printer output is needed on multiple printers.

I tried several solutions and all work to select a new default printer (HPW, npUtil) with the Devices and Printers window open I see that the default printer changes, but the pub uses the printer who was default at startup of the pub.

All thanks a lot for the moment I will use the report option.

Best regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Two printers in one pub and in one session....

Postby Neosoft Support » Fri Feb 21, 2014 11:32 am

The SetPrinter function works properly with NeoBook's built-in printing actions (PrintPage, etc.), but it does not work when printing reports with DBPro.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Two printers in one pub and in one session....

Postby ebear » Fri Feb 21, 2014 11:44 am

Hello Dave,

Thats possible, I was working with reports and I didn't try anything else. That makes my other worries fiddling.

Any chance to have also the reports reacting like this in the future, or any workaround????

Thanks,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Two printers in one pub and in one session....

Postby Neosoft Support » Sat Feb 22, 2014 10:44 am

Any chance to have also the reports reacting like this in the future, or any workaround????


Possibly. The report module is based on something that we didn't write, but the source code is available so we may be able to change how it works in the future. In the mean time, you should be able to specify the target printer in Report Designer and have it print to the correct printer at runtime.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Next

Return to General NeoBook Discussions

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest