That's handy!
Thx Karen.
-----Original Message-----
From: karentellef via RBASE-L <rbase-l@googlegroups.com>
To: rbase-l@googlegroups.com
Date: Wed, 14 Jun 2017 15:43:35 -0400
Subject: Re: [RBASE-L] - Strange printing problem

Jim:  I saved this syntax to send PDFs to the printer, so you could form 
them first and then send.  The problem with this is that you would need to 
know the location of Adobe


LAUNCH 'C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe|/p /h 
C:\Cust.pdf'
Karen


-----Original Message-----
From: Javier Valencia <javier.valen...@vtgonline.com>
To: rbase-l <rbase-l@googlegroups.com>
Sent: Wed, Jun 14, 2017 2:32 pm
Subject: RE: [RBASE-L] - Strange printing problem


#AOLMsgPart_1.2_75f0bb8a-9478-4b77-99ac-138bb4c0f1b1 td{color: black;} 
@font-face {font-family:Helvetica; panose-1:2 11 6 4 2 2 2 2 2 4; 
mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; 
mso-font-signature:-536859905 -1073711037 9 0 511 0;}@font-face 
{font-family:Helvetica; panose-1:2 11 6 4 2 2 2 2 2 4; mso-font-charset:0; 
mso-generic-font-family:swiss; mso-font-pitch:variable; 
mso-font-signature:-536859905 -1073711037 9 0 511 0;}@font-face 
{font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; 
mso-generic-font-family:swiss; mso-font-pitch:variable; 
mso-font-signature:-536870145 1073786111 1 0 415 0;}@font-face 
{font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; 
mso-generic-font-family:swiss; mso-font-pitch:variable; 
mso-font-signature:-520081665 -1073717157 41 0 66047 0;}@font-face 
{font-family:"Lucida Console"; panose-1:2 11 6 9 4 5 4 2 2 4; 
mso-font-charset:0; mso-generic-font-family:modern; mso-font-pitch:fixed; 
mso-font-signature:-2147482993 6144 0 0 31 0;}.aolReplacedBody 
p.aolmail_MsoNormal,.aolReplacedBody  li.aolmail_MsoNormal,.aolReplacedBody  
div.aolmail_MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; 
mso-style-parent:""; margin:0in; margin-bottom:.0001pt; 
mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New 
Roman","serif"; mso-fareast-font-family:Calibri;}.aolReplacedBody 
a:link,.aolReplacedBody  span.aolmail_MsoHyperlink {mso-style-priority:99; 
color:blue; text-decoration:underline; 
text-underline:single;}.aolReplacedBody a:visited,.aolReplacedBody  
span.aolmail_MsoHyperlinkFollowed {mso-style-noshow:yes; 
mso-style-priority:99; color:purple; text-decoration:underline; 
text-underline:single;}.aolReplacedBody p {mso-style-noshow:yes; 
mso-style-priority:99; mso-margin-top-alt:auto; margin-right:0in; 
mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; 
font-size:12.0pt; font-family:"Times New Roman","serif"; 
mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_MsoAcetate,.aolReplacedBody  
li.aolmail_MsoAcetate,.aolReplacedBody  div.aolmail_MsoAcetate 
{mso-style-noshow:yes; mso-style-priority:99; mso-style-link:"Balloon Text 
Char"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; 
font-size:8.0pt; font-family:"Tahoma","sans-serif"; 
mso-fareast-font-family:Calibri;}.aolReplacedBody 
span.aolmail_BalloonTextChar {mso-style-name:"Balloon Text Char"; 
mso-style-noshow:yes; mso-style-priority:99; mso-style-unhide:no; 
mso-style-locked:yes; mso-style-link:"Balloon Text"; 
font-family:"Tahoma","sans-serif"; mso-ascii-font-family:Tahoma; 
mso-hansi-font-family:Tahoma; mso-bidi-font-family:Tahoma;}.aolReplacedBody 
p.aolmail_yiv6072838519msoacetate,.aolReplacedBody  
li.aolmail_yiv6072838519msoacetate,.aolReplacedBody  
div.aolmail_yiv6072838519msoacetate {mso-style-name:yiv6072838519msoacetate; 
mso-style-priority:99; mso-style-unhide:no; mso-margin-top-alt:auto; 
margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; 
mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New 
Roman","serif"; mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_yiv6072838519msonormal0,.aolReplacedBody  
li.aolmail_yiv6072838519msonormal0,.aolReplacedBody  
div.aolmail_yiv6072838519msonormal0 {mso-style-name:yiv6072838519msonormal0; 
mso-style-priority:99; mso-style-unhide:no; mso-margin-top-alt:auto; 
margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; 
mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New 
Roman","serif"; mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_yiv6072838519msonormal,.aolReplacedBody  
li.aolmail_yiv6072838519msonormal,.aolReplacedBody  
div.aolmail_yiv6072838519msonormal {mso-style-name:yiv6072838519msonormal; 
mso-style-priority:99; mso-style-unhide:no; mso-margin-top-alt:auto; 
margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; 
mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New 
Roman","serif"; mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_yiv6072838519msochpdefault,.aolReplacedBody  
li.aolmail_yiv6072838519msochpdefault,.aolReplacedBody  
div.aolmail_yiv6072838519msochpdefault 
{mso-style-name:yiv6072838519msochpdefault; mso-style-priority:99; 
mso-style-unhide:no; mso-margin-top-alt:auto; margin-right:0in; 
mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; 
font-size:12.0pt; font-family:"Times New Roman","serif"; 
mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_yiv6072838519msonormal1,.aolReplacedBody  
li.aolmail_yiv6072838519msonormal1,.aolReplacedBody  
div.aolmail_yiv6072838519msonormal1 {mso-style-name:yiv6072838519msonormal1; 
mso-style-priority:99; mso-style-unhide:no; margin:0in; 
margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; 
font-family:"Times New Roman","serif"; 
mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_yiv6072838519msoacetate1,.aolReplacedBody  
li.aolmail_yiv6072838519msoacetate1,.aolReplacedBody  
div.aolmail_yiv6072838519msoacetate1 
{mso-style-name:yiv6072838519msoacetate1; mso-style-priority:99; 
mso-style-unhide:no; margin:0in; margin-bottom:.0001pt; 
mso-pagination:widow-orphan; font-size:8.0pt; font-family:"Times New 
Roman","serif"; mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_yiv6072838519msonormal01,.aolReplacedBody  
li.aolmail_yiv6072838519msonormal01,.aolReplacedBody  
div.aolmail_yiv6072838519msonormal01 
{mso-style-name:yiv6072838519msonormal01; mso-style-priority:99; 
mso-style-unhide:no; mso-margin-top-alt:auto; margin-right:0in; 
mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; 
font-size:11.0pt; font-family:"Times New Roman","serif"; 
mso-fareast-font-family:Calibri;}.aolReplacedBody 
p.aolmail_yiv6072838519msochpdefault1,.aolReplacedBody  
li.aolmail_yiv6072838519msochpdefault1,.aolReplacedBody  
div.aolmail_yiv6072838519msochpdefault1 
{mso-style-name:yiv6072838519msochpdefault1; mso-style-priority:99; 
mso-style-unhide:no; mso-margin-top-alt:auto; margin-right:0in; 
mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; 
font-size:10.0pt; font-family:"Times New Roman","serif"; 
mso-fareast-font-family:Calibri;}.aolReplacedBody 
span.aolmail_yiv6072838519msohyperlink 
{mso-style-name:yiv6072838519msohyperlink; 
mso-style-unhide:no;}.aolReplacedBody 
span.aolmail_yiv6072838519msohyperlinkfollowed 
{mso-style-name:yiv6072838519msohyperlinkfollowed; 
mso-style-unhide:no;}.aolReplacedBody span.aolmail_yiv6072838519emailstyle20 
{mso-style-name:yiv6072838519emailstyle20; 
mso-style-unhide:no;}.aolReplacedBody span.aolmail_yiv6072838519emailstyle22 
{mso-style-name:yiv6072838519emailstyle22; 
mso-style-unhide:no;}.aolReplacedBody 
span.aolmail_yiv6072838519msohyperlink1 
{mso-style-name:yiv6072838519msohyperlink1; mso-style-unhide:no; color:blue; 
text-decoration:underline; text-underline:single;}.aolReplacedBody 
span.aolmail_yiv6072838519msohyperlinkfollowed1 
{mso-style-name:yiv6072838519msohyperlinkfollowed1; mso-style-unhide:no; 
color:purple; text-decoration:underline; 
text-underline:single;}.aolReplacedBody 
span.aolmail_yiv6072838519emailstyle201 
{mso-style-name:yiv6072838519emailstyle201; mso-style-unhide:no; 
color:windowtext;}.aolReplacedBody span.aolmail_yiv6072838519emailstyle221 
{mso-style-name:yiv6072838519emailstyle221; mso-style-unhide:no; 
color:windowtext;}.aolReplacedBody span.aolmail_EmailStyle36 
{mso-style-type:personal; mso-style-noshow:yes; mso-style-unhide:no; 
font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; 
mso-hansi-font-family:Calibri; color:#1F497D;}.aolReplacedBody 
span.aolmail_EmailStyle37 {mso-style-type:personal; mso-style-noshow:yes; 
mso-style-unhide:no; font-family:"Calibri","sans-serif"; 
mso-ascii-font-family:Calibri; mso-hansi-font-family:Calibri; 
color:#1F497D;}.aolReplacedBody span.aolmail_EmailStyle38 
{mso-style-type:personal; mso-style-noshow:yes; mso-style-unhide:no; 
font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; 
mso-hansi-font-family:Calibri; color:#1F497D;}.aolReplacedBody 
span.aolmail_EmailStyle39 {mso-style-type:personal-reply; 
mso-style-noshow:yes; mso-style-unhide:no; mso-ansi-font-size:11.0pt; 
mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; 
mso-ascii-font-family:Calibri; mso-fareast-font-family:Calibri; 
mso-hansi-font-family:Calibri; mso-bidi-font-family:"Times New Roman"; 
color:#1F497D;}.aolReplacedBody span.aolmail_SpellE {mso-style-name:""; 
mso-spl-e:yes;}.aolReplacedBody .aolmail_MsoChpDefault 
{mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; 
mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;}@page WordSection1 
{size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; 
mso-footer-margin:.5in; mso-paper-source:0;}.aolReplacedBody 
div.aolmail_WordSection1 {page:WordSection1;}
Jim,

If you are sending files directly to the printer, you have to consider the 
interaction between the program generating the file and the spooler; 
however, if the PDF file or files is or are created first and then you want 
to print hard copies (or e-mail them) then the Windows printer spooler (or 
e-mail application spooler) takes over it and you don’t have to worry 
about conflicts. In any case, you generate the file just once and then you 
use it or re-use it as needed. Makes sense?

Javier,

Javier Valencia, PE
14315 S. Twilight Ln.
Olathe, KS 66062
Home: 913-397-9605
Office: 913-829-0888
Cell: 913-915-3137

From:rbase-l@googlegroups.com [mailto:l...@googlegroups.com] 
[mailto:rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com?]] On 
Behalf OfJim Belisle
Sent: Tuesday, June 13, 2017 7:06 PM
To: rbase-l@googlegroups.com [mailto:l...@googlegroups.com]
Subject: RE: [RBASE-L] - Strange printing problem

I am trying to implement the some of the suggestions from the list to care 
for this problem that popped up again.
I am looking at your suggestion and you say, “An option would be to create 
the PDF file first and then print it (let Windows worry about it), this way 
you generate the report only once”
What do you mean “let Windows worry about it”?
Are you suggesting that I print all the pdf files in the loop then outside 
the loop print the pdf files?

This code creates the pdf, then prints them for a physical copy, Code not 
shown then emails the pdfs to specific customers.
In your suggestion, how or when would I print the PDFs. My code at present 
sets OPEN OFF (for the pdfs).

James Belisle

Making Information Systems People Friendly Since 1990

From:rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com] 
[mailto:rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]] On 
Behalf OfJavier Valencia
Sent: Wednesday, May 17, 2017 12:15 PM
To: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]
Subject: RE: [RBASE-L] - Strange printing problem

Jim,

In addition to the other suggestions you might also look at the disk and see 
if it getting too full or the specific directory has too many files. I seem 
to recall that when you have too many files in one directory problems like 
this happen. I have an application that stores PDF files and we create 
subdirectories on the fly with the year as the name to limit the number of 
PDF files stored. You can probably create year-month subdirectories as 
needed.
Also, I see that you generate the report twice, once to print and once to 
store as a PDF file. If the reports are long and complicated it could take a 
long time and hold up the spooler. An option would be to create the PDF file 
first and then print it (let Windows worry about it), this way you generate 
the report only once and it might be easier on the temporary 
resources/memory use by the application.

Javier,

Javier Valencia, PE
O: 913-829-0888
H: 913-397-9605
C: 913-915-3137

From:rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com] 
[mailto:rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]] On 
Behalf OfJim Belisle
Sent: Wednesday, May 17, 2017 11:04 AM
To: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]
Subject: RE: [RBASE-L] - Strange printing problem

Thanks for the suggestions.
We seldom have more than 75 invoices so I doubt that s a problem.
I do have the variables created outside the loop.
Creating the cursor on both Control# and the Invoice# I have not done so 
that may be a start.

James Belisle

Making Information Systems People Friendly Since 1990

From:'James Bentley' via RBASE-L [mailto:rbase-l@googlegroups.com 
[mailto:rbase-l@googlegroups.com]]
Sent: Wednesday, May 17, 2017 10:45 AM
To: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]
Subject: Re: [RBASE-L] - Strange printing problem

Jim,
The following statement from your code may be in error
"  |AUTHORIZATION Accounts Receivable +"
Should it be " |AUTHOR Accounts Receivable +"

Also, expanding on Buddy's suggestion you should consider incorporating
creating the pdf file name as part of the DECLARE CURSOR statement

DECLARE c1 CURSOR FOR SELECT 
control#,invoice#,('PDFinvcust\'+invoice#+'.PDF') +
FROM tinvcust ORDER BY control#

FETCH c1 INTO vord INDICATOR ivord,vinv INDICATOR ivinv,vfilenameINDICATOR 
ivFN

remove Following statement from WHILE loop:
" SET VAR vfilename = ('PDFinvcust\'+.vinv+'.PDF')"

I am assuming the column "invoice#" is a TEXT value.
Buddy assumed it was an INTEGER.

Make sure that all variables are defined before the WHILE loop
including the indicator variables.

This should speed up the loop. The loop could be further optimized
by precalculating the number of rows in the table and using the count to
build the loop
Jim Bentley, American Celiac Society 1-504-305-2968

From:Buddy Walker <walker.bu...@comcast.net 
[mailto:walker.bu...@comcast.net]>
To: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]
Sent: Wednesday, May 17, 2017 9:13 AM
Subject: RE: [RBASE-L] - Strange printing problem
Jim
Your code looks ok but I would suggest getting the invoice# at the same time 
you are getting the control#. This would save a hit on the table. See below 
in red
Make sure your variables are defined before the while loop
Buddy

SET VAR vinv INTEGER
SET VAR vord INTEGER

DECLARE c1 CURSOR FOR SELECT control#,invoice# FROM tinvcust ORDER BY 
control#
OPEN c1
FETCH c1 INTO vord INDICATOR ivord,vinv INDICATOR ivinv
WHILE SQLCODE <> 100 THEN
--SET VAR vinv = invoice# FROM tinvcust WHERE control# = .vord
SET VAR vfilename = ('PDFinvcust\'+.vinv+'.PDF')
PRINT kayparkinvtemp WHERE control# = .vord OPTION PRINTER
PRINT kayparkinvtemp WHERE control# = .vord +
OPTION PDF +
|FILENAME &vFileName +
|TITLE Kay Park Recreation +
|SUBJECT Invoice +
|AUTHORIZATION Accounts Receivable +
|OPEN OFF
CLS
FETCH c1 INTO vord INDICATOR ivord,vinv INDICATOR ivinv
ENDWHILE
DROP CURSOR c1



From:rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com] 
[mailto:rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]] On 
Behalf OfJim Belisle
Sent: Wednesday, May 17, 2017 9:33 AM
To: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com]
Subject: [RBASE-L] - Strange printing problem

