Click here to Skip to main content
15,887,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi experts,

i dont know how to embed window application into my web application.i already create web application..it is done.now, i want to create function print in window application and then call it from my web.so there will be post and get parameters between them.

hope can show me how to create this application as i dont have done it before.

i want to print tickets.currently i able to print ticket.but only one ticket at a time.lets say i want to print ticket for 5persons the thermal printer (EPSON receipt printer) will print it out in a long page.i already do the page break but nothing happen.

so ive code to print for many tickets but it only implement in windows application....so thats my situation...what else i can do to solve this?

my code to print:-
Java
<script type="text/vbscript">
Sub Print()
       'print_ticket.style.visibility="hidden"
        OLECMDID_PRINT = 6
       OLECMDEXECOPT_DONTPROMPTUSER = 2
       OLECMDEXECOPT_PROMPTUSER = 1
       call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
       'print_ticket.style.visibility="visible"

      'if print_ticket.click = true
      'dim status


End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"

<body  önload="Print();"  öncontextmenu="return false">
<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"> </object>


thanks in advance,
musiw.
Posted
Updated 7-Jan-14 8:42am
v3
Comments
walterhevedeich 6-Jan-14 23:51pm    
You don't need to create a separate windows application for printing. You can do it directly in your web application. What exactly do you need to print?
dan!sh 7-Jan-14 0:57am    
Bad idea. Assuming your windows application is built in .Net framework, how do you expect it to work on, say, Linux? What do you want to print anyway?
musiw 7-Jan-14 2:04am    
i want to print tickets.currently i able to print ticket.but only one ticket at a time.lets say i want to print ticket for 5persons the thermal printer (EPSON receipt printer) will print it out in a long page.i already do the page break but nothing happen.

so ive code to print for many tickets but it only implement in windows application....so thats my situation...what else i can do to solve this?

my code to print:-

<script type="text/vbscript">
Sub Print()
'print_ticket.style.visibility="hidden"
OLECMDID_PRINT = 6
OLECMDEXECOPT_DONTPROMPTUSER = 2
OLECMDEXECOPT_PROMPTUSER = 1
call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
'print_ticket.style.visibility="visible"

'if print_ticket.click = true
'dim status


End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"

<body onload="Print();" öncontextmenu="return false">
<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"> </object>


the code to bypass print dialog.
thatraja 7-Jan-14 2:39am    
Include this content in your question
Arslan Elahi 7-Jan-14 5:17am    
i don't understand why do you need windows app for printing.. you can give print via web app...
what the exact reason to choose the window app for printing the document?

1 solution

I would suggest to use PrintDocument class[^] in code behind. Sample code: ASP.NET + PrintDocument[^]
Other way: PrintHelper class[^]
 
Share this answer
 
Comments
musiw 8-Jan-14 21:47pm    
the link did help me give ideas...which is i dont need to use window.print() as it dont cut paper.i use print document(). right now i try to install printer driver to sever then goint to configure it to print to local user's pc... any suggestion??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900