?
Solved

manage print queue in asp

Posted on 2003-02-23
13
Medium Priority
?
324 Views
Last Modified: 2008-10-13
I need to print an asp page, and then manage the print queue in asp, including pausing and deleting a particular job....
0
Comment
Question by:babypris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
13 Comments
 
LVL 7

Expert Comment

by:lavinder
ID: 8006660
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
 
LVL 10

Expert Comment

by:apollois
ID: 8006661
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
 
LVL 7

Expert Comment

by:lavinder
ID: 8006665
To get info about printjobs
Set pjs = objque.PrintJobs
For each pj in pjs
    response.write pj.TotalPages
    response.write pj.user
Next
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 7

Expert Comment

by:lavinder
ID: 8006667
what a synchronized timing Jim !!
0
 
LVL 1

Author Comment

by:babypris
ID: 8012541
How do you modify the status of a particular print job then?
0
 
LVL 1

Author Comment

by:babypris
ID: 8012607
How do you modify the status of a particular print job then?
0
 
LVL 1

Author Comment

by:babypris
ID: 8012694
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
 
LVL 7

Accepted Solution

by:
lavinder earned 300 total points
ID: 8014202
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
 
LVL 1

Author Comment

by:babypris
ID: 8014499
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
 
LVL 7

Expert Comment

by:lavinder
ID: 8014910
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
 
LVL 1

Author Comment

by:babypris
ID: 8015110
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
 
LVL 7

Expert Comment

by:lavinder
ID: 8015420
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
 
LVL 10

Expert Comment

by:apollois
ID: 8125727
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

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question