Solved

access 2010 report - preview in popup window needs EXPORT button

Posted on 2013-01-28
12
1,294 Views
Last Modified: 2013-01-30
I have a report that opens in print preview mode in a popup dialog box.  It needs to have a button somewhere (either on report header or popup menu bar) that runs code to export report source to EXCEL.  I also have code in the report in the report-Format event.

I have all the reports in the application opening in a popup window in preview mode, and the user can right-click to print.

I currently have the EXPORT command button on the report header and it works fine, except that the button doesn't show in preview mode.  If I change the view to acViewReport, the button appears and works well, but the report_Format event hasn't run, so that code doesn't get executed.  (it sets the heading and date text fields on header section).  Also, I can't seem to change the size of the popup to fit the acViewReport so it doesn't look good.  

Any ideas how I can have an EXPORT to EXCEL button or similar and still show report in preview mode in the popup window?

Thanks.
0
Comment
Question by:MonkeyPie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 85
ID: 38826030
There is no user interaction in Preview mode (i.e. you can't have buttons and such on a report  in Preview mode).

You could build a form with an embedded report, and place the button on the Form.

Or you could include the button on a ribbon control in Access, and let the user click it there.
0
 

Author Comment

by:MonkeyPie
ID: 38826231
How do you build a form with an embedded report?

Your second option - I think ribbon control in Access 2010 is tricky?
0
 
LVL 85
ID: 38826380
Add a Subform/Subreport to a form, and set the SourceObject to your Report. This can only be done in 2010.

I don't know what you mean by "tricky", but working with Ribbons generally will require you to do some research and 'homework'. I use this:

www.ribboncreator.com << 2007
www.ribboncreator2010.de/en/  <<2010
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:MonkeyPie
ID: 38829859
Thank you for help on form with report as subform.  I have done that.  The form is a pop-up and yes, the report shows in the form, and yes I can have a button on form to EXPORT.  But the report opens as acViewReport, not preview mode, and so the HeaderFormat event is not triggered.  Can I have the report showing in the form in preview mode?

Thank you.
0
 
LVL 85
ID: 38830100
Try setting the Default View of the REPORT to Print Preview. the "default" for the Default View is Report View.

To do that, open the report in Design and select the Default View in the Properties dialog.
0
 

Author Comment

by:MonkeyPie
ID: 38830118
Thanks for quick reply.  I did that and is still shows in report view, not preview.  I then tried setting property 'allow report view' to false and same result.
I really do want the report to show in preview mode, even if I take to code out of the header format event.  It needs to match all other reports in the app.
0
 
LVL 85
ID: 38830164
I'm not sure that you can ... from my review, the CurrentView of the report object is always 6 (i.e. ReportMode), no matter what you do.

Embedding Reports in forms is a very new concept, so you're going to run into some limitations. Try moving the code in the Format event out of that section (maybe to the Open or Load event of the report).

If that doesn't work, then you're stuck with the Ribbon ...
0
 

Author Comment

by:MonkeyPie
ID: 38830188
I am developing this application in 64 bit Office.  Do you know if the ribbon creator works in 64 bit?   I bought it ages ago, but haven't yet used it.
0
 
LVL 85
ID: 38830192
I don't know - but why are you using 64-bit Office? Even MSFT recommends using 32-bit unless you have a compelling reason to use the 64-bit versions (and there are none for Access development).
0
 

Author Comment

by:MonkeyPie
ID: 38830413
The client runs 64 bit Office and I am doing it to their spec.  They run huge complex EXCEL spreadsheets, I believe,  hence 64 bit Office needed.

It has caused several problems for me, but so far I have been able to work around most of them.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 38830526
I see ...

I don't think you'll be able to get around the Preview Mode requirement. From what I've found, that is the default (and only) mode for embedded reports.
0
 

Author Closing Comment

by:MonkeyPie
ID: 38837139
OK.  Thank you for determining that preview mode of report won't work as form subform.  Also that command buttons won't work in report VIEW mode.  I will need to find another solution.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

734 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