OWC10 hangs

S

Spiller Delicate

Hi,

I've embedded an OWC10.Chartspace (Chartspace1) into my Access Report. On
Format Event, I want to format the chart to details of the recordset. It
works fine the first time I call the report. If I reload the report, Access
hangs and displays nothing.

I thought the problem could be in freeing resources. But I'm using set
objchart = nothing already. Doesnt seem to work. Here's the code:

Dim objChart As New OWC10.ChartSpace
Dim categories(10)
Dim values(10)
Dim chConstants

'set constants
Set chConstants = ChartSpace1.Constants
'assign to present chartspace
Set objChart = ChartSpace1.Object

' Clear the contents of the chart workspace. This removes
' any old charts that may already exist and leaves the chart
workspace
' completely empty. One chart object is then added.
objChart.Clear
objChart.Border.Weight = 0
objChart.Charts.Add
With objChart.Charts(0)
.Type = chChartTypeBarStacked
'.Type = chChartTypeBarStacked3D
.HasTitle = True
'.ChartDepth = 25
.Border.Weight = 0
End With
' Add series to the chart.
objChart.Charts(0).SeriesCollection.Add
' Series one contains the mark.
' Set the categories for the first series (this collection is
zero-based)
objChart.Charts(0).SeriesCollection(0).SetData
chConstants.chDimCategories, chConstants.chDataLiteral, categories
objChart.Charts(0).SeriesCollection(0).SetData
chConstants.chDimValues, chConstants.chDataLiteral, values
objChart.Charts(0).SeriesCollection(0).Caption = sTitle


With objChart.Charts(0).Axes(0)
.Font.Size = 8
.Position = chAxisPositionLeft
End With

'set scaling

objChart.Charts(0).SeriesCollection(0).Scalings(chConstants.chDimValues).Min
imum = 0

objChart.Charts(0).SeriesCollection(0).Scalings(chConstants.chDimValues).Max
imum = 100

With objChart.Charts(0).Axes(1)
.HasTickLabels = False
.MajorTickMarks = chTickMarkNone
.HasAutoMajorUnit = False
.HasAutoMinorUnit = False

.HasMajorGridlines = False
.HasMinorGridlines = False

.HasTitle = True

.Title.Caption = "<< POOR
EXCELLENT >>"
.Title.Font.Name = "Arial"
.Title.Font.Size = 8


End With
' Make the chart legend visible, format the left value axis as
percentage,
' and specify that value gridlines are at 10% intervals.
objChart.Charts(0).HasLegend = False

'ChartSpace1.Charts(0).Axes(chConstants.chAxisPositionLeft).NumberFormat =
"0%"
End If

'free all resources
Set objchart = nothing
 
T

Thao Moua [ms]

This seems to be a bug in Access Report. I have filed a bug and will post a workaround (if any) soon

Thao Mou
OWC Webchart Suppor

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.ht

----- Spiller Delicate wrote: ----

Hi

I've embedded an OWC10.Chartspace (Chartspace1) into my Access Report. O
Format Event, I want to format the chart to details of the recordset. I
works fine the first time I call the report. If I reload the report, Acces
hangs and displays nothing

I thought the problem could be in freeing resources. But I'm using se
objchart = nothing already. Doesnt seem to work. Here's the code

Dim objChart As New OWC10.ChartSpac
Dim categories(10
Dim values(10
Dim chConstant

'set constant
Set chConstants = ChartSpace1.Constant
'assign to present chartspac
Set objChart = ChartSpace1.Objec

' Clear the contents of the chart workspace. This remove
' any old charts that may already exist and leaves the char
workspac
' completely empty. One chart object is then added
objChart.Clea
objChart.Border.Weight =
objChart.Charts.Ad
With objChart.Charts(0
.Type = chChartTypeBarStacke
'.Type = chChartTypeBarStacked3
.HasTitle = Tru
'.ChartDepth = 2
.Border.Weight =
End Wit
' Add series to the chart
objChart.Charts(0).SeriesCollection.Ad
' Series one contains the mark
' Set the categories for the first series (this collection i
zero-based
objChart.Charts(0).SeriesCollection(0).SetDat
chConstants.chDimCategories, chConstants.chDataLiteral, categorie
objChart.Charts(0).SeriesCollection(0).SetDat
chConstants.chDimValues, chConstants.chDataLiteral, value
objChart.Charts(0).SeriesCollection(0).Caption = sTitl


With objChart.Charts(0).Axes(0
.Font.Size =
.Position = chAxisPositionLef
End Wit

'set scalin

objChart.Charts(0).SeriesCollection(0).Scalings(chConstants.chDimValues).Mi
imum =

objChart.Charts(0).SeriesCollection(0).Scalings(chConstants.chDimValues).Ma
imum = 10

With objChart.Charts(0).Axes(1
.HasTickLabels = Fals
.MajorTickMarks = chTickMarkNon
.HasAutoMajorUnit = Fals
.HasAutoMinorUnit = Fals

.HasMajorGridlines = Fals
.HasMinorGridlines = Fals

.HasTitle = Tru

.Title.Caption = "<< POO
EXCELLENT >>
.Title.Font.Name = "Arial
.Title.Font.Size =


End Wit
' Make the chart legend visible, format the left value axis a
percentage
' and specify that value gridlines are at 10% intervals
objChart.Charts(0).HasLegend = Fals

'ChartSpace1.Charts(0).Axes(chConstants.chAxisPositionLeft).NumberFormat
"0%
End I

'free all resource
Set objchart = nothin
 

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