473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Excel Chart

samycbe
83
can anyone please explain how to make a chart from asp in excel. i have a tables in database. i want to make an excel chart for that. if u explain with some basic examples it will be greatful to me,

samy
Feb 27 '07 #1
6 2754
jhardman
3,406 Expert 2GB
I'm not sure I understand. You have a table of data in an excell file and you want to make an ASP graph of the data so the graph is available on the internet? I've done this before, generating pie graphs and histograms, and it is not that hard. Please confirm that this is what you want, and breifly explain the format of the data table.
Feb 27 '07 #2
samycbe
83
Dear Friend,

Please help me. I have data in sqlserver. Lets example 1 table named emp with empname and salary fields. i want to generate a graph for that, when the user click a button in browser. that graph should be in excel.

please do the needful.
Feb 28 '07 #3
jhardman
3,406 Expert 2GB
Okay, so you have data in a sql server db, you want an ASP to open the db, extract the data, and generate a graph (or update a graph) in an excell file?

I have a few questions. First, would it be enough if an existing graph was updated? I think I could get that to work. I'm not sure I could create a graph in excel from an asp.

Second, Do you need to display the updated graph, or just save it? It should be easy to save an updated graph, but I'm not sure I could get an asp to open the graph. Maybe generate one that looks a bit like an excel graph. Would that be enough?

Third, with which parts of this do you need help? Do you know how to open the sql server db and extract the raw data? Do you know how to manipulate it into the form of data an excel file could use to generate a graph? Do you know how to save data from an asp into an excel file? If the last question is the only one with which you need help, then that is doable, If you need help with the whole thing, it's time to offer money to a programmer who could do it for you.

Jared
Feb 28 '07 #4
samycbe
83
Dear Friend

1. I want to display the graph based on the sql data in excel

2. I want to just open - display the excel file and the user will save it

3. I know to fetch and manipulate data in asp from db. only excel display part i need a help

4. if u give code with some basic example, it will be beyond price for me

thanks
Mar 1 '07 #5
jhardman
3,406 Expert 2GB
4. if u give code with some basic example, it will be beyond price for me
Ok, here is what I worked up:

Expand|Select|Wrap|Line Numbers
  1. <% option explicit %>
  2. <!-- #include virtual="common/adovbs.inc" -->
  3. <%
  4. dim objConn, objRS, query, file, names(5), hours(5), i
  5.  
  6. names(0) = "George"
  7. names(1) = "Freeda"
  8. names(2) = "Hercules"
  9. names(3) = "Agatha"
  10. names(4) = "Francois"
  11. hours(0) = 17
  12. hours(1) = 25
  13. hours(2) = 40
  14. hours(3) = 12
  15. hours(4) = 36
  16.  
  17. file = "graphAspTest.xls"
  18. set objConn = server.createobject("ADODB.connection")
  19. objConn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source="&_
  20.    server.mapPath(File)&"; Extended Properties=Excel 8.0;"
  21.  
  22. query = "SELECT * FROM [data$]"
  23. query = query & " ORDER BY nums"
  24. set objRS = server.createobject("adodb.recordset")
  25. objRS.open query, objConn, adopenDynamic, adlockOptimistic
  26.  
  27. for i = 0 to 4
  28.    objRS("names") = names(i)
  29.    objRS("hoursWorked") = hours(i)
  30.    objRS.update
  31.    objRS.movenext
  32. next
  33.  
  34. objRS.close
  35. objConn.close
  36. response.redirect "graphAspTest.xls"
  37. %>
  38.  
So I made an Excel file with one worksheet titled "data" which had just a few columns ("names" and "hoursWorked"). I entered dummy data that Excel could use to generate a graph, then put the graph on as a separate sheet. I saved it with the graph showing.

Then when I run the asp, it opens the Excel file, changes the dummy data to the actual data I want to graph, and closes it, then redirects the user to open the excel file (which opens showing the graph page).

I tested it at the following URL:
www.worksonline.org/temp/graphAspTest.asp

The drawbacks are that you need the excel file and the graph to already exist. I tried to re-size the number of data points on the graph, but I couldn't get it to work. Sorry. It looks like if you ever need a different number of data points, you will need to modify the excel file using MS Excel.

I don't know if there is any other way to do this, maybe you could look up the data format for a WMF (recognized by all of the MS office software, and can be used to store graphs) and generate one that way, but I'm not sure many browsers would be able to handle it.

Please let me know if this helps.

Jared
Mar 1 '07 #6
samycbe
83
Thanks. I will try
Mar 2 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
0
by: mscir | last post by:
Date: Thu, 08 Jul 2004 17:02:27 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <10ero4l3kp2qa65@corp.supernews.com> Reply-To: mscir@usa.com User-Agent: Mozilla/5.0...
1
by: Robin Tucker | last post by:
Heres and interesting problem: I have a VB.NET program that creates reports via. Word Automation. This all works fine. What I want to do as part of this report generation process is to embed a...
1
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are...
0
by: pmclinn | last post by:
The code below takes the data from the S column and grabs all the data and graphs it. The problem is this example grabs 500 cells worth of data and some of these cells = nothing. How do I rescope...
6
by: Thelma Lubkin | last post by:
I am trying to modify an Access form that allows a user to specify the information s/he needs from a census-type database. The form's code builds a SQL statement from the user's request, and...
0
by: madhatter84gn | last post by:
I am trying to automate an excel spreadsheet and then create a chart. Dim chartRange As Excel.Range If rollup Then chartRange = sheet.Range("O2:Q14", Type.Missing) ...
0
by: AlexNunley | last post by:
I am trying to dump data from an access query into excel so I can pretify it. I found sample code from an old access 97 book (The version of access in use)and tinkered it into working. Well sort...
9
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly...
1
by: Ally | last post by:
Hi all, I’m looking to plot charts in Excel from python. After some Googling I’ve found the following code: def plot(x, y, xAxisLog=False, yAxisLog=False): # acquire application object, which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.