How to control Report Preview properties at runtime

  • Thread starter Thread starter Arvin Rex
  • Start date Start date
A

Arvin Rex

My application uses a FORM to BUILD a recordset and then Opens a REPORT in preview mode. How can I programatically control the ZOOM and other display features when executing in RUNTIME? Ultimately I would like to build a custom tool bar for the runtime user so he/she can choose what suits them best. There is a window MoveSize method but I have not found a way to make it work. I am using Access 2003. Will developer extensions be of any use.

Adrian
 
Arvin Rex said:
My application uses a FORM to BUILD a recordset and then Opens a
REPORT in preview mode. How can I programatically control the ZOOM
and other display features when executing in RUNTIME? Ultimately I
would like to build a custom tool bar for the runtime user so he/she
can choose what suits them best. There is a window MoveSize method
but I have not found a way to make it work. I am using Access 2003.
Will developer extensions be of any use.

Adrian

Have you looked at the RunCommand constants related to zooming? For
example,

RunCommand acCmdZoom10
RunCommand acCmdZoom25
RunCommand acCmdZoom50
RunCommand acCmdZoom75
RunCommand acCmdZoom100
RunCommand acCmdZoom150
RunCommand acCmdZoom200
RunCommand acCmdZoom500
RunCommand acCmdZoom1000

And you can also use an undocumented property to set custom zoom levels,
as shown here:

http://www.mvps.org/access/reports/rpt0020.htm
 
Dirk said:
Have you looked at the RunCommand constants related to zooming? For
example,

RunCommand acCmdZoom10
RunCommand acCmdZoom25
RunCommand acCmdZoom50
RunCommand acCmdZoom75
RunCommand acCmdZoom100
RunCommand acCmdZoom150
RunCommand acCmdZoom200
RunCommand acCmdZoom500
RunCommand acCmdZoom1000

And you can also use an undocumented property to set custom zoom levels,
as shown here:

http://www.mvps.org/access/reports/rpt0020.htm
THANKS! Both do the trick. The <reports> approach is curious: it seems to use a read-only enumerator that can modify a property. Novice that I am, I thought this was not possible.
 
Arvin Rex said:
THANKS! Both do the trick. The <reports> approach is curious: it
seems to use a read-only enumerator that can modify a property.
Novice that I am, I thought this was not possible.

I'm not sure what you're referring to -- I see nothing particularly
surprising about the code. If you'll explain what you thought was
impossible, I may be able to explain it.
 
Dirk said:
I'm not sure what you're referring to -- I see nothing particularly
surprising about the code. If you'll explain what you thought was
impossible, I may be able to explain it.
This was my thinking:

re: Reports(ReportName).zoomcontrol = [variant}

Help documentation says Reports is a read-only property pointing to a property(ZoomControl) of the report named: [ReportName]

"read-only" implies, to me, that one could read the value of .zoomcontrol but not change it.
 
Arvin Rex said:
Dirk said:
I'm not sure what you're referring to -- I see nothing particularly
surprising about the code. If you'll explain what you thought was
impossible, I may be able to explain it.
This was my thinking:

re: Reports(ReportName).zoomcontrol = [variant}

Help documentation says Reports is a read-only property pointing to a
property(ZoomControl) of the report named: [ReportName]

"read-only" implies, to me, that one could read the value of
.zoomcontrol but not change it.

The Application.Reports property is read-only, in that you can't assign
any value to it. However, Reports(ReportName) is a reference to an item
(a Report object) in the collection that the Reports property returns.
That item is not itself read-only, and in turn the various properties of
that Report object are not inherenty read-only. Some may be read-only,
some may not, and some may be read-only in some views and not in others,
as (usually) documented in the help file.

ZoomControl, though undocumented, is a read/write property of the Report
object, when the object is in Print Preview mode.
 
Dirk said:
Dirk Goldgar wrote:

THANKS! Both do the trick. The <reports> approach is curious: it
seems to use a read-only enumerator that can modify a property.
Novice that I am, I thought this was not possible.


I'm not sure what you're referring to -- I see nothing particularly
surprising about the code. If you'll explain what you thought was
impossible, I may be able to explain it.

This was my thinking:

re: Reports(ReportName).zoomcontrol = [variant}

Help documentation says Reports is a read-only property pointing to a
property(ZoomControl) of the report named: [ReportName]

"read-only" implies, to me, that one could read the value of
.zoomcontrol but not change it.


The Application.Reports property is read-only, in that you can't assign
any value to it. However, Reports(ReportName) is a reference to an item
(a Report object) in the collection that the Reports property returns.
That item is not itself read-only, and in turn the various properties of
that Report object are not inherenty read-only. Some may be read-only,
some may not, and some may be read-only in some views and not in others,
as (usually) documented in the help file.

ZoomControl, though undocumented, is a read/write property of the Report
object, when the object is in Print Preview mode.
!!!OKAY!!! I felt that some kind of 'inheritability' might be at work so I didn't dig further. The fogs abates, some.

Adrian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top