We have been using the same code within RBASE 9.5 to print our invoices to a 
printer and create a PDF for almost two years now.
Starting yesterday, while trying to print the invoices (both a report and a 
PDF), printing starts then after printing three invoices, the RBASE session 
completely shuts down.
No ERROR codes show. RBASE completely shuts down.

Last night I did a reload. The user did a test run this morning having the 
same result.
I decided to run the code outside of the application in the TRACE mode and 
everything printed fine and the PDFs were created. RBASE did not shut down.

Does anyone have any “Blues Clues”?
Below is the code I use in a cursor.

SET ERROR MESSAGE 705 OFF
DROP CURSOR c1
SET ERROR MESSAGE 705 ON
DECLARE c1 CURSOR FOR SELECT control# FROM tinvcust ORDER BY control#
OPEN c1
FETCH c1 INTO vord INDICATOR ivord
WHILE SQLCODE <> 100 THEN
SET VAR vinv = invoice# FROM tinvcust WHERE control# = .vord
SET VAR vfilename = ('PDFinvcust\'+.vinv+'.PDF')
PRINT kayparkinvtemp WHERE control# = .vord OPTION PRINTER
PRINT kayparkinvtemp WHERE control# = .vord +
OPTION PDF +
|FILENAME &vFileName +
|TITLE Kay Park Recreation +
|SUBJECT Invoice +
|AUTHORIZATION Accounts Receivable +
|OPEN OFF
CLS
FETCH c1 INTO vord INDICATOR ivord
ENDWHILE
DROP CURSOR c1



James Belisle

Making Information Systems People Friendly Since 1990


--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to rbase-l+unsubscr...@googlegroups.com 
[mailto:rbase-l+unsubscr...@googlegroups.com].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to rbase-l+unsubscr...@googlegroups.com 
[mailto:rbase-l+unsubscr...@googlegroups.com].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to rbase-l+unsubscr...@googlegroups.com 
[mailto:rbase-l+unsubscr...@googlegroups.com].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to rbase-l+unsubscr...@googlegroups.com 
[mailto:rbase-l+unsubscr...@googlegroups.com].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].
--
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to rbase-l+unsubscr...@googlegroups.com 
[mailto:rbase-l+unsubscr...@googlegroups.com].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].
 --
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to rbase-l+unsubscr...@googlegroups.com 
[mailto:rbase-l+unsubscr...@googlegroups.com].
For more options, visit https://groups.google.com/d/optout 
[https://groups.google.com/d/optout].

-- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to