Convert to PDF

  • Thread starter Thread starter Jacinda
  • Start date Start date
J

Jacinda

Hi, I tried to post earlier but I don't think it went through...

I am using the following code:

http://www.lebans.com/reporttopdf.htm


it is working great, however I have a question. Is there anyway to
multi-select reports and have them run through the code via a loop or even
into one final PDF.

Any thoughts?
 
Hi Jacinda

Stephen's PDF solution includes the ability to merge PDF documents. You
need to declare the following function:

Private Declare Function MergePDFDocuments _
Lib "StrStorage.dll" ( _
ByVal PDFMaster As String, _
ByVal PDFChild As String _
) As Boolean

When you process your first report (using ConvertUncompressedSnapshot),
specify the desired final PDF file as the output file.

Then, for the subsequent reports, specify a temporary file as the output
file, and then call MergePDFDocuments to append the result to the first one:

fResult = MergePDFDocuments(<final PDF name>, <temp file name>)
Kill <temp file name>
 
or even into one final PDF.

A recent post requesting the same result didn't seem to yield much without
purchasing any acrobat software. The one way this seems to be accomplished
is by creating a "bundle" report, which is basically a blank report with all
of the reports you want in one pdf as subreports, with a page break between
each subreport. I don't know if the poster ever tried it or not, but I would
assume it would work.

As far as looping to print a certain selection of reports, this is entirely
possible (though each one will be it's own pdf file). The one thing you need
to figure out is how you are going to gather the list of reports that you
want. There's any number of ways you might handle that. Ideally the list of
reports could go into a temp table (which we can loop to print each one) or
into an array (which can be stepped through).

Here's an example based on a recordset of the desired reports:

Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("table or sql")

If rs.Recordcount <> 0 Then
rs.MoveFirst
While Not rs.EOF
ConvertReportToPDF rs.Fields("fieldwithreportname")
rs.MoveNext
Wend
End If

Set rs = Nothing


hth
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Stephen's PDF solution includes the ability to merge PDF documents.

I wasn't aware of this. In fact, a week or so ago I thought someone had
tried to do this with no real look.

Good nice to know there is a way.

To the OP: disregard my post, apparently there is a way!
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



Graham Mandeno said:
Hi Jacinda

Stephen's PDF solution includes the ability to merge PDF documents. You
need to declare the following function:

Private Declare Function MergePDFDocuments _
Lib "StrStorage.dll" ( _
ByVal PDFMaster As String, _
ByVal PDFChild As String _
) As Boolean

When you process your first report (using ConvertUncompressedSnapshot),
specify the desired final PDF file as the output file.

Then, for the subsequent reports, specify a temporary file as the output
file, and then call MergePDFDocuments to append the result to the first one:

fResult = MergePDFDocuments(<final PDF name>, <temp file name>)
Kill <temp file name>

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jacinda said:
Hi, I tried to post earlier but I don't think it went through...

I am using the following code:

http://www.lebans.com/reporttopdf.htm


it is working great, however I have a question. Is there anyway to
multi-select reports and have them run through the code via a loop or even
into one final PDF.

Any thoughts?
 
Stephen's PDF solution includes the ability to merge PDF documents.
I wasn't aware of this. In fact, a week or so ago I thought someone had
tried to do this with no real look.


Indeed, the case I had in mind was through Acrobat setup as a printer rather
than the ReportToPDF modules. My apologies...

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



Jack Leach said:
Stephen's PDF solution includes the ability to merge PDF documents.

I wasn't aware of this. In fact, a week or so ago I thought someone had
tried to do this with no real look.

Good nice to know there is a way.

To the OP: disregard my post, apparently there is a way!
--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



Graham Mandeno said:
Hi Jacinda

Stephen's PDF solution includes the ability to merge PDF documents. You
need to declare the following function:

Private Declare Function MergePDFDocuments _
Lib "StrStorage.dll" ( _
ByVal PDFMaster As String, _
ByVal PDFChild As String _
) As Boolean

When you process your first report (using ConvertUncompressedSnapshot),
specify the desired final PDF file as the output file.

Then, for the subsequent reports, specify a temporary file as the output
file, and then call MergePDFDocuments to append the result to the first one:

fResult = MergePDFDocuments(<final PDF name>, <temp file name>)
Kill <temp file name>

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jacinda said:
Hi, I tried to post earlier but I don't think it went through...

I am using the following code:

http://www.lebans.com/reporttopdf.htm


it is working great, however I have a question. Is there anyway to
multi-select reports and have them run through the code via a loop or even
into one final PDF.

Any thoughts?
 
Back
Top