Foros del Web » Programando para Internet » ASP Clásico »

OWC Office Web Component

Estas en el tema de OWC Office Web Component en el foro de ASP Clásico en Foros del Web. hola, estava usando este codigo para hacer graficas y me funcionava solo borre win xp y lo instale de nuevo y no me funciona ke ...
  #1 (permalink)  
Antiguo 13/05/2004, 10:10
Avatar de OooH-Boy  
Fecha de Ingreso: marzo-2002
Mensajes: 70
Antigüedad: 23 años, 2 meses
Puntos: 0
OWC Office Web Component

hola, estava usando este codigo para hacer graficas y me funcionava solo borre win xp y lo instale de nuevo y no me funciona ke puedo hacer

Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/amed/sfh/chart/chart_global.asp, line 32

anyone can help me pls
here is the code

<%
Option Explicit
Response.ContentType = "image/gif"
%>

<%

'declare our variables
Dim strSQL, rst, strConnectionString
Dim objConstants, objFont, objChart, objCSpace, objAxis
Dim objBinaryFile, FSO

'the connection string
strConnectionString = "provider=microsoft.jet.oledb.4.0;" _
& "data source=C:\product.mdb"

'create the recordset object
set rst = Server.CreateObject("ADODB.Recordset")

%>

<%

'the SQL query
strSQL = "select Accion, count(*) as num from table1 group by Accion "

'get the data with a client side cursor, and static dataset
rst.open strSQL, strConnectionString, 3, 3

'Now create the chart object
set objCSpace = Server.CreateObject("OWC.Chart")

%>


<%

'set up chart and properties
set objChart = objCSpace.Charts.Add()
set objConstants = objCSpace.Constants

'create a clustered column chart
objChart.Type = objConstants.chChartTypeColumnClustered

'add a legend
objChart.HasLegend = false

%>

<%

'set the data source to the recordset
set objCSpace.DataSource = rst

'set the data points and categories
objChart.SetData objConstants.chDimSeriesNames, 0, "num"
objChart.SetData objConstants.chDimCategories, 0, "Accion"
objChart.SetData objConstants.chDimValues, 0, "num"

'set up some additional properties
'add and format the chart title
objChart.HasTitle = True
objChart.Title.Caption = "Accciones Correctivas Global"
set objFont = objChart.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 12
objFont.Bold = True

'add and format a title to the category axis
set objAxis = objChart.Axes(objConstants.chAxisPositionBottom)
objAxis.HasTitle = True
objAxis.Title.Caption = "Acciones"
set objFont = objAxis.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 10
objFont.Bold = True

'add and format a title to the value axis
set objAxis = objChart.Axes(objConstants.chAxisPositionLeft)
'objAxis.NumberFormat = "Currency"
objAxis.HasTitle = True
objAxis.Title.Caption = "Numero de Acciones Correctivas"
set objFont = objAxis.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 8
objFont.Bold = True

%>

<%

'Save the current chart to a GIF file with a temporary
'filename using the FSO
set fso = Server.CreateObject("Scripting.FileSystemObject")

Dim strFileName
strFileName = Server.MapPath(".") & "\" & fso.GetTempName()
objCSpace.ExportPicture strFileName, "gif", 700, 400

'Use On Error Resume Next to make sure we eventually delete
'the temporary GIF file even if something fails in the next
'couple of functions
on error resume next

'The GIF file has been created. Return the contents of the
'GIF file as binary data using the BinaryFileStream COM object
set objBinaryFile = Server.CreateObject("BinaryFileStream.Object")
Response.BinaryWrite objBinaryFile.GetFileBytes(CStr(strFileName))

'Delete the GIF file since it is no longer needed
objBinaryFile.DeleteFile CStr(sFullFileName)
'clear variables
set objBinaryFile = nothing
set FSO = nothing
set objCSpace = nothing
%><body bgcolor="#000000">
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:58.