Changing a newly created report from design view to preview

J

Jim

Greetings!

I am generating a report which I use to plot a graph-on-the-fly using
rectangle controls (small squares) as data points on top of a
pre-scanned image. So, I create the new report in design view, add the
rectangle controls to show my datapoints, and then I want the user to
see to graph in preview mode.

To do so, I seem to have to first save it (with the automatically
generated name that access gives it such as Report_n- report name seems
to be read-only) and then re-open it in preview mode. therefore, each
time this is run, my database grows by one report.

Is there a way to change the view mode of my temporary report without
saving it? The only other option would be to open the report, make sure
there are no rectangle controls already on it (delete those controls)
and make my graph. but, again, you can't do that except in design mode.
thoughts? (other than why not use a graph control... I want the image
in the background)

Thanks!
 
J

Jim

Making progress- so I made a macro that executes the menu command
PrintView (runcommand printview) and I call the macro in my code, which
then shows the report in preview mode. Unfortunately when you close
this view, you are still left with the unsaved design view of the new
report. will keep working on it.
 
M

Marshall Barton

Jim said:
I am generating a report which I use to plot a graph-on-the-fly using
rectangle controls (small squares) as data points on top of a
pre-scanned image. So, I create the new report in design view, add the
rectangle controls to show my datapoints, and then I want the user to
see to graph in preview mode.

To do so, I seem to have to first save it (with the automatically
generated name that access gives it such as Report_n- report name seems
to be read-only) and then re-open it in preview mode. therefore, each
time this is run, my database grows by one report.

Is there a way to change the view mode of my temporary report without
saving it? The only other option would be to open the report, make sure
there are no rectangle controls already on it (delete those controls)
and make my graph. but, again, you can't do that except in design mode.
thoughts? (other than why not use a graph control... I want the image
in the background)


Is there a good reason why you can not draw the rectangles,
etc. at run time using the section's Print event?
 
J

Jim

Well, I do want the user to be able to preview the graph, and close it
or print it. Most times, the report would not be printed. Thanks.
 
M

Marshall Barton

Jim said:
Well, I do want the user to be able to preview the graph, and close it
or print it. Most times, the report would not be printed. Thanks.


I don't see that as a reason against doing it at runtime
without messy around with design operations. It's actually
easier to manipulate properties of existing controls than to
create the controls with those property settings.

What I was suggesting earlier is the use the report's Page
event and the Line method to draw boxes anywhere on the
page. The only thing this requires is that you know where
on the page the graph is located. Well, you also have to
know where you want the rectangles, but if you don't know
that, I don't see how any approach can work.

Bottom line here is, DO NOT USE CreateControl in a running
application.
 
J

Jim

I understand now. Thank you. I hadn't considered that approach. It
will work nicely. I used the rectangle method because I did not know
how many data points there would be, but this does the same thing in
the end. Once again, thanks.
 
M

Marshall Barton

Jim said:
I understand now. Thank you. I hadn't considered that approach. It
will work nicely. I used the rectangle method because I did not know
how many data points there would be, but this does the same thing in
the end. Once again, thanks.


Let us know how it works out.

The last several versions of Acccess Help have messed up the
topic for the Line and Circle methods so if you have trouble
using the Line method come on back and we'll try to work it
out.
 
J

Jim

Yes, The line method help says nothing about the "B" box mode etc, but
I found what I needed, following your lead. the module works great
now, and it was simple to switch over from the rectangle control method
to the line method.
Thanks again! Jim
 

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

Top