Graficas con asistente de vfp

Hola :
Tengo un problema con msgraph, no se si me puedan colaborar.
ESTOY GENERANDO UNA GRAFICA DESPUES DE SELECCIONAR LOS DATOS EN UNA TABLA, A TRAVEZ DE LA LINEA do wzgraph with Tmp.dbf ó Do _gengraph With tmp.dbf (es un asistente para graficar)CUANDO EJECUTO EL PROGRAMA DESDE LA VENTANA DE COMANDOS DEL VFOX 5.O EJECUTA CORRECTAMENTE LLAMANDO EL ASISTENTE PARA GRAFICOS (WZGRAPH.APP) Y PIDIENDOME LOS DATOS NECESARIOS PARA COLOCAR MI GRAFICA EN UN CAMPO OLE COMO DESEO.
EL PROBLEMA QUE AL CORRER EL PROGRAMA DESDE EL EJECUTABLE ME SACA EL SIGUIENTE ERROR:
los asistentes de visual foxpro requieren la version estandar o profesional.
EFECTIVAMENTE TENGO INSTALADO EL VFOX 5.0 ESPAÑOL CON LOS RUNTIME DEL MSGRAPH VERSION PROFESIONAL
PARECE QUE LA APLICACIÓN WZGRAPH NO ES DISTRIBUIBLE O ALGO PARECIDO, COMO INSTALO LOS ASISTENTES, NO SE SI SEPAS DE ALGUIEN QUE ME PUEDA COLABORAR
Adjunto parte del codigo que uso.
GRACIAS POR tu COLABORACIÓN
Samir Humberto Solano
-------------------
SELECT tMP2
public m.grafica
m.grafica =""
WAIT CLEAR
** uso esta linea
DO wzgraph WITH TMP2
** o esta otra
do (_gengraph) with TMP2
select 7
m.grafica = alias()
if empty(m.grafica)
* REMOVE TABLE tmp2 DELETE
thisFORM.comcerrar.click
close databases all
do form GMDEXF
RETURN
ENDIF
USE ALLTRIM(M.GRAFICA)
thisform.txtfin.value = mfinca
thisform.txtfin1.value = mfinca1
thisform.txtfin2.value = mfinca2
thisform.txtflor.value = m.flor
thisform.txtenf.value = m.enfer
thisform.txtaño.value = m.año
thisform.oleGraph.controlsource = m.grafica+".olegraph"
thisform.comfin.visible = .F.
thisform.comfin1.visible = .F.
thisform.comfin2.visible = .F.
thisform.comflor.visible = .F.
thisform.comenf.visible = .F.
thisform.comaño.visible = .F.
thisform.txtFIN.visible = .T.
thisform.txtFIN1.visible = .T.
thisform.txtFIN2.visible = .T.
thisform.txtFLOR.visible = .T.
thisform.txtENF.visible = .T.
thisform.txtAÑO.visible = .T.
thisform.oleGraph.visible = .T.
thisform.cmdPrint.Enabled = .T.
thisform.cmdPrOCESS.Enabled = .F.
thisform.refresh
Respuesta
1
Prueba el Sig. Codigo
Crea un objecto ole msgraph en tu formulario de nombre Objeto
y pon el sig. codigo en el init de tu form
thisform.objeto.object.application.datasheet.rows("1").delete
thisform.objeto.object.application.datasheet.rows("2").delete
thisform.objeto.object.application.datasheet.rows("3").delete
Thisform.objeto.object.application.datasheet.rows("4").delete
Thisform.objeto.object.application.datasheet.rows("5").delete
THISFORM.objeto.object.application.datasheet.columns("2").delete
THISFORM.objeto.object.application.datasheet.columns("2").delete
THISFORM.objeto.object.application.datasheet.columns("3").delete
THISFORM.objeto.object.application.datasheet.columns("3").delete
THISFORM.objeto.object.application.datasheet.columns("4").delete
THISFORM.objeto.object.application.datasheet.columns("4").delete
THISFORM.objeto.object.application.datasheet.columns("5").delete
THISFORM.objeto.object.application.datasheet.columns("5").delete
thisform.objeto.object.application.plotby = 1
thisform.objeto.object.application.datasheet.range("00").value = "Cantidad"
thisform.objeto.object.application.chart.charttype = -4100
thisform.objeto.object.application.chart.Legend.Font.Name="Times New Roman"
thisform.objeto.object.application.chart.Legend.Font.Size=9
thisform.objeto.object.application.chart.Legend.Font.FontStyle="Normal"
thisform.objeto.object.application.chart.Legend.Position=1
thisform.objeto.object.application.chart.Axes(1).TickLabels.AutoScaleFont = .f.
thisform.objeto.object.application.chart.Axes(1).TickLabels.Font.Name="Times New Roman"
thisform.objeto.object.application.chart.Axes(1).TickLabels.Font.Size=9
thisform.objeto.object.application.chart.Axes(1).TickLabels.Font.FontStyle="Normal"
thisform.objeto.object.application.chart.Axes(2).TickLabels.AutoScaleFont = .f.
thisform.objeto.object.application.chart.Axes(2).TickLabels.Font.Name="Times New Roman"
thisform.objeto.object.application.chart.Axes(2).TickLabels.Font.Size=8
thisform.objeto.object.application.chart.Axes(2).TickLabels.Font.FontStyle="Normal"
thisform.objeto.object.application.chart.Axes(3).TickLabels.AutoScaleFont = .f.
thisform.objeto.object.application.chart.Axes(3).TickLabels.Font.Name="Times New Roman"
thisform.objeto.object.application.chart.Axes(3).TickLabels.Font.Size=8
thisform.objeto.object.application.chart.Axes(3).TickLabels.Font.FontStyle="Normal"
Continua --->
thisform.objeto.object.application.chart.HasDataTable = .t.
thisform.objeto.object.application.chart.DataTable.ShowLegendKey = .f.
thisform.objeto.object.application.chart.DataTable.AutoScaleFont = .f.
thisform.objeto.object.application.chart.DataTable.Font.Name="Times New Roman"
thisform.objeto.object.application.chart.DataTable.Font.Size=8
thisform.objeto.object.application.chart.DataTable.Font.FontStyle="Normal"
thisform.objeto.object.application.datasheet.range("A0").value = "Titulo del Grafico"
thisform.objeto.object.application.chart.ApplyDataLabels(2,.F.)
thisform.objeto.object.application.chart.SeriesCollection(1).DataLabels.Font.Name="Times New Roman"
thisform.objeto.object.application.chart.SeriesCollection(1).DataLabels.AutoScaleFont = .f.
thisform.objeto.object.application.chart.SeriesCollection(1).DataLabels.Font.Size=8
thisform.objeto.object.application.chart.SeriesCollection(1).DataLabels.Font.FontStyle="Normal"
thisform.objeto.object.application.chart.ApplyDataLabels(1,.F.)
*****aca van los datos que vas a graficar **********
VOY="0"
VOY0="01"
NRO=0
SELE ACTIVIDADECONOMICA
do while !eof()
NRO=NRO+1
VOY=ALLT(STR(NRO))
VOY0="0"+ALLT(STR(NRO))
T="thisform.objeto.object.application.datasheet.range('"+voy0+"').value ="+"'"+allt(actividadeconomica.estado)+"'"
D="thisform.objeto.object.application.datasheet.range('A"+voy+"').value ="+allt(str(actividadeconomica.Cuantos))
&T
&D
SKIP
Enddo
if thisform.objeto.object.application.chart.hastitle = .f.
thisform.objeto.object.application.chart.hastitle = .t.
endif
thisform.objeto.object.application.chart.charttitle.text = allt(thisform.text1.value)
thisform.objeto.object.application.chart.ChartArea.Interior.ColorIndex = 0
THISFORM.REFRESH
thisform.objeto.VISIBLE=.T.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas