A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Graph report running very slow, HELP!



 
 
Thread Tools Display Modes
  #1  
Old November 27th, 2005, 10:27 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Graph report running very slow, HELP!

Several days ago I posted this in another group and got no replies, I
hope you guys can help me.

I created a report that contains a OLE Unbound object that is a graph.
I added the code below to the Detail, Format event. When I run the
report it takes approx. 50 seconds for it to open. If I run the query
that is it's data source, the query opens quickly. Is there anything I
can do to speed it up?

Thanks,
TD

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdef As DAO.QueryDef
Dim grph As Object
Dim grphchart As Object
Dim c As Integer
Dim r As Integer

Set db = CurrentDb()
Set qdef = db.QueryDefs("qry1")

qdef.Parameters(0) = [Forms]![frmReports]![StartDatePicker]
qdef.Parameters(1) = [Forms]![frmReports]![EndDatePicker]
qdef.Parameters(2) = [Forms]![frmReports]![cboVesselNumber]
qdef.Parameters(3) = [Forms]![frmReports]![cboProductID]

Set rst = qdef.OpenRecordset()
Set grph = Me!Graph1.Object
Set grphchart = grph.Application.DataSheet
grphchart.Cells.Clear

For c = 0 To rst.Fields.Count - 1
grphchart.Cells(1, c + 1) = rst.Fields(c).Name
Next c

r = 2
Do Until rst.EOF
For c = 1 To rst.Fields.Count
grphchart.Cells(r, c) = rst(c - 1).Value
Next c
r = r + 1
rst.MoveNext
Loop

rst.Close
db.Close

grph.Axes(2).MaximumScale = 9

End Sub

  #2  
Old November 28th, 2005, 06:13 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Graph report running very slow, HELP!

Is there a reason why you don't use a query as the Row Source of the graph?

--
Duane Hookom
MS Access MVP


wrote in message
oups.com...
Several days ago I posted this in another group and got no replies, I
hope you guys can help me.

I created a report that contains a OLE Unbound object that is a graph.
I added the code below to the Detail, Format event. When I run the
report it takes approx. 50 seconds for it to open. If I run the query
that is it's data source, the query opens quickly. Is there anything I
can do to speed it up?

Thanks,
TD

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdef As DAO.QueryDef
Dim grph As Object
Dim grphchart As Object
Dim c As Integer
Dim r As Integer

Set db = CurrentDb()
Set qdef = db.QueryDefs("qry1")

qdef.Parameters(0) = [Forms]![frmReports]![StartDatePicker]
qdef.Parameters(1) = [Forms]![frmReports]![EndDatePicker]
qdef.Parameters(2) = [Forms]![frmReports]![cboVesselNumber]
qdef.Parameters(3) = [Forms]![frmReports]![cboProductID]

Set rst = qdef.OpenRecordset()
Set grph = Me!Graph1.Object
Set grphchart = grph.Application.DataSheet
grphchart.Cells.Clear

For c = 0 To rst.Fields.Count - 1
grphchart.Cells(1, c + 1) = rst.Fields(c).Name
Next c

r = 2
Do Until rst.EOF
For c = 1 To rst.Fields.Count
grphchart.Cells(r, c) = rst(c - 1).Value
Next c
r = r + 1
rst.MoveNext
Loop

rst.Close
db.Close

grph.Axes(2).MaximumScale = 9

End Sub



  #3  
Old November 28th, 2005, 02:10 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Graph report running very slow, HELP!

I have used the Graph control from the standard toolbox with a lot of
success, especially in this case. If the standard control is not functional
for you, try a sub-report which contains the graphic control and use the four
fields as parent/child filters.


" wrote:

Several days ago I posted this in another group and got no replies, I
hope you guys can help me.

I created a report that contains a OLE Unbound object that is a graph.
I added the code below to the Detail, Format event. When I run the
report it takes approx. 50 seconds for it to open. If I run the query
that is it's data source, the query opens quickly. Is there anything I
can do to speed it up?

Thanks,
TD

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdef As DAO.QueryDef
Dim grph As Object
Dim grphchart As Object
Dim c As Integer
Dim r As Integer

Set db = CurrentDb()
Set qdef = db.QueryDefs("qry1")

qdef.Parameters(0) = [Forms]![frmReports]![StartDatePicker]
qdef.Parameters(1) = [Forms]![frmReports]![EndDatePicker]
qdef.Parameters(2) = [Forms]![frmReports]![cboVesselNumber]
qdef.Parameters(3) = [Forms]![frmReports]![cboProductID]

Set rst = qdef.OpenRecordset()
Set grph = Me!Graph1.Object
Set grphchart = grph.Application.DataSheet
grphchart.Cells.Clear

For c = 0 To rst.Fields.Count - 1
grphchart.Cells(1, c + 1) = rst.Fields(c).Name
Next c

r = 2
Do Until rst.EOF
For c = 1 To rst.Fields.Count
grphchart.Cells(r, c) = rst(c - 1).Value
Next c
r = r + 1
rst.MoveNext
Loop

rst.Close
db.Close

grph.Axes(2).MaximumScale = 9

End Sub


  #4  
Old November 29th, 2005, 04:16 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Graph report running very slow, HELP!

Yes, the user can select any of seven values to plot on the graph. I
will add code later to modify the sql string that is "qry1".

  #5  
Old November 29th, 2005, 04:18 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Graph report running very slow, HELP!

I'm interested in learning all I can about the graph control. How
would this speed up the report?

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Has anyone seen this behaviour? What might it be? tw General Discussion 4 June 30th, 2005 03:23 PM
Possible to show a parameter value in report based on Microsoft Graph? Steve Newton Setting Up & Running Reports 3 April 14th, 2005 10:54 PM
Save Report With CreateReport Coding Issue Jeff Conrad Setting Up & Running Reports 8 July 12th, 2004 08:39 AM
Specify Filter criteria before running report Nikos Yannacopoulos Setting Up & Running Reports 3 June 25th, 2004 09:36 PM
Label SRIT General Discussion 2 June 22nd, 2004 09:42 PM


All times are GMT +1. The time now is 08:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.