Programming with TeeChart on Sharepoint webpart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Beige
Newbie
Newbie
Posts: 25
Joined: Wed Jun 28, 2006 12:00 am

Programming with TeeChart on Sharepoint webpart

Post by Beige » Wed Feb 06, 2008 9:58 pm

I had worked on TeeChart with .Net web pages. Now I need to do the same thing with Teechart but in a webpart. Do you have any tutorials or walk though on this?

thanks a lot.

best, Jane

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 07, 2008 9:05 am

Hi Jane,

TeeChart for .NET may be used with Sharepoint Server, principally in the following two ways:

- Creating a Webpart that contains an image and generating the image via a call to a Chart generator process via dynamic parameter updates from the webpage. I've sent you an example project of that type of Webpart format.

The Chart generator process would similar to that included in the TeeChart ASP.NET demo under "Interacting with Charts:Chart as Image:Series Types as Image"

- Creating a UserControl (.ascx) that contains the Chart. We have no current example of that to send you but tests were made to support a customer information request so we can confirm that the option functions.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Beige
Newbie
Newbie
Posts: 25
Joined: Wed Jun 28, 2006 12:00 am

Thanks!

Post by Beige » Thu Feb 07, 2008 5:38 pm

Narcís, thanks for such a quick response. I will try this out and let you know the result.
In .NET web page, we already had a Teechart user control. So I am curious how to use that user control directly in webpart to make it easier. Please let me know when you have such code(test version is fine)...

regards, Jane

Beige
Newbie
Newbie
Posts: 25
Joined: Wed Jun 28, 2006 12:00 am

Tried the first approach

Post by Beige » Thu Feb 07, 2008 11:18 pm

I tried the first approach. This way I still have to get data from ShowSeries.aspx. I will need to get away from .aspx and feed data in the webpart itself. So I copied the code in ShowSeries.aspx.cs and put it in webpart, it's like this:
------------------------------------------------------------------------------
Steema.TeeChart.Web.WebChart webchart = new Steema.TeeChart.Web.WebChart();
Chart chart = webchart.Chart;
chart.Series.Add(new Steema.TeeChart.Styles.Line());
.
.
.
MemoryStream tempStream = new MemoryStream();
chart.Export.Image.PNG.Save(tempStream);
//tempStream.Flush();
Response.ContentType = "Image/PNG";
Response.OutputStream.Write(tempStream.ToArray(), 0, (int)tempStream.Length);
tempStream.Close();


chart.AutoRepaint = true;
Controls.Add(webchart);
-------------------------------------------------------------------------------------
I got the "object is null " error at the first line, seems that I can not create the object, do not know why...?
Also, how can I handle "Response" at the end to output the stream to an image, since Repsonse is not avaliable here?

Or, will my assumed approach work at all?

thanks, Jane

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 08, 2008 8:18 am

Hi Jane,
Please let me know when you have such code(test version is fine)...
Did you receive the e-mail with the example I sent you yesterday to your forums profile e-mail address?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Beige
Newbie
Newbie
Posts: 25
Joined: Wed Jun 28, 2006 12:00 am

Got the mail

Post by Beige » Fri Feb 08, 2008 6:33 pm

Narcís, yes I got your email and looked into the webpart code within zipped file. I notice it still uses the ShowSeries.aspx to get the data and render image. I want to see if it's possible to put all of these functionalities in a webpart, so I tried the above code. Obviously it does not work...Can you tell what's wrong with it?

For the second approach of User Control(.ascx), we had developed a user control before, all we do in each web page is just feed the data to the user control . So I am thinking if we can do the same thing in a web part. But I am not sure:
1) how to refer user control in web part?
2) how to handle the GetChart.aspx file now?
So I want to see if you have some code sample on this as you mentioned you are test something on this.


thanks again for your help, Jane

Post Reply