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: 326
  • Last Modified:

manage print queue in asp

I need to print an asp page, and then manage the print queue in asp, including pausing and deleting a particular job....
0
babypris
Asked:
babypris
  • 6
  • 5
  • 2
1 Solution
 
lavinderCommented:
Hi

 To access a printqueue (represents a printer on network), simply use something like this:

 dim objque
 set objque=getobject("WinNT://domain/computer/printername")

 following code determines printer is offline/online

 If objque.status = ADS_PRINTER_OFFLINE Then
   response.write objque.Model & "@" & objque.Location & "is offline."
 Else
   response.write objque.Model & "@" & objque.Location & "is online."
 End If

cheers!!





0
 
apolloisCommented:
What brand/model printer are you using?

HP offers web-based print mgt for most of their recent models.

For viewing the print queue, check this out:

Viewing Print Web Pages
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/graphics/hh/graphics/inetpri_7xrb.asp
0
 
lavinderCommented:
To get info about printjobs
Set pjs = objque.PrintJobs
For each pj in pjs
    response.write pj.TotalPages
    response.write pj.user
Next
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
lavinderCommented:
what a synchronized timing Jim !!
0
 
babyprisAuthor Commented:
How do you modify the status of a particular print job then?
0
 
babyprisAuthor Commented:
How do you modify the status of a particular print job then?
0
 
babyprisAuthor Commented:
I managed to get it to work. Thanks everybody. Now I need to link each job to a record in the database so that i can display a decent list. Is that possible? Assume that my table name = history
0
 
lavinderCommented:
Hi

 It is simple as that, just loop through the jobs and insert a record for each job in the table.

 dim con
 set con=server.createobject("adodb.connection")
 con.open "...."
 Set pjs = objque.PrintJobs
 For each pj in pjs
   con.execute "insert into history(totalpages,user) values(" &  pj.TotalPages & ",'" &  pj.user & "')",,adexecutenorecords
 Next
 con.close
 set con=nothing

 If you want to join the print jobs data with the user details stored in database, you can simply open the recordset, loop through it. For each user, get his/her jobs from objque.printjobs, and display it.

 If you want anything else, please clearly explain it.

happy programming!!
0
 
babyprisAuthor Commented:
The process is like this:
1) Data keyed in
2) User clicks "Commit changes"
3) Changes is stored in database (history table), and appears under 'pending queue' list. ('Pending queue' gets its list from the database, either display them as a single record, or group them based on business rules)
4) When click on an item / group of item in 'pending queue' list, the printer will start printing that item / everything in that group

Do I :
a) when saving to the database, save the whole output and do not send output to printer until inititate by the user? If so, how do i only print 1 field of the table?
b) when saving to the database, send output to printer but pause printing and only resume until initiate by the user (which could be few days / weeks)? if so, how many documents can the printer hold up to? Thousands? hundreds? and is it possible to send an output to the printer and pause printing that output straight away?

Sorry. I'm so blur my explanation may be very confusing, but thanks for reading...
0
 
lavinderCommented:
First of all i would like what application you are developing, please give an overview. If it is a web application, can you give some idea about the database (particularly history table, its fields) and the business relevant information you are trying to implementing.

 Printing will happen on the client's side, so you won't be having any control over it. Pausing printing jobs, umm, i need more information.

 Holding jobs in print queue ? This is not good for the health of server, friend :)


0
 
babyprisAuthor Commented:
I can develop it in anything I want, but I prefer to be a web application for the main section is coded in asp. Database is basically set by me, so I can add or delete new fields in there. Business relevant info? Hmm, it's like a printing program, where the user can choose to view single document or batch file (group by docu category). But those are secondary for I havn't even figure out what exactly I want to do (or can do).

I've wrote something in VB6, and tried to use the same module but that gave me error. Don't think it's possible to use an api in asp...

Ok.. then I'll go with option a. In that case, i'll probably use xml tags to store the info in the document as they are all formated.. The only problem is how do you print one particular field in the database?
0
 
lavinderCommented:
I am unable to understand what type of application you are developing. A VB application is very much different from a web app written in asp, and in your case of printing application, difference widens more. Therefore i would suggest, kindly state the concrete requirements of your application first and designing, only after that work on it.
0
 
apolloisCommented:
babypris,

Has your question been answered?

If so, please select the comment as an answer that was most helpful to you.  In case of duplicate or very similar comments you can select the one posted first.

If not, post what additional help you need to answer your original question.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER!


Best Regards,
>apollois<
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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