PC Review


Reply
Thread Tools Rate Thread

Create a chart with ASP

 
 
Ingo R. Kirchner
Guest
Posts: n/a
 
      1st Apr 2004
Hi Folks,

I try to create a chart via vbscript in asp, it worked finde in my IIS, but
on another machine it crashed at SeriesCollection, saying this property is
not supported:
any help appreciated
thanks in advance

ingo

Dim xlApp, xlBook, xlSheet, xlRange
Set xlApp = Server.CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
xlApp.Application.Visible = False
xlBook.Sheets.Add
xlBook.ActiveSheet.Name = "a"
xlBook.Sheets("a").Cells(1,1).Value = "d"
xlBook.Sheets("a").Cells(2,1).Value = "e"
xlBook.Sheets("a").Cells(3,1).Value = "f"
xlBook.Sheets("a").Cells(4,1).Value = "g"
xlBook.Sheets("a").Cells(5,1).Value = "h"
xlBook.Sheets("a").Cells(1,2).Value = Session("E202")
xlBook.Sheets("a").Cells(2,2).Value = Session("E202_1")
xlBook.Sheets("a").Cells(3,2).Value = Session("E203")
xlBook.Sheets("a").Cells(4,2).Value = Session("E207")
xlBook.Sheets("a").Cells(5,2).Value = Session("E210")
Set xlRange = xlBook.Sheets("a").Range("A1:B5")
Set xlChart = xlBook.Sheets("a").ChartObjects.Add(20, 20, 644, 402)
xlChart.Chart.ChartWizard xlRange, -4102, , 2, 1, 0, False
xlChart.Chart.ChartType = 70
xlChart.Chart.HasTitle = False
xlChart.Border.Weight = 2
xlChart.Border.LineStyle = 0
xlChart.Chart.SeriesCollection(1).DataLabels.ShowPercentage = False
xlChart.Chart.SeriesCollection(1).DataLabels.ShowCategoryName = True
xlChart.Chart.SeriesCollection(1).DataLabels.ShowValue = False
xlChart.Chart.SeriesCollection(1).HasLeaderLines = True


 
Reply With Quote
 
 
 
 
Tushar Mehta
Guest
Posts: n/a
 
      4th Apr 2004
What does column B contain on the different servers? Does it have
numeric data on the server where you have problems? Do you get a
legitimate plot after the ChartWizard method? Are the OWC on the
different servers the same (version)?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Microsoft MVP -- Excel

In article <#$(E-Mail Removed)>, spam@tst-
frankfurt.de says...
> Hi Folks,
>
> I try to create a chart via vbscript in asp, it worked finde in my IIS, but
> on another machine it crashed at SeriesCollection, saying this property is
> not supported:
> any help appreciated
> thanks in advance
>
> ingo
>
> Dim xlApp, xlBook, xlSheet, xlRange
> Set xlApp = Server.CreateObject("Excel.Application")
> Set xlBook = xlApp.Workbooks.Add
> Set xlSheet = xlBook.Worksheets(1)
> xlApp.Application.Visible = False
> xlBook.Sheets.Add
> xlBook.ActiveSheet.Name = "a"
> xlBook.Sheets("a").Cells(1,1).Value = "d"
> xlBook.Sheets("a").Cells(2,1).Value = "e"
> xlBook.Sheets("a").Cells(3,1).Value = "f"
> xlBook.Sheets("a").Cells(4,1).Value = "g"
> xlBook.Sheets("a").Cells(5,1).Value = "h"
> xlBook.Sheets("a").Cells(1,2).Value = Session("E202")
> xlBook.Sheets("a").Cells(2,2).Value = Session("E202_1")
> xlBook.Sheets("a").Cells(3,2).Value = Session("E203")
> xlBook.Sheets("a").Cells(4,2).Value = Session("E207")
> xlBook.Sheets("a").Cells(5,2).Value = Session("E210")
> Set xlRange = xlBook.Sheets("a").Range("A1:B5")
> Set xlChart = xlBook.Sheets("a").ChartObjects.Add(20, 20, 644, 402)
> xlChart.Chart.ChartWizard xlRange, -4102, , 2, 1, 0, False
> xlChart.Chart.ChartType = 70
> xlChart.Chart.HasTitle = False
> xlChart.Border.Weight = 2
> xlChart.Border.LineStyle = 0
> xlChart.Chart.SeriesCollection(1).DataLabels.ShowPercentage = False
> xlChart.Chart.SeriesCollection(1).DataLabels.ShowCategoryName = True
> xlChart.Chart.SeriesCollection(1).DataLabels.ShowValue = False
> xlChart.Chart.SeriesCollection(1).HasLeaderLines = True
>
>
>

 
Reply With Quote
 
Ingo R. Kirchner
Guest
Posts: n/a
 
      5th Apr 2004
Hi Tushar,

thanks for your answer. Column A contains the description and column B
contains the amount. So I want to create a exploded pie chart for five
amounts, which worked fine on my machine, but not on another the mentioned
error message came up.

like

A B
food 385
rent 250
car 150
insurance 75
taxes 210

any idea whats wrong with the code

thanks a lot

Ingo


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A real challenge: Create a Gantt-chart-like chart gnewsgroup Microsoft ASP .NET 4 6th Feb 2008 02:27 PM
Create a record-bound chart from a global chart =?Utf-8?B?Q2hp?= Microsoft Access 2 14th Sep 2007 09:48 PM
create line chart with two axises in Pivot Chart =?Utf-8?B?SHVhWEM=?= Microsoft Excel Charting 1 21st Feb 2007 08:28 PM
Chart data file lost - need to re-create from chart? =?Utf-8?B?TG9zdEV4Y2VsRGF0YQ==?= Microsoft Excel Charting 1 7th Jun 2006 07:54 PM
Create a combo chart with two of the same chart types =?Utf-8?B?TWFyayBQYXJlbnQ=?= Microsoft Excel Charting 2 14th Oct 2005 01:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:34 AM.