PC Review


Reply
Thread Tools Rate Thread

Draw lines, pset points, draw circles on a report

 
 
=?Utf-8?B?aGdlcm9u?=
Guest
Posts: n/a
 
      22nd May 2006
I can set a scale and draw lines and points on a report by building "on
format" code. But how do I the the "on format" event to read the data from a
table or query? It is easy to copy the points and paste them into the code,
like this...

x = 3.285: y = 4.092: Me.PSet (x, y), lngColor
x = 3.279: y = 4.457: Me.PSet (x, y), lngColor
x = 3.569: y = 4.458: Me.PSet (x, y), lngColor

but I have thousands of points to compute and "pset"

How do I get the event "on format" to read my points?


--
hgeron
 
Reply With Quote
 
 
 
 
Duane Hookom
Guest
Posts: n/a
 
      22nd May 2006
Why not bind your report to the data? You can use a single line of code to
plot all the points in a single section like:

Me.MoveLayout = False

I believe I have code that does this in the Corp Tech Demos at
http://www.invisibleinc.com/divFiles.cfm?divDivID=4.
--
Duane Hookom
MS Access MVP

"hgeron" <(E-Mail Removed)> wrote in message
news:9089ED1C-78E9-4775-85FA-(E-Mail Removed)...
>I can set a scale and draw lines and points on a report by building "on
> format" code. But how do I the the "on format" event to read the data
> from a
> table or query? It is easy to copy the points and paste them into the
> code,
> like this...
>
> x = 3.285: y = 4.092: Me.PSet (x, y), lngColor
> x = 3.279: y = 4.457: Me.PSet (x, y), lngColor
> x = 3.569: y = 4.458: Me.PSet (x, y), lngColor
>
> but I have thousands of points to compute and "pset"
>
> How do I get the event "on format" to read my points?
>
>
> --
> hgeron



 
Reply With Quote
 
=?Utf-8?B?aGdlcm9u?=
Guest
Posts: n/a
 
      23rd May 2006
Thanks Duane, but this won't work.
See the data to be plotted will be a topographic survey of points and lines.
The user will supply the surveys, and choose which (x,y) points make up
the lines. Some reports will be plan views, and some reports cross sections.

It is important that these be accurately scaled (nn feet per inch).
I can do a xy scatter plot of the points, but the scale can't be contolled.
And it does not have the linear features.

Using the MS access help, it showed how to draw a circle, to scale, pset
points, and draw lines at specific coordinates but it only worked on reports
and then only in the "On Page" or "On format" events. The coordinates were
all hard-coded into
the code of the report.

I have an example that works but I had to figure all the scaled points and
lines in a query, then paste them to the report code. If I rescale or zoom
the plot, all the coordinates must be re-computed.

If I could just pass the points and lines to the "on format" event, they
could be processed from the survey table.

Would it help to see the single report and the code in it?

hgeron



--
hgeron


"Duane Hookom" wrote:

> Why not bind your report to the data? You can use a single line of code to
> plot all the points in a single section like:
>
> Me.MoveLayout = False
>
> I believe I have code that does this in the Corp Tech Demos at
> http://www.invisibleinc.com/divFiles.cfm?divDivID=4.
> --
> Duane Hookom
> MS Access MVP
>
> "hgeron" <(E-Mail Removed)> wrote in message
> news:9089ED1C-78E9-4775-85FA-(E-Mail Removed)...
> >I can set a scale and draw lines and points on a report by building "on
> > format" code. But how do I the the "on format" event to read the data
> > from a
> > table or query? It is easy to copy the points and paste them into the
> > code,
> > like this...
> >
> > x = 3.285: y = 4.092: Me.PSet (x, y), lngColor
> > x = 3.279: y = 4.457: Me.PSet (x, y), lngColor
> > x = 3.569: y = 4.458: Me.PSet (x, y), lngColor
> >
> > but I have thousands of points to compute and "pset"
> >
> > How do I get the event "on format" to read my points?
> >
> >
> > --
> > hgeron

>
>
>

 
Reply With Quote
 
Duane Hookom
Guest
Posts: n/a
 
      23rd May 2006
Did you look at the reports in the Corp Tech Demo? It seemed to me that if
you have your values in data, you can "plot" them anywhere you want them on
the page. You have accuracy down to 1/1440 of an inch.

