Solved

Problem exporting Access report with subreport to Excel

Posted on 2013-05-09
7
1,416 Views
1 Endorsement
Last Modified: 2013-05-16
I have an Access report which includes a subreport.  It prints fine in Access, but when I export it to Excel, the subreport begins in the next row and column of the main report.....example: the main report data is in Excel rows A1 thru Q111 - then the subreport begins in row R112 and uses as many columns as needed to the right (ends in AI113).

Is there any way to make the subreport align directly under the main report - that is to begin in cell R1?????   Than x for your help!

p.s.  I am NOT exporting using a VBA command - I am merely using the External Data icon to export the report to the Excel file.  I could use the VBA command if I could append the subreport to the main report?????
1
Comment
Question by:gmapdc
7 Comments
 
LVL 39

Accepted Solution

by:
als315 earned 300 total points
Comment Utility
It is normal behaviour when you are exporting complex reports. You should fill excel file from VBA if you like to have nice excel file. You can prepare template and fill it. Look at sample DB here:
#a38465860
0
 

Author Comment

by:gmapdc
Comment Utility
I tried your example and got the same exact output - by normal behaviour are you saying that it is not possible to get the subreport to align with the main report?????
0
 
LVL 39

Assisted Solution

by:als315
als315 earned 300 total points
Comment Utility
Yes, you can't place subreport exactly under main report without VBA.
And look at Sub Export in my sample.
1
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 150 total points
Comment Utility
<Is there any way to make the subreport align directly under the main report - that is to begin in cell R1????? >
You did not post a sample of your database/report so it is hard to say...

But if the main report is left aligned, and the subreport is left aligned, then this should work.

Try als315's suggestion first.

Then perhaps you can post a simple sample of db, along with a clear graphical example of the exact output you need in Excel.

JeffCoachman
0
 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 50 total points
Comment Utility
p.s.  I am NOT exporting using a VBA command - I am merely using the External Data icon to export the report to the Excel file.

This only works well for simple reports that do not have any sub reports.


I could use the VBA command if I could append the subreport to the main report?????

Not sure if that  is the best way to do it with VBA code. The best success I have doins this was to use VBA and Excel Automation to insert the data into the Worksheet in the desired format.   See: http://www.databasejournal.com/features/msaccess/article.php/3563671/Export-Data-To-Excel.htm
0
 

Author Closing Comment

by:gmapdc
Comment Utility
I did have to use VBA code - in a procedure from a button, I ran sql queries of each report and subreport and appended the data to a common temp table.  The trick was to be sure the queries had the same number of columns, that there was no conflict of data types, and the columns were aligned the way I wanted.    I then exported the table , using TransferSpreadsheet, and finished by deleting the data from the temp table.  

This worked really nicely - thanx for pointing me in the right direction.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now