Solved

access 2010 report - preview in popup window needs EXPORT button

Posted on 2013-01-28
12
1,229 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
  • 6
  • 6
12 Comments
 
LVL 84
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 84
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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 84
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 84
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 84
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 84

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

776 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