If you don't want to bind the data to your report as the record source, you
can use code to open recordsets and plot you points and draw your circles.
--
Duane Hookom
MS Access MVP

"hgeron" <(E-Mail Removed)> wrote in message
news:8937D188-1A66-4C29-B2D9-(E-Mail Removed)...
> Thanks Duane, but this won't work.
> See the data to be plotted will be a topographic survey of points and
> lines.
> The user will supply the surveys, and choose which (x,y) points make up
> the lines. Some reports will be plan views, and some reports cross
> sections.
>
> It is important that these be accurately scaled (nn feet per inch).
> I can do a xy scatter plot of the points, but the scale can't be
> contolled.
> And it does not have the linear features.
>
> Using the MS access help, it showed how to draw a circle, to scale, pset
> points, and draw lines at specific coordinates but it only worked on
> reports
> and then only in the "On Page" or "On format" events. The coordinates
> were
> all hard-coded into
> the code of the report.
>
> I have an example that works but I had to figure all the scaled points and
> lines in a query, then paste them to the report code. If I rescale or
> zoom
> the plot, all the coordinates must be re-computed.
>
> If I could just pass the points and lines to the "on format" event, they
> could be processed from the survey table.
>
> Would it help to see the single report and the code in it?
>
> hgeron
>
>
>
> --
> hgeron
>
>
> "Duane Hookom" wrote:
>
>> Why not bind your report to the data? You can use a single line of code
>> to
>> plot all the points in a single section like:
>>
>> Me.MoveLayout = False
>>
>> I believe I have code that does this in the Corp Tech Demos at
>> http://www.invisibleinc.com/divFiles.cfm?divDivID=4.
>> --
>> Duane Hookom
>> MS Access MVP
>>
>> "hgeron" <(E-Mail Removed)> wrote in message
>> news:9089ED1C-78E9-4775-85FA-(E-Mail Removed)...
>> >I can set a scale and draw lines and points on a report by building "on
>> > format" code. But how do I the the "on format" event to read the data
>> > from a
>> > table or query? It is easy to copy the points and paste them into the
>> > code,
>> > like this...
>> >
>> > x = 3.285: y = 4.092: Me.PSet (x, y), lngColor
>> > x = 3.279: y = 4.457: Me.PSet (x, y), lngColor
>> > x = 3.569: y = 4.458: Me.PSet (x, y), lngColor
>> >
>> > but I have thousands of points to compute and "pset"
>> >
>> > How do I get the event "on format" to read my points?
>> >
>> >
>> > --
>> > hgeron

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?aGdlcm9u?=
Guest
Posts: n/a
 
      23rd May 2006
Yes, I did experiment with the report I downloaded from Corp Tech, but it
does not come close to what I need. There is no text, or bitmap to print,
and the data is not printed... the data dicatates where a point is placed or
a line drawn.

I did try to open the I needed to read the survey, but I got a message that
I could not do that with the "On format" event. Maybe I had the wrong method
or syntax.
If I knew how to open the recordset to make the data visible to "On Format"
or "On Page", that should work.

I don't know what you mean about "binding" the data. But the data will
always changing as new surveys are loaded.

Hgeron

--
hgeron


"Duane Hookom" wrote:

