Hot Topic (More than 10 Replies) Can printing be speeded up? (Read 4538 times)
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Can printing be speeded up?
Jun 15th, 2011 at 7:27pm
Print Post Print Post  
I have an invoice form that is printed in batches using Mass Update. The form has about 75 layout elements and is printed using Printstring commands.
Normally, I would be printing about 40 to 80 invoices at a time. I just did a test run of 10 invoices which took 233 seconds to print in Sesame (23 seconds each). The same 10 invoices printed in 50 seconds in Q&A (5 seconds each). Timing was started when the first sheet of paper was picked up by the printer so initial processing was not included in the times.
Are there any things I can do to speed up the print job?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Can printing be speeded up?
Reply #1 - Jun 15th, 2011 at 8:14pm
Print Post Print Post  
Well...Q&A DOS is sending ASCII to the printer. We are assembling pixels into a page image, so it's unlikely to be as fast as DOS. That said, there are probably ways to speed up what you are doing. Can we see the code, please?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #2 - Jun 15th, 2011 at 8:18pm
Print Post Print Post  
Here it is. It prints to a pre-printed form.

NewPage(850, 1100)
Printstring(@AsFormattedByLE(Invoice_No,0,Invoice_No), 725, 75, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Inv_Date,0,Inv_Date), 725, 125, 0, "Arial", 14, 0)

Printstring(@AsFormattedByLE(Customer1,0,Customer1), 50, 150, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Customer2,0,Customer2), 380, 150, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Street1,0,Street1), 50, 165, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Street,0,Street), 380, 165, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Street2,0,Street2), 50, 180, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(City,0,City), 50, 195, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Prov,0,Prov), 225, 195, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Post,0,Post), 260, 195, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Prov1,0,Prov1), 500, 180, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(City1,0,City1), 380, 180, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Post1,0,Post1), 550, 180, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(PO_#,0,PO_#), 50, 290, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Cust_No,0,Cust_No), 290, 290, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(DR_#,0,DR_#), 450, 290, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Terms,0,Terms), 700, 290, 0, "Arial", 14, 0)

Printstring(@AsFormattedByLE(Qty1,0,Qty1), 30, 350, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Desc1,0,Desc1), 75, 350, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Code1,0,Code1), 560, 350, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit1, 0, Unit1), 615, 350, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount1,0,Amount1), 725, 350, 75, "Arial", 14, 0, PRINTSTRING_ALIGN_RIGHT)

If Qty2 > 0
{
Printstring(@AsFormattedByLE(Qty2,0,Qty2), 30, 375, 0, "Arial", 14, 0)
}
If Desc2 > 0
{
Printstring(@AsFormattedByLE(Desc2,0,Desc2), 75, 375, 0, "Arial", 14, 0)
}
If Qty2 > 0
{
Printstring(@AsFormattedByLE(Code2,0,Code2), 560, 375, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit2, 0, Unit2), 615, 375, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount2,0,Amount2), 725, 375, 75, "Arial", 14, 0, Printstring_Align_Right)
}

If Qty3 > 0
{
Printstring(@AsFormattedByLE(Qty3,0,Qty3), 30, 400, 0, "Arial", 14, 0)
}
If Desc3 > 0
{
Printstring(@AsFormattedByLE(Desc3,0,Desc3), 75, 400, 0, "Arial", 14, 0)
}
If Qty3 > 0
{
Printstring(@AsFormattedByLE(Code3,0,Code3), 560, 400, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit3, 0, Unit3), 615, 400, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount3, 0, Amount3), 725, 400, 75, "Arial", 14, 0, Printstring_Align_Right)
}

If Qty4 > 0
{
Printstring(@AsFormattedByLE(Qty4,0,Qty4), 30, 425, 0, "Arial", 14, 0)
}
If Desc4 > 0
{
Printstring(@AsFormattedByLE(Desc4,0,Desc4), 75, 425, 0, "Arial", 14, 0)
}
If Qty4 > 0
{
Printstring(@AsFormattedByLE(Code4,0,Code4), 560, 425, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit4, 0, Unit4), 615, 425, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount4, 0, Amount4), 725, 425, 75, "Arial", 14, 0, Printstring_Align_Right)
}

