473,785 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

batch export of reports

4 New Member
Hi there,

I was wondering if anyone could suggest a method using only access ( ie no additional applications) to batch export reports to excel. Basically i have a report with a query for its source data, and the query is based on the selection of an employee from a drop down list. It would be terrific if i could batch export a report for each employee.

Hopefully someone out there has the answer
Nov 26 '08 #1
7 5154
ADezii
8,834 Recognized Expert Expert
I recently responded to a very similar Thread. and I'll try to find it for you. In the meantime, the process is:
  1. Open the Report in Design View.
  2. Dynamically set the Record Source of the Report based on Employee IDs contained within some kind of Looping Structure.
  3. Close and Save the Report.
  4. Export the Report.
Nov 26 '08 #2
ADezii
8,834 Recognized Expert Expert
Well, I couldn't find the Thread that I was referring to, but I re-wrote it from scratch, so here goes:

ASSUMPTIONS:
  1. Table Name: Employees
  2. Report Name: rptEmployees
  3. Primary Key in Employees Table: EmployeeID
Expand|Select|Wrap|Line Numbers
  1. Dim MyDB As DAO.Database
  2. Dim rpt As Report
  3. Dim rstEmployee As DAO.Recordset
  4.  
  5. Set MyDB = CurrentDb()
  6. Set rstEmployee = MyDB.OpenRecordset("Employees", dbOpenForwardOnly)
  7.  
  8. With rstEmployee
  9.   Do While Not .EOF
  10.     DoCmd.OpenReport "rptEmployees", acViewDesign
  11.     Reports![rptEmployees].RecordSource = "Select * From Employees Where Employees.[EmployeeID] = " & _
  12.                                            ![EmployeeID]
  13.     DoCmd.Close acReport, "rptEmployees", acSaveYes
  14.     DoCmd.OutputTo acOutputReport, "rptEmployees", acFormatXLS, CurrentProject.path & "\Employee_" & _
  15.                                    ![EmployeeID] & ".xls"
  16.     .MoveNext
  17.   Loop
  18. End With
Nov 26 '08 #3
barrhaven01
4 New Member
thanks for the code.... just one question.... How do i implement this loop code as the record source, it seems to only want to let me select queries or tables, i cant get to code builder from there.

thanks again for all the help thus far
Nov 26 '08 #4
ADezii
8,834 Recognized Expert Expert
The code will do it all, just set the RecordSource of rptEmployees to the Employees Table, set the Control Sources of all Bound Fields, and you are set to go. Execute the code from wherever you wish.
Nov 26 '08 #5
PianoMan64
374 Recognized Expert Contributor
@barrhaven01
Hello barrhaven01,

In order to do what Adezii is speaking of, you need to open up the code module and create a subroutine that will make the changes that he's speaking about to your report. You're not able to do set it on the RecordSource field within the report. It has to be done in CODE.

Hope that helps,

Joe P.
Nov 26 '08 #6
ADezii
8,834 Recognized Expert Expert
Thanks Joe P. for the assist, sometimes I miss the obvious! (LOL).
Nov 27 '08 #7
barrhaven01
4 New Member
im incredibly stupid.... i cant seem to get this to run.

Also I was wondering how the code would change if rather than a report for each employee, if it summarrized each employee by office building.
Nov 27 '08 #8

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

Similar topics

1
11409
by: Goran Djuranovic | last post by:
Hi everyone, I copied an asp.net project to another machine by using "Copy Project" menu item from "Project" menu in VS.NET 2003 IDE. The project contains Crystal Reports that are being exported to .PDF file and displayed in IE using Adobe ..pdf viewer. This is the error description I get when try to display one of the reports: Error in File E:\Temp\temp_4023d958-6102-4006-ac49-048796f2d7db.rpt: Invalid export DLL or export format....
0
1101
by: Bill Sharp | last post by:
Hi, I have a Stored Procedure that takes about 20 minutes to fill a Dataset, then I bind it to a report and try to export in a PDF format. It works with my smaller reports, but not my biggest - not mentionning the most important. The error message is the following: Missing parameter field current value.
0
2278
by: Leo Heska | last post by:
Hi I haven't seen the following problem mentioned anywhere We have an application written in VB.NET which executes a batch file (named startJob.cmd). We have discovered that if that batch file is too big, the last lines of the batch file will not run. For example, the following one-line batch file runs just fine when invoked from our VB.NET app echo %PATH% > c:\com\molex\plot\wmIntegration\logs\p0.lo but the following batch file...
1
1477
by: Grant Szabo | last post by:
I need to export a report with stored procedure parameters from ASP.NET. I cannot find any way to set the parameters from the ReportDocument object. I'm using C# on ASP.NET with Crystal v9 and SQL Server 2000. Reports without parameters export perfectly. Can anyone throw me a bone on how to do this? Thank you,
0
2727
by: Henry | last post by:
I have written an ASP/VB.Net application via VS 2003 (Crystal V9) that uses MS Access 2000 as its database. I can export reports that have no linked sub reports for printing. However, I'm unable to export reports that have linked subreports. I receive (a "Missing parameter field current value") on the following statement: Me.crReportDocument.Export() The main report requires 4 parameters. The linked reports do not require any...
1
1577
by: simon.robin.jackson | last post by:
Ok. I have a database. I have a report. I want to batch export this report to either html/xml/rtf files. However, at present, the problem is that by default, I can batch export to html but it will produce a sequential list of files with the suffix page 1; page 2; etc. I want to batch export to html/xml/rtf but name the output files based on an field within the database. (I have a field that is called filename, and would like to...
1
2861
by: sisieko | last post by:
I have an access adp (MS Access 2003) connecting to a SQL 200 server. From the adp a user generates reports and using the built-in access export wizard can export said reports (which are either tables or queries run against a table) as the save as options available in the wizard. What I really want to achieve is remove certain save as options from the default access export wizard. After some research I have realized that customizing...
22
8972
Missionary
by: Missionary | last post by:
I need to batch print reports. I've looked at past posts about batch printing, but I don't know visual basic, so I'll need some coaching. I have a report based on a parameter query. I have it set to take the parameter value from a form that I use to preview and print reports. I have to repeatedly print that report using a different value each time. I want to set it up to batch print, taking the values from a list in a table. Thanks...
4
4276
by: Mythran | last post by:
Reposted, originally posted in microsoft.public.vb.crystal which is not an MSDN managed newsgroup.... POST BELOW --------------------- We develop our applications and reports using Visual Studio 2008 with Crystal Reports Basic for Visual Studio 2008. The same issue that's been around for years, where you export a report to PDF and during the export process, CR shrinks the fonts of text and field objects on the report.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.