Inserting OWC10 Chart into Excel Spreadsheet

N

Nishal8

I'll get this out of the way: I am just learning the ropes of using
Office Web Components.

I am developing a tool that queries a sql database and loads the data
into an OWC10.Spreadsheet object. This portion works fine.

In the same workbook, I also want to include a line chart. I have had
limited success in doing this portion of the project. I can use the
ExportPicture tool and create an image, but the chart needs to update
when the user inserts data not provided by the DB (like future spending
for example). I've tried binding the two using:

objChartSpace.DataSource = objWorkbook

And I do not receive errors, it just does not show the corresponding
chart....

I output the workbook using:

response.write objWorkbook.XMLData

I am developing on an ASP platform using vbscript (its ancient I know,
but thats what the customer wants). Am I simply not outputting the
chart? Is there a method like objChartSpace.XMLData that I should use?

Any ideas would be really helpful... thanks

-N
 
A

Alvin Bruney - ASP.NET MVP

You aren't binding correctly. You need a double cast. There's code in this
newsgroup demonstrating the correct way to cast.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
N

Nishal8

Thanks Alvin,

I searched the newsgroup and found some snippets from another one of
your replies...

---------
ChartSpace1.DataSource =
Spreadsheet1.SetData(ChartDimensionsEnum.chDimCategories, CType
(ChartSpecialDataSourcesEnum.chDataBound, "A1:A40", Integer))
SpreadSheet1.SetData(ChartDimensionsEnum.chDimValues, CType
(ChartSpecialDataSourcesEnum.chDataBound, "B1:B40", Integer))
---------

unfortunetly, this is in the .NET framework. I am not using this
framework, and am using VBScript, not VB.NET. Do you know if this code
can translate to VBScript and ASP?

I know the chart is being built, since I can save the image and the
chart data is correct. Its just a matter of getting the chart into the
spreadsheet with the data.

Thanks again for any help you or others can provide!

-N
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top