473,405 Members | 2,300 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,405 software developers and data experts.

Prettier export from Access Report to Excel

Hello (again),

I quickly want to preface this by saying you all really have no idea how much I appreciate all the help I have received from this forum. You really are all just the best kind of people and are helping me more than you'll ever realize. Thank you!

I have a report that I have tried using OutputTo to export to excel:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OutputTo acOutputReport, "rptHourlyPercentage", acFormatXLS, , True
Which is fine and all, but the way the report is setup it's ugly and almost un readable. These is basically going to be used by extremely computer illiterate "higher-ups" and that format just isn't going to do. In a bout of frustration I just hit Control A, Copy and pasted it into a blank excel document and WOW! Perfect! Exactly what I need.

I can't find it anywhere but... oh god... someone please tell me there is a procedural way to do this in VBA, but telling them to select all and copy paste isn't going to fly. I know I know.

Or even sending me to a place with more information.. I'm just failing at my googling here. Even if there is a way to format that "OutputTo" data before it hits the screen would be an OK last resort.
May 8 '10 #1

✓ answered by Jim Doherty

@CoreyReynolds
Which version Access are you using?

An Access report can have all sorts of formatting applied to it, lines,calculations,pagebreaks,groupings colours and so on. To output a sophisticated report and expect it to retain all formats in excel is a non starter. You have several options here:-

If your report is essentially just a tabular display namely columns and rows you could effectively miss out the report entirely and transfer the results of a dataset (table or a query) immediately to Excel.

The DoCmd.TransferSpreadsheet action sends table/query in a fixed format to excel.

You could get into Office automation and can control aspects of the spreadsheet layout when your dataset is sent over to excel ie: range positioning, formatting data, colouring column headers, bolding fonts, freezing panes and so on, This requires considerable effort and understanding of the mechanics of the Excel object library which you would ordinarily set a reference to within Access.

If simplicity is the aim for management you could easily output your existing report as a snapshot file. These file types have an .snp extension and are viewable using snapshot viewer which does come with Office. Be wary though, depending on the office installation it might not have been included for installation on the target PC as it is not part of the default installation process.

The upside of SNP files is that your management can view the report exactly as if they were viewing an Access report and you can also email the file itself. The downside is the rather irritating lack of not being part of the default 'Office' installation and thus some recipients inevitably say "Hey I cannot read this file!"

3) You have an option to output a report to PDF in Access 2007. (you can do this in earlier versions of Access and for free using Stephen Lebans rather excellent code module that he wrote for converting SNP files to PDF automatically. Setting this up does require some VBA knowledge but he has documented the process) or you can buy a third party piece of software to do the job. Most desktops nowadays have a PDF viewer.


Regards

6 9444
Jim Doherty
897 Expert 512MB
@CoreyReynolds
Which version Access are you using?

An Access report can have all sorts of formatting applied to it, lines,calculations,pagebreaks,groupings colours and so on. To output a sophisticated report and expect it to retain all formats in excel is a non starter. You have several options here:-

If your report is essentially just a tabular display namely columns and rows you could effectively miss out the report entirely and transfer the results of a dataset (table or a query) immediately to Excel.

The DoCmd.TransferSpreadsheet action sends table/query in a fixed format to excel.

You could get into Office automation and can control aspects of the spreadsheet layout when your dataset is sent over to excel ie: range positioning, formatting data, colouring column headers, bolding fonts, freezing panes and so on, This requires considerable effort and understanding of the mechanics of the Excel object library which you would ordinarily set a reference to within Access.

If simplicity is the aim for management you could easily output your existing report as a snapshot file. These file types have an .snp extension and are viewable using snapshot viewer which does come with Office. Be wary though, depending on the office installation it might not have been included for installation on the target PC as it is not part of the default installation process.

The upside of SNP files is that your management can view the report exactly as if they were viewing an Access report and you can also email the file itself. The downside is the rather irritating lack of not being part of the default 'Office' installation and thus some recipients inevitably say "Hey I cannot read this file!"

