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

¡URGENTE! Crear gráfico excel con asp

Estas en el tema de ¡URGENTE! Crear gráfico excel con asp en el foro de ASP Clásico en Foros del Web. Hola, Anteriormente estaba utilizando el objeto CreateObject("Excel.Application") para crear un fichero en excel con una gráfica y guardarlo en la parte del servidor. Bien, mi ...
  #1 (permalink)  
Antiguo 20/01/2004, 06:38
 
Fecha de Ingreso: diciembre-2003
Mensajes: 3
Antigüedad: 20 años, 5 meses
Puntos: 0
¡URGENTE! Crear gráfico excel con asp

Hola,

Anteriormente estaba utilizando el objeto CreateObject("Excel.Application") para crear un fichero en excel con una gráfica y guardarlo en la parte del servidor.

Bien, mi problema era que no se me guardar el fichero con extension excel ni con el nombre que le asigno.

Ahora he pasado a utilizar el objeto Set ExcelBook = Server.CreateObject("OWC.SpreadSheet"), pero el problema es que las funciones que utilice con el objeto anterior para crear el gráfico no me funcionan.

Donde puedo obtener las funciones y propiedades de OWC.SpreadSheet, no hay manera que las encuentre...y todas las funciones y propiedades relacionadas con el nombre de la hoja, gráficos, etc... no funcionan.

Las unicas que me funcionan son las de asignar un valor a una celda.


Quiero traducir este código para que funcione con OWC.SpreadSheet:

Set ExcelApp = CreateObject("Excel.Application")

ExcelApp.Application.Visible = True
Set ExcelBook = ExcelApp.Workbooks.Add


'Fulla excel amb la taula de resultats
x=1
y=1
if isarray(capcalera) then
for i=0 to ubound(capcalera)
ExcelBook.Cells(x, y).Font.Bold = true
ExcelBook.Cells(x, y).Value = capcalera(i)
y= y+1
next

else
missatge=Err.Description
fila=1

if isarray(dades) then
for i=0 to ubound(dades,2)
if dades(0,i)<>"" then
fila = fila + 1
for j=0 to ubound(dades,1)
if dades(j,i)<>"" then
ExcelBook.Cells(i+2,j+1).Value=dades(j,i) end if
next
end if
next

ExcelBook.name="Resultats"

'Calcul limit inferior de la fulla excel

col = ubound(dades,1) + 1
resto = col mod len(baseColumna)
entero = (col - resto)/len(baseColumna)
limitInferior = ""
if entero > 0 then
limitInferior=mid(baseColumna,entero,1)
end if
if resto > 0 then
limitInferior = limitInferior & mid(baseColumna,resto,1)
end if
limitInferior = limitInferior & cstr(fila)

'Fulla excel amb el gràfic
ExcelBook.Charts.Add
ExcelBook.ActiveChart.ChartType=xlBarClustered ExcelBook.ActiveChart.SetSourceData
ExcelBook.Worksheets(1).Range("B2:" & limitInferior),xlColumns


'Eliminar les series que hi ha per defecte fins a deixar només 1
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete
ExcelBook.ActiveChart.SeriesCollection(2).Delete

'Insertar titol al gràfic
ExcelBook.ActiveChart.HasTitle=true
ExcelBook.ActiveChart.SeriesCollection(1).Name="Gr àfic"
'Eliminar legenda
ExcelBook.ActiveChart.HasLegend=False

'Insertar titol als eixos
ExcelBook.ActiveChart.Axes(xlCategory, xlPrimary).HasTitle = True
ExcelBook.ActiveChart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Alumnes"
ExcelBook.ActiveChart.Axes(xlValue, xlPrimary).HasTitle = True
'ExcelBook.ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Resultats"

ExcelBook.SaveAS path
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 17:59.