Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Producing graphs to MS Excel with OWC and asp? Is it possible?(URGENT)

Status
Not open for further replies.

pdevteam

Programmer
Jun 5, 2001
6
FI
Hi!

I'm developing an web-application, which interacts with database.

Query results are passed easily to Excel, but now the customer wants that somekind of graph (pie-chart etc.) is generated automatically from the data.

Charts can be done with OWC, but now the problem is that when user chooses desired query (which is stored to the DB) and I get "legend" and "data" column names to the to_excel -script which should generate chart (in *.gif format) to Excel, OWC will not work with these parametres.

OWC wants exact column names and it thinks that my parameter is columnname and therefore not work.

Using parametres is necessary, because otherwise a large number of scripts would be needed due to column names.

For example:
...
owcChart.seriesCollection.add.setData owc.constants.chDimCategories, 0, "customerid"

owcChart.seriesCollection.add.setData owc.constants.chDimValues, 0, "employeeid"

set owcLabels = owcChart.seriesCollection.add.dataLabelsCollection.add
owcLabels.hasValue = false
owcLabels.hasPercentage = true
owcLabels.font.name = "tahoma"
owcLabels.font.size = 8
...

will produce graph correctly, but when "customerid" and "employeeid" are replaced with parametres it will stop working.

Is there a any other way to produce these graphs? Ok, then again, I't would be simplier that the user generates graphs him/herself at Excel (that is embedded to Internet Explorer), but if there's a way....
 
The way I have done this in the past is to set up an Excel template with pre-defined data area's, and populate the Excel sheet with the returned data...

The other way is to use something like an ActiveX dll on the server and handle everything from there.

If you just want to create a graph in the form of a graphic, take a look at gnuplot, which is a freebie available from ftp://ftp.gnuplot.org/pub/gnuplot/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top