If Qty5 > 0
{
Printstring(@AsFormattedByLE(Qty5,0,Qty5), 30, 450, 0, "Arial", 14, 0)
}
If Desc5 > 0
{
Printstring(@AsFormattedByLE(Desc5,0,Desc5), 75, 450, 0, "Arial", 14, 0)
}
If Qty5 > 0
{
Printstring(@AsFormattedByLE(Code5,0,Code5), 560, 450, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit5, 0, Unit5), 615, 450, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount5, 0, Amount5), 725, 450, 75, "Arial", 14, 0, Printstring_Align_Right)
}

If Qty6 > 0
{
Printstring(@AsFormattedByLE(Qty6,0,Qty6), 30, 475, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Desc6,0,Desc6), 75, 475, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Code6,0,Code6), 560, 475, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit6, 0, Unit6), 615, 475, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount6, 0, Amount6), 725, 475, 75, "Arial", 14, 0, Printstring_Align_Right)
}

If Qty7 > 0
{
Printstring(@AsFormattedByLE(Qty7,0,Qty7), 30, 500, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Desc7,0,Desc7), 75, 500, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Code7,0,Code7), 560, 500, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit7, 0, Unit7), 615, 500, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount7, 0, Amount7), 725, 500, 75, "Arial", 14, 0, Printstring_Align_Right)
}

If Qty8 > 0
{
Printstring(@AsFormattedByLE(Qty8,0,Qty8), 30, 525, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Desc8,0,Desc8), 75, 525, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Code8,0,Code8), 560, 525, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit8, 0, Unit8), 615, 525, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount8, 0, Amount8), 725, 525, 75, "Arial", 14, 0, Printstring_Align_Right)
}

If Qty9 > 0
{
Printstring(@AsFormattedByLE(Qty9,0,Qty9), 30, 550, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Desc9,0,Desc9), 75, 550, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Code9,0,Code9), 560, 550, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Unit9, 0, Unit9), 615, 550, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Amount9, 0, Amount9), 725, 550, 75, "Arial", 14, 0, Printstring_Align_Right)
}

// Printstring(@AsFormattedByLE(Note1,0,Note1), 50, 815, 0, "Arial", 14, 0)
// Printstring(@AsFormattedByLE(Note2,0,Note2), 50, 840, 0, "Arial", 14, 0)
// Printstring(@AsFormattedByLE(Note3,0,Note3), 50, 865, 0, "Arial", 14, 0)
// Printstring(@AsFormattedByLE(Note4,0,Note4), 50, 890, 0, "Arial", 14, 0)

Printstring(@AsFormattedByLE(Total1, 0, Total1), 725, 815, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(THST, 0, THST), 725, 860, 75, "Arial", 14, 0, Printstring_Align_Right)
Printstring(@AsFormattedByLE(Total, 0, Total), 725, 975, 75, "Arial", 14, 0, Printstring_Align_Right)

If Paid_By > 0
{
Printstring(@AsFormattedByLE(Date_Paid, 0, Date_Paid), 65, 915, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Paid_By,0,Paid_By), 200,915, 0, "Arial", 14, 0)
Printstring(@AsFormattedByLE(Amount_Paid, 0, Amount_Paid), 250, 915, 75, "Arial", 14, 0)
}



FinishPage()
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Can printing be speeded up?
Reply #3 - Jun 15th, 2011 at 8:33pm
Print Post Print Post  
Something's wonky here, magicfish. When I run your code in a mass update, it takes a few seconds per page to print. Can you send in your database?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #4 - Jun 15th, 2011 at 8:37pm
Print Post Print Post  
OK, how do I attach a file? Or should I email it? To whom?
  
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Can printing be speeded up?
Reply #5 - Jun 15th, 2011 at 11:49pm
Print Post Print Post  
What make, model and revision is the printer, how much RAM does it have, and is it networked or local?
  
