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 incorporatingcreating 
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, vfilename INDICATOR 
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 loopincluding the 
indicator variables.
This should speed up the loop. The loop could be further optimizedby 
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 <[email protected]>
 To: [email protected] 
 Sent: Wednesday, May 17, 2017 9:13 AM
 Subject: RE: [RBASE-L] - Strange printing problem
   
#yiv6072838519 #yiv6072838519 -- _filtered #yiv6072838519 {panose-1:2 4 5 3 5 4 
6 3 2 4;} _filtered #yiv6072838519 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 
3 2 4;} _filtered #yiv6072838519 {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 
2 4;}#yiv6072838519 #yiv6072838519 p.yiv6072838519MsoNormal, #yiv6072838519 
li.yiv6072838519MsoNormal, #yiv6072838519 div.yiv6072838519MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv6072838519 a:link, 
#yiv6072838519 span.yiv6072838519MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv6072838519 a:visited, #yiv6072838519 
span.yiv6072838519MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv6072838519 
p.yiv6072838519MsoAcetate, #yiv6072838519 li.yiv6072838519MsoAcetate, 
#yiv6072838519 div.yiv6072838519MsoAcetate 
{margin:0in;margin-bottom:.0001pt;font-size:8.0pt;}#yiv6072838519 
p.yiv6072838519msonormal0, #yiv6072838519 li.yiv6072838519msonormal0, 
#yiv6072838519 div.yiv6072838519msonormal0 
{margin-right:0in;margin-left:0in;font-size:11.0pt;}#yiv6072838519 
span.yiv6072838519BalloonTextChar {}#yiv6072838519 
span.yiv6072838519EmailStyle20 {color:windowtext;}#yiv6072838519 
span.yiv6072838519EmailStyle22 {color:windowtext;}#yiv6072838519 
.yiv6072838519MsoChpDefault {font-size:10.0pt;} _filtered #yiv6072838519 
{margin:1.0in 1.0in 1.0in 1.0in;}#yiv6072838519 div.yiv6072838519WordSection1 
{}#yiv6072838519 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 loopBuddy  SET VAR vinv INTEGERSET VAR vord INTEGER  DECLARE c1 CURSOR 
FOR SELECT control#,invoice# FROM tinvcust ORDER BY control#OPEN c1FETCH c1 
INTO vord INDICATOR ivord,vinv INDICATOR ivinvWHILE 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 ivinvENDWHILEDROP CURSOR c1      From: 
[email protected] [mailto:[email protected]] On Behalf Of Jim 
Belisle
Sent: Wednesday, May 17, 2017 9:33 AM
To: [email protected]
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 OFFDROP CURSOR c1SET ERROR MESSAGE 705 ONDECLARE 
c1 CURSOR FOR SELECT control# FROM tinvcust ORDER BY control#OPEN c1FETCH c1 
INTO vord INDICATOR ivordWHILE 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 ivordENDWHILEDROP 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 [email protected].
For more options, visit 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 [email protected].
For more options, visit 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to