how to print at a time from one command to two printer using vb6

Hi
i have two thermal printers ..
one is in the kitchen and another one is on the counter.

From my vb application i am using following code to print and its printing by thermal printer which is on the counter,
but same form i want to print through kitchen printer..
    CrystalReport1.ReportFileName = App.Path & "\Temp.rpt"
    
    CrystalReport1.Connect = con
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.RetrieveDataFiles
    CrystalReport1.SelectionFormula = "{DBTemp.IDNo} = " & Text1(0).Text & ""
    CrystalReport1.Password = Chr(10) & MyPassWod
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.WindowState = crptMaximized
    CrystalReport1.Action = 1
    CrystalReport1.PageZoom 100

Open in new window


i mean how to print same time same print on different printers through vb6.code..?

both printers are connected through LAN
LVL 1
crystal_TechAsked:
Who is Participating?
 
Martin LissOlder than dirtCommented:
Does this help?
0
 
mlmccCommented:
Since Crystal will print to the default printer

Try
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_25601312.html?cid=1576

Are both printers the same make and model?
Do they use the same printer driver?

mlmcc
0
On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

 
crystal_TechAuthor Commented:
@ mlmcc
<<Are both printers the same make and model?>>
Yes Both printers the same make and model.. so i think they use the same driver.
0
 
crystal_TechAuthor Commented:
Using CR7 version..
For default printer is OK ( No Problem for default printer ) but another printer is somewhere else
and for single click (from my vb application command button.) same time i want to print out from default printer and LAN printer

for single print i am using following code for default printer.

Do i need to use ..?
if yes then where i place this line into my code
CrystalReport1.PrinterName = myprintername

    CrystalReport1.ReportFileName = App.Path & "\Temp.rpt"    
    CrystalReport1.Connect = con
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.RetrieveDataFiles
    CrystalReport1.SelectionFormula = "{DBTemp.IDNo} = " & Text1(0).Text & ""
    CrystalReport1.Password = Chr(10) & MyPassWod
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.WindowState = crptMaximized
    CrystalReport1.Action = 1
    CrystalReport1.PageZoom 100

Open in new window

0
 
mlmccCommented:
You will have use that code then reppeat your code

Change Default Printer
Your Code

mlmcc
0
 
crystal_TechAuthor Commented:
you mean to add just a following line with my code..? or something else also


CrystalReport1.PrinterName = myprintername
0
 
Martin LissOlder than dirtCommented:
Try this

CrystalReport1.PrinterName = myprintername1
CrystalReport1.ReportFileName = App.Path & "\Temp.rpt"    
    CrystalReport1.Connect = con
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.RetrieveDataFiles
    CrystalReport1.SelectionFormula = "{DBTemp.IDNo} = " & Text1(0).Text & ""
    CrystalReport1.Password = Chr(10) & MyPassWod
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.WindowState = crptMaximized
    CrystalReport1.Action = 1
    CrystalReport1.PageZoom 100

CrystalReport1.PrinterName = myprintername2
CrystalReport1.ReportFileName = App.Path & "\Temp.rpt"    
    CrystalReport1.Connect = con
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.RetrieveDataFiles
    CrystalReport1.SelectionFormula = "{DBTemp.IDNo} = " & Text1(0).Text & ""
    CrystalReport1.Password = Chr(10) & MyPassWod
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.WindowState = crptMaximized
    CrystalReport1.Action = 1
    CrystalReport1.PageZoom 100
0
 
crystal_TechAuthor Commented:
TRIED BUT
i got print from attached printer but not from LAN Printer. it supposed to be print from LAN ( COM1 )
and this printer is shared

    CrystalReport1.PrinterName = "com1"       ' This is A LAN printer (some where else)
    CrystalReport1.ReportFileName = App.Path & "\KOTtemp.rpt"
   
    CrystalReport1.Connect = "DSN=james;UID=bond;PWD=amesbond;DSQ=crystalDB"
   
'''    CrystalReport1.Connect = con
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.RetrieveDataFiles
    CrystalReport1.SelectionFormula = "{KTemp.KNo} = " & Text1(0).Text & " AND {KTemp.Grp_itm} = 'BAR'"
0
 
Surone1Commented:
what happens if you change the default printer to the lan printer. will it print at all?
0
 
crystal_TechAuthor Commented:
Yes it is printing if i change the default printer to the lan printer manually..
0
 
eemitCommented:
Check out this thread (Accepted Solution):
Q_27792093
Hope this helps.
0
 
Surone1Commented:
o.k. so what you need to do is print to one printer, change the default printer in code, then print to the second printer. and finally change the default printer back to what it was. i suspect the above link contains the code to do that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.