LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

set default printer

Hi,
 
I wrote a small vi (LV 7.0) to get/set default printer, but it doesn't work at all.
If I set one of the available printers as default (for example PDFCreator), when I re-start my test vi, I read that default printer is PDFCreator, so it seems OK. But under Settings --> Printer I can see that default printer isn't changed, and if I give a print command this printer is activated (and not PDFCreator).
If i set another printer as default, the behavior is exactly the same.
 
I tried my vi on:
- Win XP SP1
- Win 2k SP4
and no differences.
 
Any suggestions to programatically set default printer on Win 2k and Win XP?
 
Thanks in advance.
 
Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 11
(8,067 Views)

Hi

If you right-click one of your property-nodes (pr.defaultprinter) and select help for printing:defaultprinter, you will see that this information is just valid in the LV-environment. The system is not affected by these properties.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 11
(8,060 Views)

so, if I use the method "Print Panel to Printer" I can change the default printer (in LV environment) as I want (I checked), but if I use the Print HTML Report (which send print command from a browser) this is impossible.

Correct?

No solutions?

Message Edited by vix on 07-25-2005 10:22 AM

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 3 of 11
(8,053 Views)
What do you mean with "Print HTML Report"? The standard report vis? If yes - there should be able to pass the printer you want to print to.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 11
(8,049 Views)

What do you mean with "Print HTML Report"? The standard report vis?

The Report Generation VI, with report type = HTML (not standard report).
 


If yes - there should be able to pass the printer you want to print to.

Only for a standard report, not for a HTML one.
I find in the Print Report.vi help:
"printer name is the name of the printer to which you want to print the report.
 [CUT]
 If you print an HTML report, the VI ignores this input and uses the default printer for Internet Explorer. "
Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 11
(8,047 Views)
So will have to change the corresponding entries in the registry - but I don't know which keys you have to change.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 11
(8,043 Views)

I found the documentation on Microsoft Web Site: the registry is

HKEY_CURRENT_USER

Software\Microsoft\Windows NT\CurrentVersion\Windows

Device

I wrote a small VI and it works well (on Win XP)

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 7 of 11
(8,030 Views)
hello all
 
Thanks for your .VI
but still have a problem on my using.
Printer name:
  DATAMAX I-4308   and set as default printer
 
i want to set the size of the printer,
and it can be setted,but actually it have no active.
pls could you help me~~~~
thanks in advance~~~
 
0 Kudos
Message 8 of 11
(7,537 Views)


@vettle wrote:
 
i want to set the size of the printer,
and it can be setted,but actually it have no active.


I'm not able to completely understand what do you mean.
Could you explain it better?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 9 of 11
(7,520 Views)
Thanks for your replay
为了能把意思说明白,请允许我用汉语。
控制面板里,默认打印机里有个打印首选项,里面可以选择比如纸张大小,方向,效果,打印速度等等。
我现在想在LV里实现这些,这样就不用打开打印机里的哪个设置了,或者在LV中把这个设置页面调出来也可以。
目前的问题是:
 使用上面的程序可以把设置页面调出来,也可以修改比如纸张大小啊之类的,但是实际上打印出来的还是在默认打印机里
打印首选项里的设置。也就是说上面的程序的设置并没有起到作用。
 
LVSetDefaultPrinter 里面有哪些参数?在哪里可以看到或者找到,
Thanks in advance~~~~
 
0 Kudos
Message 10 of 11
(7,502 Views)