3) You have an option to output a report to PDF in Access 2007. (you can do this in earlier versions of Access and for free using Stephen Lebans rather excellent code module that he wrote for converting SNP files to PDF automatically. Setting this up does require some VBA knowledge but he has documented the process) or you can buy a third party piece of software to do the job. Most desktops nowadays have a PDF viewer.


Regards
May 8 '10 #2
Thank you for the detailed reply. I had no idea about snapshots and I'll take a look at that in the future. I am using Access 2007

They do from time to time want to do things with numbers themselves... so a PDF or snapshot might not be the best possible solution. Selecting everything and copy and pasting actually leaves it in a reasonable format that I think I could just leave as is, to bad it doesn't like like there is really a way to do that (correct me if I'm wrong). Guess I'll have to reproduce it in VBA manually, which doesn't look like too much fun but - Oh Well!

Although it doesn't help me much here, there's a few other projects I'm working on where those snapshots might come in handy.

Thanks,
Corey
May 8 '10 #3
Jim Doherty
897 Expert 512MB
@CoreyReynolds
Yes Corey,,,I am afraid it pretty much depends on what it is you are doing your end. The snapshot and PDF thing is no good like you say if you are number crunching and passing material data to and fro heavily integrating the physical data useage between apps.

It is a matter of strategy as I am sure you already appreciate. If you are using Access 2007 then I would dump the snp thing as pdfs are much more functional nowadays

To answer your question ......You are right there is no way to just say copy, paste, hey presto exactly the same editable data report in Excel as appears graphically in the Access
report window
May 8 '10 #4
Well, we'll just leave it at that and close the topic with hopes that some day they finally come out with the magic VBA fairies that make data input and output seamless, GUI based, flexible and simple to use.
May 8 '10 #5
Jim Doherty
897 Expert 512MB
@CoreyReynolds
Haha absolutely :)
May 8 '10 #6
NeoPa
32,556 Expert Mod 16PB
Using Application Automation it's perfectly possible to duplicate the process of copying your report and pasting it into an Excel spreadsheet.

If you're interested in taking this further then give it a try and come back with specific questions if you get stuck.
May 9 '10 #7

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

Similar topics

15
by: Mark C | last post by:
All, I have exhaustingly been looking through the newsgroups in search of a way to systemically output an Access 97 report to a pdf file using the full version of Adobe Acrobat. I want the user...
2
by: Yisroel Markov | last post by:
Greetings, two of my users have the same front end db (A2K). Each of them has created, in addition to the standard reports, a personal customized report. Now they both want to be able to run...
1
by: Vincel2k2 | last post by:
Hi, I need to provide Access reports from our web site. When the app gets to the output command I get this error I get this error: The formats that enable you to output data as a Microsoft Excel,...
1
by: ellenh | last post by:
I have read postings on the similar subject including the posting from 2003 shown below. This process works fine to display a single page snapshot report in PowerPoint. I need to display...
1
by: Bob Alston | last post by:
Anyt one know a way to correctly export an Access 2003 report to Excel? I can use Tools - Office Links ..... just fine with a query or table. But when I try a report it just doesn't work. right...
2
by: nofear | last post by:
I used to export my reports as snapshot but now I have to export them to Excel When I export my report to a Excel Spreadsheet the report header and footer are not included Only the data gets...
1
by: anon3803 | last post by:
I have a report in Access that has a lot of grouping (sometimes over 5 group headers). When I export it to Excel where more people can use it and are familiar it creates a lot of blank rows when...
3
by: jmarcrum | last post by:
I want to export a report (that contains two separate queries, 1. Current year data, and 2. split-year data) from access into excel, but everytime I run my code and export the data to excel, it looks...
10
by: ConnollyS | last post by:
Is it possible to export a report from Access to Excel and keep all the formmating. i.e. Lines, boxes etc... Or do you need to create an excel template and then use a macro or some VB code to...
3
by: hawaiijeff | last post by:
I have a report that I built in Access 2002. I built it with the report wizard, but then went into design mode and added a extra information which was calculations off the existing fields in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.