Back to top
 
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #6 - Jun 16th, 2011 at 12:27pm
Print Post Print Post  
It is an HP Officejet 6500A Plus, networked.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Can printing be speeded up?
Reply #7 - Jun 16th, 2011 at 1:04pm
Print Post Print Post  
You can email files to support@lantica.com.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Can printing be speeded up?
Reply #8 - Jun 16th, 2011 at 8:53pm
Print Post Print Post  
I just ran this with your database files that you sent in. I printed five invoices. It was about 35 seconds from when the first page was picked up to when the last page completed - about 7 seconds per invoice. I'm printing to a networked HP LJ2100.

I'm afraid that it appears that whatever is going on is going on with your OS and/or network.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #9 - Jun 17th, 2011 at 1:47pm
Print Post Print Post  
That actually gives me some hope. Seven seconds per page would be fine. I just have to find out where the slowdown is.  Lips Sealed
Thanks for trying that.
Glenn
  
Back to top
 
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #10 - Jun 17th, 2011 at 8:37pm
Print Post Print Post  
Quick update.
I just tried this printer on a USB connection and I got 42 seconds for 5 forms, 8.5 seconds each. This includes a "long" delay between each page. Perhaps some tweaking can reduce this. I hooked it back up to the network and printing went back to about 23 seconds per page.

The ironic thing is, I put this printer on the network because Q&A could not talk to a USB printer.

Going to play with it some more and see if I can get that delay out of there.
  
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Can printing be speeded up?
Reply #11 - Jun 18th, 2011 at 2:20am
Print Post Print Post  
"The ironic thing is, I put this printer on the network because Q&A could not talk to a USB printer. "

Not completely true.  There are tricks.  We have used QA to print to a USB printer from XP.

Here is how to set Q&A to print to a local USB printer in XP:

1. Set up the printer as a shared printer under Windows.
2. Open a DOS command prompt for the following:
3. Type: Set
    Note USERDOMAIN.  That is the name of your computer. It is listed below as YOUR_COMPUTER
4. Type: net share
    A list will be displayed showing: Share name   Resource   Remark
    The USB printer will appear as Resource USB001 (or similar)
    The printer name in Windows will be in Remark
    You need to use the Share Name, which will not have spaces. It is listed below as SHARED_NAME
5.  Type: net use LPT3: \\YOURCOMPUTER\SHARED_NAME /persistent:yes
     (not case sensitive) After 3-5 seconds you should get a message that the command completed successfully.

This reroutes all calls to LPT3 to the "shared" printer.  In QA, just set LPT3 as your printer.


Note that this will not work in Vista/Win 7 (or Win 7 XP Mode).  Vista/Win 7 have much better security than pre-Vista.  Obviously, "sharing" a local printer with yourself is a hacker trick and theoretically there should never be a valid reason to do it.  Vista/Win 7's better security doesn't allow that.

However, if the printer is a network printer, it can still be used.  Buy a 5-port hub for about $10 and use that to connect your PC and the printer to the network.  (You can have the same printer set up as both an Ethernet and a local USB printer for your PC.) It may work faster if the network printer is set up as being "owned" by its local printer and shared from there or it may work faster if it is set up as "owned" by the server.
  
Back to top
 
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #12 - Jun 20th, 2011 at 7:48pm
Print Post Print Post  
Rick,
I already had Net Use LPT3 \\Glennw\HPOffice /Persistent:yes in a batch file to load Q&A, but after your comment I thought I would try Q&A and USB again. No go! I just couldn't get Q&A to print to a USB port. I even had trouble for a while when I tried to set it back to the ethernet printer, but I finally got it going again.
I suppose I can live with the 9 second page print in Sesame to the USB printer but there is about a 4 or 5 second pause between each page I want to try to get rid of. That would get it down to the 4 or 5 seconds that Q&A prints. So far, none of my adjustments have worked.
Glenn
  
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Can printing be speeded up?
Reply #13 - Jun 20th, 2011 at 9:52pm
Print Post Print Post  
Are you running under XP or Win 7?  It just doesn't work with Win 7 (I spent an entire day trying ...) but it definitely does work from XP.  We've done it with several different brands of printers.
  