> Did you look at the reports in the Corp Tech Demo? It seemed to me that if
> you have your values in data, you can "plot" them anywhere you want them on
> the page. You have accuracy down to 1/1440 of an inch.
>
> If you don't want to bind the data to your report as the record source, you
> can use code to open recordsets and plot you points and draw your circles.
> --
> Duane Hookom
> MS Access MVP
>
> "hgeron" <(E-Mail Removed)> wrote in message
> news:8937D188-1A66-4C29-B2D9-(E-Mail Removed)...
> > Thanks Duane, but this won't work.
> > See the data to be plotted will be a topographic survey of points and
> > lines.
> > The user will supply the surveys, and choose which (x,y) points make up
> > the lines. Some reports will be plan views, and some reports cross
> > sections.
> >
> > It is important that these be accurately scaled (nn feet per inch).
> > I can do a xy scatter plot of the points, but the scale can't be
> > contolled.
> > And it does not have the linear features.
> >
> > Using the MS access help, it showed how to draw a circle, to scale, pset
> > points, and draw lines at specific coordinates but it only worked on
> > reports
> > and then only in the "On Page" or "On format" events. The coordinates
> > were
> > all hard-coded into
> > the code of the report.
> >
> > I have an example that works but I had to figure all the scaled points and
> > lines in a query, then paste them to the report code. If I rescale or
> > zoom
> > the plot, all the coordinates must be re-computed.
> >
> > If I could just pass the points and lines to the "on format" event, they
> > could be processed from the survey table.
> >
> > Would it help to see the single report and the code in it?
> >
> > hgeron
> >
> >
> >
> > --
> > hgeron
> >
> >
> > "Duane Hookom" wrote:
> >
> >> Why not bind your report to the data? You can use a single line of code
> >> to
> >> plot all the points in a single section like:
> >>
> >> Me.MoveLayout = False
> >>
> >> I believe I have code that does this in the Corp Tech Demos at
> >> http://www.invisibleinc.com/divFiles.cfm?divDivID=4.
> >> --
> >> Duane Hookom
> >> MS Access MVP
> >>
> >> "hgeron" <(E-Mail Removed)> wrote in message
> >> news:9089ED1C-78E9-4775-85FA-(E-Mail Removed)...
> >> >I can set a scale and draw lines and points on a report by building "on
> >> > format" code. But how do I the the "on format" event to read the data
> >> > from a
> >> > table or query? It is easy to copy the points and paste them into the
> >> > code,
> >> > like this...
> >> >
> >> > x = 3.285: y = 4.092: Me.PSet (x, y), lngColor
> >> > x = 3.279: y = 4.457: Me.PSet (x, y), lngColor
> >> > x = 3.569: y = 4.458: Me.PSet (x, y), lngColor
> >> >
> >> > but I have thousands of points to compute and "pset"
> >> >
> >> > How do I get the event "on format" to read my points?
> >> >
> >> >
> >> > --
> >> > hgeron
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Duane Hookom
Guest
Posts: n/a
 
      23rd May 2006
I assume the values you are wishing to plot are in a table or tables and can
be displayed in a query. Is this correct?

I assume you want to plot the these values in a report. Is this correct?

If both of the above are true, you can either read the values for plotting
by setting the record source of report to the query or opening a recordset
in code on the report.

If you don't want to set the report's record source, leave it blank and add
code to the On Page event of the report.

Dim db As DAO.Database
Dim rs as DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("qselYourQuery")
With rs
.MoveFirst
Do Until .eof
'code to plot your point
.MoveNext
Loop
.Close
End With
Set rs = Nothing
Set db = Nothing

--
Duane Hookom
MS Access MVP


