OWC10 - Using a spreadsheet as the datasource for a chart in C#?

B

Brent Stroh

I'm using the chart component on the server side to create a chart. I've got
a second chart component in the web page on the client, and I use Javascript
to retrieve the XMLData from the server side and load the client side.

The problem is that I get a blank chart on the client side. Looking at the
XML, it appears to contain references to data ranges in the spreadsheet, but
no data. Makes sense, since they're separate components on the server, I
suppose.

So, is there a way I can convince the chart to embed the spreadsheet data in
the XML? Or am I going to have to pass the spreadsheet back to a client-side
equivalent as well?

I know the chart is working, because I can return it as an image instead of
an XML data stream, and I get the expected results.

Thanks for any advice.

I ordered Alvin's OWC Black Book a few days ago, but I'm about a week from
getting it, apparently. Lulu is backlogged.
 
A

Alvin Bruney - ASP.NET MVP

I'm not exactly sure why your charts a blank. If you have data and the
charts are bound to the spreadsheet, the data in the spreadsheet
automatically shows up in the chart. Another approach is to first bind the
xml and then hook the chart to the spreadsheet AFTER the xml has loaded to
see if that helps

--
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
 
B

Brent Stroh

I'm not exactly sure why your charts a blank. If you have data and the
charts are bound to the spreadsheet, the data in the spreadsheet
automatically shows up in the chart. Another approach is to first bind the
xml and then hook the chart to the spreadsheet AFTER the xml has loaded to
see if that helps

Thanks for the suggestion.

I think the problem may be that the spreadsheet only exists in memory on the
server, not on the client. Regardless, I've just modified my code to create
arrays on the server and use them as literals in the charts. Since I had to
convert my DataSet to a SpreadSheetClass, cell by cell, anyway, putting the
values into arrays wasn't much of a switch.

So, that works, now. My next adventure is pivot tables, but that's a
separate post. :)

Thank again!
 

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