Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1069
  • Last Modified:

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
0
crystal_Tech
Asked:
crystal_Tech
  • 5
  • 3
  • 2
  • +2
1 Solution
 
Martin LissRetired ProgrammerCommented:
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
 
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 LissRetired ProgrammerCommented:
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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 5
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now