"hgeron" <(E-Mail Removed)> wrote in message
news:E2EE9E7E-15C8-44BF-9C05-(E-Mail Removed)...
> Yes, I did experiment with the report I downloaded from Corp Tech, but it
> does not come close to what I need. There is no text, or bitmap to print,
> and the data is not printed... the data dicatates where a point is placed
> or
> a line drawn.
>
> I did try to open the I needed to read the survey, but I got a message
> that
> I could not do that with the "On format" event. Maybe I had the wrong
> method
> or syntax.
> If I knew how to open the recordset to make the data visible to "On
> Format"
> or "On Page", that should work.
>
> I don't know what you mean about "binding" the data. But the data will
> always changing as new surveys are loaded.
>
> Hgeron
>
> --
> hgeron
>
>
> "Duane Hookom" wrote:
>
>> Did you look at the reports in the Corp Tech Demo? It seemed to me that
>> if
>> you have your values in data, you can "plot" them anywhere you want them
>> on
>> the page. You have accuracy down to 1/1440 of an inch.
>>
>> If you don't want to bind the data to your report as the record source,
>> you
>> can use code to open recordsets and plot you points and draw your
>> circles.
>> --
>> Duane Hookom
>> MS Access MVP
>>
>> "hgeron" <(E-Mail Removed)> wrote in message
>> news:8937D188-1A66-4C29-B2D9-(E-Mail Removed)...
>> > Thanks Duane, but this won't work.
>> > See the data to be plotted will be a topographic survey of points and
>> > lines.
>> > The user will supply the surveys, and choose which (x,y) points make up
>> > the lines. Some reports will be plan views, and some reports cross
>> > sections.
>> >
>> > It is important that these be accurately scaled (nn feet per inch).
>> > I can do a xy scatter plot of the points, but the scale can't be
>> > contolled.
>> > And it does not have the linear features.
>> >
>> > Using the MS access help, it showed how to draw a circle, to scale,
>> > pset
>> > points, and draw lines at specific coordinates but it only worked on
>> > reports
>> > and then only in the "On Page" or "On format" events. The coordinates
>> > were
>> > all hard-coded into
>> > the code of the report.
>> >
>> > I have an example that works but I had to figure all the scaled points
>> > and
>> > lines in a query, then paste them to the report code. If I rescale or
>> > zoom
>> > the plot, all the coordinates must be re-computed.
>> >
>> > If I could just pass the points and lines to the "on format" event,
>> > they
>> > could be processed from the survey table.
>> >
>> > Would it help to see the single report and the code in it?
>> >
>> > hgeron
>> >
>> >
>> >
>> > --
>> > hgeron
>> >
>> >
>> > "Duane Hookom" wrote:
>> >
>> >> Why not bind your report to the data? You can use a single line of
>> >> code
>> >> to
>> >> plot all the points in a single section like:
>> >>
>> >> Me.MoveLayout = False
>> >>
>> >> I believe I have code that does this in the Corp Tech Demos at
>> >> http://www.invisibleinc.com/divFiles.cfm?divDivID=4.
>> >> --
>> >> Duane Hookom
>> >> MS Access MVP
>> >>
>> >> "hgeron" <(E-Mail Removed)> wrote in message
>> >> news:9089ED1C-78E9-4775-85FA-(E-Mail Removed)...
>> >> >I can set a scale and draw lines and points on a report by building
>> >> >"on
>> >> > format" code. But how do I the the "on format" event to read the
>> >> > data
>> >> > from a
>> >> > table or query? It is easy to copy the points and paste them into
>> >> > the
>> >> > code,
>> >> > like this...
>> >> >
>> >> > x = 3.285: y = 4.092: Me.PSet (x, y), lngColor
>> >> > x = 3.279: y = 4.457: Me.PSet (x, y), lngColor
>> >> > x = 3.569: y = 4.458: Me.PSet (x, y), lngColor
>> >> >
>> >> > but I have thousands of points to compute and "pset"
>> >> >
>> >> > How do I get the event "on format" to read my points?
>> >> >
>> >> >
>> >> > --
>> >> > hgeron
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?aGdlcm9u?=
Guest
Posts: n/a
 
      23rd May 2006
YES!!!!
That is working ---
Thanks Duane


--
hgeron


"Duane Hookom" wrote:

