Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Export Chart to MS Excel or MS Word (Read 15575 times)
John_D
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Apr 21st, 2008
Export Chart to MS Excel or MS Word
Apr 21st, 2008 at 1:15pm
Print Post  
Hi, I am looking use the charting product, is it possible to export the chart after it is populated with data to MS Excel or MS Word to be incorporated into a report for example.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Chart to MS Excel or MS Word
Reply #1 - Apr 21st, 2008 at 2:05pm
Print Post  
Hi,

Masterchart does not support the Word and Excel file formats. You could use the CreateBitmap method to get an image of the chart, then call Image.Save to save it to a file. Finally embed the image file into the Word/Excel reports using the MSOffice Automation API.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
bjawnie
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Apr 6th, 2009
Re: Export Chart to MS Excel or MS Word
Reply #2 - Apr 6th, 2009 at 3:11pm
Print Post  
Hi,

I am facing the same challenge.

Could you possibly provide an example of how we can save an image to Excel or Word?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Chart to MS Excel or MS Word
Reply #3 - Apr 6th, 2009 at 4:08pm
Print Post  
Hi,

Here is a sample showing how to add an image to Word file, using OLE Automation:
http://www.codeproject.com/KB/aspnet/word_automation.aspx

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
bjawnie
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Apr 6th, 2009
Re: Export Chart to MS Excel or MS Word
Reply #4 - Apr 8th, 2009 at 10:53am
Print Post  
Hi,

Thanks for the prompt answer. I can't get it working however.

So I found an alternative way to archieve what I want. I am going to save my chart, a radar chart, to disk and the load it via iTextSharp and save the whole thing as a RTF document.

Unfortunately I am having trouble saving my radar chart. I am trying to save it by first getting the data with GenerateMetafile. However since I am not  rendering the chart as html I am a bit stuck.

Any help would be greatly appreciated. To sum up I need to save my radar chart to disk without rendering it as html.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Chart to MS Excel or MS Word
Reply #5 - Apr 8th, 2009 at 11:26am
Print Post  
Hi,

Are you using the ASP.NET version?

Stoyan
  
Back to top
 
IP Logged
 
bjawnie
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Apr 6th, 2009
Re: Export Chart to MS Excel or MS Word
Reply #6 - Apr 8th, 2009 at 11:42am
Print Post  
Yes, precisely.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Chart to MS Excel or MS Word
Reply #7 - Apr 8th, 2009 at 12:16pm
Print Post  
Hi,

This version adds CreateBitmap and CreateMetafile methods to the WebForms.Chart class:

https://mindfusion.eu/_temp/webcharting_createimg.zip

You could call them to get an image of the chart and then save it to a file using the Image.Save method.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
bjawnie
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Apr 6th, 2009
Re: Export Chart to MS Excel or MS Word
Reply #8 - Apr 12th, 2009 at 4:01pm
Print Post  
Thanks a lot. This seems like the right way, however I am not able to get it working. I get a lot of conflicts with MasterChart.dll and new dll's.
  
Back to top
 
IP Logged
 
bjawnie
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Apr 6th, 2009
Re: Export Chart to MS Excel or MS Word
Reply #9 - Apr 13th, 2009 at 12:10am
Print Post  
I decided to start from scratch again and this time I got it working without the masterchart.dll file.

Thank you very much for the help : )
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Chart to MS Excel or MS Word
Reply #10 - Apr 13th, 2009 at 9:09am
Print Post  
Sorry, I forgot to warn you about the new naming convention we are using now ...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint