ReportToPDF "times out"

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

I am using the ReportToPDF in Access 2007. It has been working fine,
however, today I am attempting to generate large reports and the ReportTOPDF
code seems to time out in the middle of generating the snap reports… at about
page 55. Any ideas on how to extend the timeout? Some of the large reports
I have, with user defined functions, at about 5-10 minutes to print.
 
Have you rebooted your system recently?

Forget about my code for a moment. Manually export the report in question to
Snapshot format. Does the issue still appear?

I have tested ReporToPDF out to several thousand pages with no issues.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
I rebooted my system, and ran export to snap only. The snap report was
generated. However, you are definitely on to something here. When I
generate the report using ReportToPDF code. The code stops at the following
line (279) in function ConvertReportToPDF

DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", _
strPathandFileName

It seems to generate, or start generating, and then it just stops
processing; similar to a successful completion. The code does not hang, and
my form is not closed. It is as if the logic hit an exit function or
something. Any ideas??? I am running Access 2007 on an XP and a Vista
box. Same thing on both boxes. Also the code has been running fine for two
weeks now. Great stuff and Thanks!!!
 
When you manually export the Report to Snapshot format are you saving it
into the same folder as when you call ConvertToPDF function?

With the manually exported report as a Snapshot, saved into the folder in
question, Open my sample MDB and use the Convert Snapshot to PDF function
found on the second TAB fo the HowToUse form. Does this work?

FInally, what has changed on your system just immediately before the problem
began to show itself? New default printer driver? Major update to Windows?
Have you changed permissions/security on any of the folder sin question?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
The problem was with my code. I have a UserDefinedFunction (UDF) for one of
the report fields that does a SQL statement on a text field in a table. In
my VB code I use the ' for the string. However, there are values in the text
field that contain the ' as part of the text. So my code was crashing on the
UDF called from the report. The

DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", _
strPathandFileName

was crashing, but not reporting an error. My reports were called from a VB
module code that was called from a from. The code would kick me all the way
out of the VB logic just as if all processing succesfully finished
processing... except my form was not closed. Very interesting.

I also discovered since I am using Access 2007 with the PDF plugin. I am
able to generate PDF reports by using the following syntax.

DoCmd.OutputTo acOutputReport, RptName, "PDFFormat(*.pdf)", _
strPathandFileName


Thank you for the GREAT code and the help with this issue!

Mike P
 
Back
Top