Send Acrobat Reports with Distiller using Looping commands

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

Hi there. Any thoughts on this would be fantastic. I have
some code that loops through a recordset and opens a form
based on the current line in the recordset, then I use
docmd to send a report that is filtered by the contents of
the form at the time, then the form closes and the process
is repeated until the end of the recordset. The problem is
that I'd really like to send my reports in adobe but I
don't know how. I think I need to replace the docmd
command with two parts: the first exports the report
that's filtered by the form to adobe format (I don't know
how to automatically do this) and, second, send the report
using the outlook object model's attachment feature. does
that sound do-able? Thanks!!

Set Db = CurrentDb
Set rs = Db.OpenRecordset("SELECT * " & _
"FROM [qryRegionManagers] " & _
"WHERE Not [Internet Address] Is Null")

If Not rs.EOF Then

Do While Not rs.EOF

DoCmd.OpenForm "frmRegionManagers",
acNormal, , "([Region]='" & rs![Region] & "')"

DoCmd.SendObject
acSendReport, "rptRegionSummaries", acFormatSNP, rs!
[Internet Address], , , "Summary", , False

DoCmd.Close acForm, "frmRegionManagers", acSaveNo
rs.MoveNext

Loop
End If
 
Terry, thanks. Yeah, I actually had downloaded the trial
version yesterday before seeing your response but I didn't
think it was all that quick and easy to use. Admittedly, I
didn't put much time into it. I will try to do that today.
The cost is fine if it can do what I need it to do. If you
found the setup and use easy, please let me know. Thanks
again for the response.

-----Original Message-----
Mike,

Have a look at this class library:

http://ourworld.compuserve.com/homepages/attac-
cg/acgsoft.htm

I am evaluating it for a slightly different process than
you are but I suspect it will do all you need. $55 may be
a cheap investment?

Terry
-----Original Message-----
Hi there. Any thoughts on this would be fantastic. I have
some code that loops through a recordset and opens a form
based on the current line in the recordset, then I use
docmd to send a report that is filtered by the contents of
the form at the time, then the form closes and the process
is repeated until the end of the recordset. The problem is
that I'd really like to send my reports in adobe but I
don't know how. I think I need to replace the docmd
command with two parts: the first exports the report
that's filtered by the form to adobe format (I don't know
how to automatically do this) and, second, send the report
using the outlook object model's attachment feature. does
that sound do-able? Thanks!!

Set Db = CurrentDb
Set rs = Db.OpenRecordset("SELECT * " & _
"FROM [qryRegionManagers] " & _
"WHERE Not [Internet Address] Is Null")

If Not rs.EOF Then

Do While Not rs.EOF

DoCmd.OpenForm "frmRegionManagers",
acNormal, , "([Region]='" & rs![Region] & "')"

DoCmd.SendObject
acSendReport, "rptRegionSummaries", acFormatSNP, rs!
[Internet Address], , , "Summary", , False

DoCmd.Close acForm, "frmRegionManagers", acSaveNo
rs.MoveNext

Loop
End If

.
.
 
Mike,

I'm still on the trial version. It is not real fast
however for what I want it will do. I need to create a few
thousand pdfs from a report with a member number as the
pdf file name (123456.pdf). I can set my job running and
go home ...... it will finish in about 3 hours .... but I
don't care.

Terry
-----Original Message-----
Terry, thanks. Yeah, I actually had downloaded the trial
version yesterday before seeing your response but I didn't
think it was all that quick and easy to use. Admittedly, I
didn't put much time into it. I will try to do that today.
The cost is fine if it can do what I need it to do. If you
found the setup and use easy, please let me know. Thanks
again for the response.

-----Original Message-----
Mike,

Have a look at this class library:

http://ourworld.compuserve.com/homepages/attac-
cg/acgsoft.htm

I am evaluating it for a slightly different process than
you are but I suspect it will do all you need. $55 may be
a cheap investment?

Terry
-----Original Message-----
Hi there. Any thoughts on this would be fantastic. I have
some code that loops through a recordset and opens a form
based on the current line in the recordset, then I use
docmd to send a report that is filtered by the contents of
the form at the time, then the form closes and the process
is repeated until the end of the recordset. The problem is
that I'd really like to send my reports in adobe but I
don't know how. I think I need to replace the docmd
command with two parts: the first exports the report
that's filtered by the form to adobe format (I don't know
how to automatically do this) and, second, send the report
using the outlook object model's attachment feature. does
that sound do-able? Thanks!!

Set Db = CurrentDb
Set rs = Db.OpenRecordset("SELECT * " & _
"FROM [qryRegionManagers] " & _
"WHERE Not [Internet Address] Is Null")

If Not rs.EOF Then

Do While Not rs.EOF

DoCmd.OpenForm "frmRegionManagers",
acNormal, , "([Region]='" & rs![Region] & "')"

DoCmd.SendObject
acSendReport, "rptRegionSummaries", acFormatSNP, rs!
[Internet Address], , , "Summary", , False

DoCmd.Close acForm, "frmRegionManagers", acSaveNo
rs.MoveNext

Loop
End If

.
.
.
 
Another option is to take a look at our batch reporting module.

Instead of opening a form and filling it with information in the current
record
so the report uses the form data to limit the report, why not just change
the
underlying query that drives the report, or pass a where clause at runtime?

Another option is to use a third party email component instead of
trying to rely on CDONTS. ASPMail is my favorite.

Our software would create all the pdf files and mark records in a queue
to show status (just in case an error occurred) and then if no errors
occurred
while making the pdfs it would loop through and send the emails. It would
also create the queries if needed at runtime just by passing in the
queryname
and the sql needed for each report.

We are giving away source code at the $99.95 price.

However we only work with PDFWriter 5 and below or win2pdf right now,
Just my two cents,
Mark
RPT Software
http://www.rptsoftware.com
 
Back
Top