none
Hosting excel chart in windows forms dotnet 2.0 RRS feed

  • Question

  • Hi,

     

    I am developing a windows aplication in C# dotnet 2.0. It has a requirement that it needs to show excel charts embedded into windows form. I have to show many such forms. I tried of creating the charts with Excel Interop and hosting it in a web browser control. But when I go to create the next chart it throws exception while adding workbook.

     

    Can you please suggest me which control should I use to host the chart so that the user can view the chart and he should be able to save the chart with the background spread sheets which has the data associated with it.

     

    Should I go for AxDSOFramer control? or OWC component? If i have to use the OWC component can I reuse the code I have done with Excel Interop(Creating the workbook and the charts?).

     

    If you have some sample code please send me.

     

    Please reply me soon. Very urgent requirement.

     

    Thanks & Regards,

    Jimprince.

     

    Thursday, March 13, 2008 10:43 AM

All replies

  • >> I tried of creating the charts with Excel Interop and hosting it in a web browser control. But when I go to create the next chart it throws exception while adding workbook.

     

    A couple of ideas:

     

    1) I am not sure what this is doing in the reporting forum -- you may want to move it and ask your question again.  But, just in case...

     

    2) If you have the ability to specify Excel 2007 and/or access to the (free) Excel 2007 viewer for earlier Excel users... maybe you want to try constructing your spreadsheets using programmatic creation of the spreadsheets rather than interop.  I am a big fan of Excel 2003 SSML myself, but in this case I think you wouldn't be able to construct the chart in SSML.

     

    3) What about using the MS Chart control itself to be hosted within the form context, rather than trying to construct the chart within Excel?  You could still supply the spreadsheets with the associated data, whether this included a second copy of the chart control or not.  

     

    4) Hey, this is a reporting forum ! <g>  Suppose you put a chart in a report, and you displayed the report viewer in your form!  The report viewer will export the report to Excel, including the chart!  (And you can still provide your own custom Excel version if you like, re-using your previous work).

     

    5) Last but not least, you say this:

    >>But when I go to create the next chart it throws exception while adding workbook.

     

    ... but you don't say what the error is.  Maybe this is actually easily fixable?

     

    >L<

    Sunday, March 16, 2008 3:19 PM