Maybe it dies if it tries to overwrite one with the same name? I have thousands in a folder without an issue so far. I am using version 10 now.
Dan Goldberg From: [email protected] [mailto:[email protected]] On Behalf Of Jim Belisle Sent: Wednesday, May 17, 2017 10:26 AM To: [email protected] Subject: RE: [RBASE-L] - Strange printing problem Javier, Our folder has many pdf files and I was thinking that possibly could be a problem. If I went to sub directories, I will need to change the lookup code based on year which should not be a problem. All these suggestions are worth looking including the “From the edge document” I just downloaded. Us so-called "R:BASE developers" need all the help we can get. James Belisle Making Information Systems People Friendly Since 1990 [cid:[email protected]] From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Javier Valencia Sent: Wednesday, May 17, 2017 12:15 PM To: [email protected]<mailto:[email protected]> 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: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Jim Belisle Sent: Wednesday, May 17, 2017 11:04 AM To: [email protected]<mailto:[email protected]> 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 [cid:[email protected]] From: 'James Bentley' via RBASE-L [mailto:[email protected]] Sent: Wednesday, May 17, 2017 10:45 AM To: [email protected]<mailto:[email protected]> 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, 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 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 <[email protected]<mailto:[email protected]>> To: [email protected]<mailto:[email protected]> 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: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Jim Belisle Sent: Wednesday, May 17, 2017 9:33 AM To: [email protected]<mailto:[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 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 [cid:[email protected]] -- 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]<mailto:[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]<mailto:[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]<mailto:[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]<mailto:[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.

