| |||
Graficas de excel a word por asp Necesito sacar unas graficas junto a unas tablas en un documento word. Los datos de las cuales los saco de un base de datos y trabajo con ellos desde asp. El problema es que no consigo crear las graficas en el excel para pegarlas en el word si alguien pudiera pasarme el codigo o darme alguna idea para solucionarlo se lo agradecere. |
| ||||
Re: Graficas de excel a word por asp ![]() cual es tu metodo de creacion de excel Cita: o mediante codigo??? Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "content-disposition", "inline; filename=Consulta.xls" ![]()
__________________ "Eres parte del problema, parte de la solucion o parte del paisaje" Un Saludo desde Desierto de Altar, Sonora, MX. Shiryu_libra |
| |||
Re: Graficas de excel a word por asp Gracias por acalrarme lo de los temas es ques es la primera vez. No quiero generar un excel como tal. Ese codigo lo e utilizado, el problema es que lo que necesito es crear graficos excel y presentarlos en un documento de word. |
| |||
Re: Graficas de excel a word por asp No hay Nadie que me pueda ayudar con la generacion automatica de graficas para introducirlas en el word mediante ASP, o si no sabeis como METERLA EN WORD da igual con saber como generar los graficos EXCEL en una pagina ASP POR FAVORRRR. |
| ||||
Re: Graficas de excel a word por asp Aparentemente no Normalmente te preguntaría qué necesitas hacer para ver si existen caminos alternativos más sencillos y/o prácticos, pero como detecto que tienes muuucha prisa, solo te voy a recomendar que investigues sobre office web component |
| |||
Re: Graficas excel desde asp <% Sub ShowChart(ByRef aValues, ByRef aLabels, ByRef strTitle, ByRef strXAxisLabel, ByRef strYAxisLabel) ' Some user changable graph defining constants ' Todas las unidades está en pixeles de pantalla Const GRAPH_WIDTH = 430 ' El ancho del cuerpo del grafico Const GRAPH_HEIGHT = 250 ' La altura del cuerpo del grafico Const GRAPH_BORDER = 1 ' Tamaño de borde negro Const GRAPH_SPACER = 2 ' Tamaño del espacio entre barras ' Debugging constant so I can eaasily switch on borders in case ' the tables get messed up. Should be left at zero unless you're ' trying to figure out which table cells doing what. Const TABLE_BORDER = 0 'Const TABLE_BORDER = 10 ' Declare our variables Dim I Dim iMaxValue Dim iBarWidth Dim iBarHeight ' Get the maximum value in the data set iMaxValue = 0 For I = 0 To UBound(aValues) If iMaxValue < aValues(I) Then iMaxValue = aValues(I) Next 'I 'Response.Write iMaxValue ' Debugging line ' Calculate the width of the bars ' Take the overall width and divide by number of items and round down. ' I then reduce it by the size of the spacer so the end result ' should be GRAPH_WIDTH or less! iBarWidth = (GRAPH_WIDTH \ (UBound(aValues) + 1)) - GRAPH_SPACER 'Response.Write iBarWidth ' Debugging line ' Start drawing the graph %> ESTO ES LO QUE ESTOY ACIENDO PERO ES PARA GRAFICAS ECHAS EN ASP. LO QUE NECESITO ES ACERLAS EN UN EXCEL. Y LUEGO SI SE PUEDE PASARLAS A UN WORD SIU NO QUE SE QUEDEN EN EL EXCEL. LO QUE ME AS DICHO YA LO ESTUVE MIRANDO PERO ....?¿?¿?¿?¿ GRACIAS POR LA AYUDA DE ANTEMANO |
| ||||
![]() PARA ESTO TIENES QUE TENER INSTALDO EXCEL EN EL SERVIDOR Y DALE PERMISO AL COM PARA QUE EL USUARIO DE IIS LO EJECUTE ESA EXPLICACION ES MUY LARGA PERO ESTA AQUI http://geeks.ms/blogs/lruiz/archive/...l-intento.aspx set excel = server.createObject("Excel.Application") set libro = excel.workbooks.add 'DIBUJA TITULOS libro.worksheets(1).cells(1,1)= "nombre" libro.worksheets(1).cells(1,2)= "Nombre Empresa" libro.worksheets(1).cells(1,3)= "Tiempo Efectivo" 'DIBUJA CONTENIDO i=2 do while not rs.eof libro.worksheets(1).cells(i,1)= rs("nombre") libro.worksheets(1).cells(i,2)= rs("EmpName") libro.worksheets(1).cells(i,3)= rs("T_Efec") i = i + 1 rs.movenext loop i=i-1 libro.Charts.Add libro.ActiveChart.ChartType = 51 libro.Activechart.BarShape = 1 libro.ActiveChart.SetSourceData libro.worksheets(1).Range("b1:d"&i),2 libro.ActiveChart.Location 2, libro.worksheets(2).name libro.ActiveSheet.ChartObjects("Gráfico 1").Activate libro.ActiveChart.ChartArea.Select 'SI LO QUIERES EN LA MISMO HOJA 'libro.ActiveSheet.Shapes("Gráfico 1").ScaleWidth 0.62, false 'libro.ActiveSheet.Shapes("Gráfico 1").ScaleHeight 0.61, false excel.ActiveWorkbook.SaveAs Server.Mappath(NombreArch),, "", "", False, False, True set libro = nothing excel.DisplayAlerts = False excel.ActiveWorkbook.Close set excel = nothing ESPERO TE SIRVA
__________________ http://www.ticketportal.com.ar/ |