User login

Who's online

There are currently 0 users and 98 guests online.

SourceForge.net Logo

VB program - only first file created

Submitted by cshart on Thu, 2008-04-10 15:31.

I have a vb program that creates multiple pdf files from crystal reports. The first print goes correctly and the output is in the specified directory. However the second pdf file never gets created. The program hangs waiting for it to be created. If I look in the temp\PDFCreatore\PDFCreatorSpool directory I see the temp spool file. If I stop the Vb pgm and then start->pgm->PDFCreator, the file will momentarily appear in the list and then go away, and it will no longer be in the PDFCreatorSpool directory. However it does not go to the output directory specified. This is VB6 on Win-XP
Any help on this appreciated.

With PDFCreator1
.cVisible = True
.cStart "/NoProcessingAtStartup"
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = strDIRName
.cOption("AutosaveFilename") = CStr(strFileName)
.cOption("AutosaveFormat") = 0
.cDefaultPrinter = "PDFCreator"
.cClearCache
crpReport1.PageSetup.PaperSize = crPaperLetter
crpReport1.PageSetup.PaperOrientation = iOrin
crpReport1.PrintOut False, 1
' Print the report
.cPrinterStop = False
End With

This is where is will hang on the second file - waiting for the file to get to PDFCreator.
'Wait until the print job has entered the print queue
Do Until PDFCreator1.cCountOfPrintjobs = 1
DoEvents
Sleep 200
Loop
pdfjob.cPrinterStop = False

'Wait until PDF creator is finished then release the objects
Do Until PDFCreator1.cCountOfPrintjobs = 0
DoEvents
Sleep 200
Loop
' Reset the Defalut printer
With PDFCreator1
.cPrinterStop = True
.cDefaultPrinter = DefaultPrinter
Sleep 200
.cClose
End With

© 2006 by pdfforge.org :: Contact us

Validate XHTML or CSS.