Back to top
 
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #14 - Jun 21st, 2011 at 12:23pm
Print Post Print Post  
Using XP, service pack 3.
I'll try it again today. I'll play around with renaming the eth printer and naming the USB printer to what the eth one was. I don't want to delete the eth printer in order to try the USB but I may have to, to try to force it to use the USB printer.
Now, when I run the .bat file which includes the Net Use statement to load Q&A, I get this message: System error 85 has occurred. The local device name is already in use. I thought that would prevent Q&A from printing, but I was able to do a test print this morning after that message.
  
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Can printing be speeded up?
Reply #15 - Jun 21st, 2011 at 2:22pm
Print Post Print Post  
The reason for the error is you are using /Persistent:yes

That should be run once from the command line.  If you are putting it in a batch file, which I don't recommend, it should be /Persistent:no

For instance, we have a server running XP, with about 8 regular users and 15 machines.  XP can handle a maximum of around 10 machines accessing it. To access QA, my machine is set up with a batch file that maps a network drive, runs QA and then unmaps the drive.  But the batch file doesn't set up the printer (which, in my case, is a network printer).
  
Back to top
 
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #16 - Jun 21st, 2011 at 7:15pm
Print Post Print Post  
I get the same error message if I set it to Persistent:no.
I probably always got that message, but I didn't see it until I put a Pause in the bat file.
I got Q&A to print to the USB printer! I had to change the share name for the eth printer first, then change the share name of the USB printer to what the eth name had been. I had a little trouble printing to it from Sesame so I hooked it back up to the eth and I had change the share names back again and I still had to reboot before it would print to the eth again. I'll leave it like this for now until I can get a long enough USB cable to have both connected simultaneously. Then I will work on tweaking it. At least now I know it can be done.
  
Back to top
 
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Can printing be speeded up?
Reply #17 - Jun 21st, 2011 at 9:41pm
Print Post Print Post  
Just in case someone only reads the end of this thread ...

It isn't possible to print to a USB printer from QA under Win 7, whether directly or in XP Mode.  If the USB printer also has an Ethernet port, it can be set up as a network printer and accessed that way from QA but used directly as a USB printer from other programs.
  
Back to top
 
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: Can printing be speeded up?
Reply #18 - Jul 5th, 2011 at 2:42pm
Print Post Print Post  
fwiw, one of our attached network printers is an HP OfficeJet 6300 all-in-one, and our accounting software takes FOREVER to print to it if the file is large (about 20 times as long to print to that printer versus a very old HP Series II laser printer that is also attached to a pocket print server).  I'm testing 'today' if changing that printer will speed up my posting times on customers with large amounts of data.  Will report on results.

Update:  the 'slow' issue had nothing to do with software or OS or printers.  It was a network cable gone bad.
« Last Edit: Jul 5th, 2011 at 10:58pm by lksseven »  

Larry
Back to top
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #19 - Jul 5th, 2011 at 3:16pm
Print Post Print Post  
I'm using the USB connection exclusively now as I am now completely weaned off Q&A. Printing from all other applications is much better now that I am not using the ethernet connection.
The only speed issue I have now is that when printing invoices from Sesame, it prints an invoice in about 4 seconds, pauses 4 or 5 seconds, prints an invoice in 4 seconds, pauses again for 4 or 5 seconds, etc. I haven't had the time to figure out how to fix this.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Can printing be speeded up?
Reply #20 - Jul 5th, 2011 at 4:26pm
Print Post Print Post  
Hello magicfish,

One thing you can try is the SBasic commands NewDocument() and FinishDocument() so that the invoices are sent to the Printer as one 50 page document rather than 50 one page documents.

In GlobalCode add

Code
Select All
NewDocument(1) 



Then at the very bottom of your printing code add the following

Code
Select All
If @ResultSetTotal() = @ResultSetCurrentPosition() Then
{
	FinishDocument()
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
magicfish
Member
*
Offline



Posts: 47
Joined: Mar 18th, 2011
Re: Can printing be speeded up?
Reply #21 - Jul 5th, 2011 at 8:10pm
Print Post Print Post  
Ray,
That did it. Works like a charm!  Smiley
Thanks
  
Back to top
 
IP Logged