473,320 Members | 1,949 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,320 software developers and data experts.

Loop through multiple reports and combine as 1 PDF file

I work for a company with strict lockdown on how our computers are configured. So, add-ins or any new installations are impossible. The following is my dilemma.

I created almost 60 different types of metrics report for my department. The MIS is being used by different levels of users. With so many audience, I want to provide them a tool to create a profile and each profile contains the pre-set reports to run on a weekly basis. For example, John Doe will only need 15 out of the 60 reports. Most of the reports are driven off a form through parameters in the queries.

First problem: I was able to create a loop to cycle through the 15 reports. However, the problem appears when the report has no data. I want to be able to exclude the reports with no data. I cannot seem to find any VB on how to do this.

Second problem: I don't want to kill trees in the process. If I solve the first problem, ideally instead of printing the reports (which could run in hundreds pages) I would like to export the batch report as 1 PDF file. Some of the solutions I found seem to focus on merging file in PDF. Any idea on how to do this in VB and then export to PDF. Headers and report numbers are irrelevant.
Jul 22 '10 #1
5 6409
missinglinq
3,532 Expert 2GB
Never used PDFs but someone here is sure to have and can help you.

As to the reports with no data, use the...you got it, report's NoData event to cancel the report!
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_NoData(Cancel As Integer)
  2.  Cancel = True
  3. End Sub
If you are using a form button to open the report, then add error handling to the click event set to ignore Error Number 2501.

Welcome to Bytes!

Linq ;0)>
Jul 22 '10 #2
I already have no data event in all my reports. The event cancels the report. This will not work in a loop. Correct me if I am wrong cancelling a report in the middle of the loop will break the loop right? Say of the 15 reports selected, report 8 has no data. The loop will not proceed to report 9. I think a better VB will resolve this. Not an advance programmer myself...
Jul 23 '10 #3
hype261
207 100+
@CoolC401
Instead of using an error trapper surrounding the bulk of your code couldn't you just use:

On Error goto Next

To have it jump to the next line of code. I remember I had the same issue once with printing reports and I believe this is how I got around it.
Jul 23 '10 #4
slenish
283 100+
I have a question about your PDF question...

You want to export to a PDF file, but do you have Adobe writer installed or another type of PDF conversion program? Since you said your company has some strict lock down rules on add-ins. You would need to get an add-in so you can write to a PDF.

A work around for this is you can write to whats call a snap shot, it looks and opens just like a PDF but its a built in feature that Access offers for those who dont have PDF conversion programs.

example
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, "reportname", "Snapshot Format", "DrivePathFileDOTsnp"
  2.  
Jul 24 '10 #5
Than you for the Snap suggestion. Our company uses PDF documents on everything we do. Most admin personel has PDF writer, including me.

The PDF add-in is standard on our laptop and the add in allows user to select multiple reports to export to PDF. This will not work because all our reports are menu driven.

I don't think there are any solutions to combine multiple reports in Access 2007. I've seen suggestions on using sub-reports. Not a solution to what I need to do.
Jul 24 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Knocked Wood | last post by:
Hi, I looked around and can't find anything on this at all and can not get it to work for IE. I'm trying to loop multiple sounds on a game, with three unique variables, when a link is clicked....
2
by: Sigurd Bruteig | last post by:
Hi all! I have a problem printing multiple reports. The code i use is: Dim stDocName As String stDocName = "rptInvoice" DoCmd.OpenReport stDocName, acNormal, , " = date()" The problem is that...
3
by: Mike Wiseley | last post by:
I want to insert a procedure call to the report close event of 50 or so reports in a database. As each report is opened and then closed by a user, I want to log the date this occurrred. I am...
3
by: MHenry | last post by:
Hi, I have 30 separate Access reports to print to pdf files. Presently, I print these reports to Acrobat pdf files one report at a time. I am looking for some help, or a program or add-in...
2
by: Eych | last post by:
(ASP.NET with Crystal.NET) I can create a pdf or rtf file with my report for one record. However, I would like to loop my table and create one big report which would be a concatenation of 10...
4
by: Kim Mitchell | last post by:
In the program that I have created, I can print reports. Is there an easy way to turn the document printed using PrintDocument1_PrintPage into a file that can be viewed using a word processor,...
0
by: mr_doles | last post by:
I have finally got the hang of this ReportViewer control. The one question that I have is dealing with multiple reports. If I have, lets say, 10 rdlc reports should I have 10 WinForms to put them...
2
by: Thall | last post by:
Hey Gurus - I've seen a few solutions to this problem, but none of which I can do without a little help. Here's the situation The following code loops thru a sales report, using the sales rep ID...
1
by: fsbernard | last post by:
I want to be able to create a multiple volume zip file on the server using PHP. Anyone has any idea how one can do this?
0
by: mgarg005SSRS | last post by:
My requirement is to create multiple reports (.rdlc) and show them using single report viewer control. A: User selects a report from drop down list. B: Depending on report name a report has to be...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.