Solved

access 2010 report - preview in popup window needs EXPORT button

Posted on 2013-01-28
12
1,311 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

627 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