Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

access 2010 report - preview in popup window needs EXPORT button

Posted on 2013-01-28
12
Medium Priority
?
1,359 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 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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 …
Suggested Courses

916 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