> I assume the values you are wishing to plot are in a table or tables and can
> be displayed in a query. Is this correct?
>
> I assume you want to plot the these values in a report. Is this correct?
>
> If both of the above are true, you can either read the values for plotting
> by setting the record source of report to the query or opening a recordset
> in code on the report.
>
> If you don't want to set the report's record source, leave it blank and add
> code to the On Page event of the report.
>
> Dim db As DAO.Database
> Dim rs as DAO.Recordset
> Set db = CurrentDb
> Set rs = db.OpenRecordset("qselYourQuery")
> With rs
> .MoveFirst
> Do Until .eof
> 'code to plot your point
> .MoveNext
> Loop
> .Close
> End With
> Set rs = Nothing
> Set db = Nothing
>
> --
> Duane Hookom
> MS Access MVP
>
>
> "hgeron" <(E-Mail Removed)> wrote in message
> news:E2EE9E7E-15C8-44BF-9C05-(E-Mail Removed)...
> > Yes, I did experiment with the report I downloaded from Corp Tech, but it
> > does not come close to what I need. There is no text, or bitmap to print,
> > and the data is not printed... the data dicatates where a point is placed
> > or
> > a line drawn.
> >
> > I did try to open the I needed to read the survey, but I got a message
> > that
> > I could not do that with the "On format" event. Maybe I had the wrong
> > method
> > or syntax.
> > If I knew how to open the recordset to make the data visible to "On
> > Format"
> > or "On Page", that should work.
> >
> > I don't know what you mean about "binding" the data. But the data will
> > always changing as new surveys are loaded.
> >
> > Hgeron
> >
> > --
> > hgeron
> >
> >
> > "Duane Hookom" wrote:
> >
> >> Did you look at the reports in the Corp Tech Demo? It seemed to me that
> >> if
> >> you have your values in data, you can "plot" them anywhere you want them
> >> on
> >> the page. You have accuracy down to 1/1440 of an inch.
> >>
> >> If you don't want to bind the data to your report as the record source,
> >> you
> >> can use code to open recordsets and plot you points and draw your
> >> circles.
> >> --
> >> Duane Hookom
> >> MS Access MVP
> >>
> >> "hgeron" <(E-Mail Removed)> wrote in message
> >> news:8937D188-1A66-4C29-B2D9-(E-Mail Removed)...
> >> > Thanks Duane, but this won't work.
> >> > See the data to be plotted will be a topographic survey of points and
> >> > lines.
> >> > The user will supply the surveys, and choose which (x,y) points make up
> >> > the lines. Some reports will be plan views, and some reports cross
> >> > sections.
> >> >
> >> > It is important that these be accurately scaled (nn feet per inch).
> >> > I can do a xy scatter plot of the points, but the scale can't be
> >> > contolled.
> >> > And it does not have the linear features.
> >> >
> >> > Using the MS access help, it showed how to draw a circle, to scale,
> >> > pset
> >> > points, and draw lines at specific coordinates but it only worked on
> >> > reports
> >> > and then only in the "On Page" or "On format" events. The coordinates
> >> > were
> >> > all hard-coded into
> >> > the code of the report.
> >> >
> >> > I have an example that works but I had to figure all the scaled points
> >> > and
> >> > lines in a query, then paste them to the report code. If I rescale or
> >> > zoom
> >> > the plot, all the coordinates must be re-computed.
> >> >
> >> > If I could just pass the points and lines to the "on format" event,
> >> > they
> >> > could be processed from the survey table.
> >> >
> >> > Would it help to see the single report and the code in it?
> >> >
> >> > hgeron
> >> >
> >> >
> >> >
> >> > --
> >> > hgeron
> >> >
> >> >
> >> > "Duane Hookom" wrote:
> >> >
> >> >> Why not bind your report to the data? You can use a single line of
> >> >> code
> >> >> to
> >> >> plot all the points in a single section like:
> >> >>
> >> >> Me.MoveLayout = False
> >> >>
> >> >> I believe I have code that does this in the Corp Tech Demos at
> >> >> http://www.invisibleinc.com/divFiles.cfm?divDivID=4.
> >> >> --
> >> >> Duane Hookom
> >> >> MS Access MVP
> >> >>
> >> >> "hgeron" <(E-Mail Removed)> wrote in message
> >> >> news:9089ED1C-78E9-4775-85FA-(E-Mail Removed)...
> >> >> >I can set a scale and draw lines and points on a report by building
> >> >> >"on
> >> >> > format" code. But how do I the the "on format" event to read the
> >> >> > data
> >> >> > from a
> >> >> > table or query? It is easy to copy the points and paste them into
> >> >> > the
> >> >> > code,
> >> >> > like this...
> >> >> >
> >> >> > x = 3.285: y = 4.092: Me.PSet (x, y), lngColor
> >> >> > x = 3.279: y = 4.457: Me.PSet (x, y), lngColor
> >> >> > x = 3.569: y = 4.458: Me.PSet (x, y), lngColor
> >> >> >
> >> >> > but I have thousands of points to compute and "pset"
> >> >> >
> >> >> > How do I get the event "on format" to read my points?
> >> >> >
> >> >> >
> >> >> > --
> >> >> > hgeron
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to draw trend lines through only certain data points akh2103 Microsoft Excel Charting 2 14th Jun 2007 12:08 AM
draw lines in report =?Utf-8?B?QXJhc2gga2FtYW5rZXNo?= Microsoft Access Reports 1 16th Aug 2006 07:28 PM
Build macro to draw lines between multiple points =?Utf-8?B?QW5naWU=?= Microsoft Excel Programming 1 19th Apr 2004 08:57 AM
Using GDI+ to draw lines and points inside RichTextBox... JDeats Microsoft C# .NET 0 19th Nov 2003 02:57 PM
Can't draw lines, Circles, etc. david.franklin Microsoft Excel Misc 2 18th Jul 2003 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:11 PM.