473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

preferred method to filter Lebans' ReportToPdf

I could not find a good method to pass a where clause or openargs to a
report named in a call to stephen Lebans' fine reportToPDF utility.l.

Do you have a good method to pass a PK to the report so you can print
a single record to an individual pdf?.

I've got 2500 records to make into .pdfs, (project manager says it's
what customer wants)
and I've put the report2pdf call inside a loop. It works, but ignores
any filter clause I try to pass (using a one field, on record table,
or a public variable or a query criteria to a form, etc...

Thanks

Bob Q

Sep 22 '08 #1
7 3461
"rq******@sympatico.ca" <bo*********@gmail.comwrote in message
news:ae**********************************@m44g2000 hsc.googlegroups.com...
>I could not find a good method to pass a where clause or openargs to a
report named in a call to stephen Lebans' fine reportToPDF utility.l.

Do you have a good method to pass a PK to the report so you can print
a single record to an individual pdf?.
Yes, just open the report BEFORE you call the pdf routines.

eg:
strReportName = "rptInvoice"

DoCmd.OpenReport strReportName, acViewPreview, , strWhere
Reports(strReportName).Visible = False
Call ConvertReportToPDF(strReportName, , strDocName, False, False)

DoCmd.Close acReport, strReportName

Note how the "strwhere" could be for the current reocrd

strWhere = "id = " & me!id

And, don't forget to "close" the report as above after you are done...

So, open the report with all of your filter options etc BEFORE you call the
pdf routines.....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
>

Sep 23 '08 #2
rq******@sympatico.ca wrote:
I could not find a good method to pass a where clause or openargs to a
report named in a call to stephen Lebans' fine reportToPDF utility.l.

Do you have a good method to pass a PK to the report so you can print
a single record to an individual pdf?.

I've got 2500 records to make into .pdfs, (project manager says it's
what customer wants)
and I've put the report2pdf call inside a loop. It works, but ignores
any filter clause I try to pass (using a one field, on record table,
or a public variable or a query criteria to a form, etc...

Thanks

Bob Q
I coded something for his program just today. I have a report that can
be called from several forms. There's only 1 form that will be calling
the routine to create the PDF file. So in my OnOpen event of the report
I did something like
If IsLoaded("formname") then 'google for example of isloaded()
If not isnull(Forms!FormName!ReportFilter) then
Me.Filter = Forms!FormName!ReportFilter
Me.FilterOn = True
Endif
Endif

Then in my routine to call Stephen Lebans code it's something like this
Dim blnOK As Boolean
Forms!MainForm!ReportFilter = "CustomerID = 1"
blnOK = ConvertReportToPDF...
Forms!MainForm!ReportFilter = Null

Stephen's code works like a charm.
Sep 23 '08 #3
Salad <oi*@vinegar.comwrote:
>So in my OnOpen event of the report
I did something like
If IsLoaded("formname") then 'google for example of isloaded()
If not isnull(Forms!FormName!ReportFilter) then
Me.Filter = Forms!FormName!ReportFilter
Me.FilterOn = True
Endif
Endif

Then in my routine to call Stephen Lebans code it's something like this
Dim blnOK As Boolean
Forms!MainForm!ReportFilter = "CustomerID = 1"
blnOK = ConvertReportToPDF...
Forms!MainForm!ReportFilter = Null

Stephen's code works like a charm.
I use something very similar. Except that I use a Global Options Hidden form bound
to a global options table on which I throw a tab control. And I put miscellanious
fields such as the one Salad uses as well.

This form also takes care of the performance problem issue.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Sep 23 '08 #4
On Sep 23, 6:58*pm, "Tony Toews [MVP]" <tto...@telusplanet.netwrote:
Salad <o...@vinegar.comwrote:
So in my OnOpen event of the report
I did something like
* *If IsLoaded("formname") then *'google for example of isloaded()
* * * * * *If not isnull(Forms!FormName!ReportFilter) then
* * * * * * * * * *Me.Filter = Forms!FormName!ReportFilter
* * * * * * * * * *Me.FilterOn = True
* * * * * *Endif
* *Endif
Then in my routine to call Stephen Lebans code it's something like this
* *Dim blnOK As Boolean
* *Forms!MainForm!ReportFilter = "CustomerID = 1"
* *blnOK = ConvertReportToPDF...
* *Forms!MainForm!ReportFilter = Null
Stephen's code works like a charm.

I use something very similar. *Except that I use a Global Options Hidden form bound
to a global options table on which I throw a tab control. * And I put miscellanious
fields such as the one Salad uses as well.

This form also takes care of the performance problem issue.

Tony
--
Tony Toews, Microsoft Access MVP
* *Please respond only in the newsgroups so that others can
read the entire thread of messages.
* *Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm
* *Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/- Hide quoted text -

- Show quoted text -
Thanks to all 3 of you for your responses. Albert's method worked
beautifully, although I'm surprised at the fact that opening an open
form respects the filter on the first form, instead of the form
defaults.

However, I do intend to update the code to use Salad's and your method
mecause I find the flickering of the report being opened, closed and
reopened 2022 times a little annoying.

As to performance, it took about 20 minutes to create the 2000+ .PDFs,
2 to 5 pages each.

Q

Sep 24 '08 #5
"rq******@sympatico.ca" <bo*********@gmail.comwrote:
>As to performance, it took about 20 minutes to create the 2000+ .PDFs,
2 to 5 pages each.
So a hundred a minute isn't bad at all. Gotta love Stephen's solution. I sure do!

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Sep 24 '08 #6
On Sep 24, 6:37*pm, "Tony Toews [MVP]" <tto...@telusplanet.netwrote:
"rquin...@sympatico.ca" <bob.quin...@gmail.comwrote:
As to performance, it took about 20 minutes to create the 2000+ .PDFs,
2 to 5 pages each.

So a hundred a minute isn't bad at all. * Gotta love Stephen's solution.. *I sure do!

Tony
He's da man!

Thanks Stephen, for all your fine work.
Sep 24 '08 #7
"rq******@sympatico.ca" <bo*********@gmail.comwrote in message
news:2e**********************************@m36g2000 hse.googlegroups.com...
On Sep 24, 6:37 pm, "Tony Toews [MVP]" <tto...@telusplanet.netwrote:
"rquin...@sympatico.ca" <bob.quin...@gmail.comwrote:
As to performance, it took about 20 minutes to create the 2000+ .PDFs,
2 to 5 pages each.

So a hundred a minute isn't bad at all. Gotta love Stephen's solution. I
sure do!

Tony
>He's da man!
>Thanks Stephen, for all your fine work.

Yes, I have to throw in a big thanks to that Stephen guy.....it is a fab pdf
maker.....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Sep 26 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: DFS | last post by:
If you're listening, I want the middle of the calendar (showing 1 month) to open below the cursor position. It currently opens just to the right and below the cursor position. I hunted through...
5
by: Tom | last post by:
Hi: I'm using the Leban's ReportToPDF solution and have encountered a small problem. I'm calling the code using the following: Call ConvertReportToPDF(strReportName, , , True, True) Where...
1
by: Dennis Hartmann | last post by:
Thank you Stephen Lebans! This solution implements easily... and it works well. I figured performance would suffer a little because the report is first saved as a snapshot then converted but,...
6
by: MLH | last post by:
Method "ouput to" of object "IDoCmd" failed displayed as an Access 40204 error. I dropped a JPEG object into an unbound report - just a small jpg image in the middle of the page and tried to...
0
by: sramsey | last post by:
I have been using Lebans ReportToPDF code for a couple months without problems. We recently changed the format of the invoice and now the first line of the detail section of my report is missing 2...
6
by: ldn95887 | last post by:
I have been using Lebans ReportToPDF code for a couple months without problems. We recently changed the format of the invoice and now the first line of the detail section of my report is missing 2...
2
by: J-P-W | last post by:
Hi, I'm using Stephen Lebans ReportTpPDF (thank you Stephen) and it's great. I've not changed the code at all, I invoke it using: Call ConvertReportToPDF(Me.rptName, vbNullString,...
2
by: Scott McDaniel | last post by:
Stephen Lebans A2000SnapshotToPDFVer751 sample makes use of the dynapdf.dll file ... can I legally deploy this file along with my application, or do I need to purchase something from DynaForms? I...
2
by: akeatley | last post by:
I have the ReportToPDF code working fine with Access 2003 (No Service Patch) and acrobat 8, but as soon as i try the same code on Access 2003 SP2 with acrobat 7 it doesn't work. <<<<<<<<<<< ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.