Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Excel Chart in C#

Excel Chart in C#

Scheduled Pinned Locked Moved C#
csharpcssquestion
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Danzy83
    wrote on last edited by
    #1

    I want to programmatically create Excel charts in my c# application. Is there a way I can get the chart into a Panel control in my application? I do not want the Excel grid or cells to be part, just the chart output that is inserted in the worksheet. Thanks.

    L L C 3 Replies Last reply
    0
    • D Danzy83

      I want to programmatically create Excel charts in my c# application. Is there a way I can get the chart into a Panel control in my application? I do not want the Excel grid or cells to be part, just the chart output that is inserted in the worksheet. Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Dan_K wrote:

      I do not want the Excel grid or cells to be part, just the chart output that is inserted in the worksheet. Thanks.

      A lot of those formula's are calculated at runtime, and are not exactly "inserted" in the physical file. We got quite some articles on reading Excel-files and getting their content - check them out.

      Bastard Programmer from Hell :suss:

      D 1 Reply Last reply
      0
      • L Lost User

        Dan_K wrote:

        I do not want the Excel grid or cells to be part, just the chart output that is inserted in the worksheet. Thanks.

        A lot of those formula's are calculated at runtime, and are not exactly "inserted" in the physical file. We got quite some articles on reading Excel-files and getting their content - check them out.

        Bastard Programmer from Hell :suss:

        D Offline
        D Offline
        Danzy83
        wrote on last edited by
        #3

        Any links to resources that describe that? I will be very much happy with that.

        L 1 Reply Last reply
        0
        • D Danzy83

          Any links to resources that describe that? I will be very much happy with that.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          On of the articles on the subject can be found here[^].

          Bastard Programmer from Hell :suss:

          D 1 Reply Last reply
          0
          • L Lost User

            On of the articles on the subject can be found here[^].

            Bastard Programmer from Hell :suss:

            D Offline
            D Offline
            Danzy83
            wrote on last edited by
            #5

            Thanks Eddy, I think the charts are inserted in the worksheet. I don't know if there is a way to send only the chart into my application. Any way to do that?

            L D 2 Replies Last reply
            0
            • D Danzy83

              Thanks Eddy, I think the charts are inserted in the worksheet. I don't know if there is a way to send only the chart into my application. Any way to do that?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              What do you mean with "send into my application"? Excel does not store a chart, but a description of a chart - one that's usually based on values within the same document. You can probably copy the contents to a bitmap and store that in your database.

              Bastard Programmer from Hell :suss:

              1 Reply Last reply
              0
              • D Danzy83

                Thanks Eddy, I think the charts are inserted in the worksheet. I don't know if there is a way to send only the chart into my application. Any way to do that?

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                The short answer is no, there isn't any way to redirect the chart output to a control in your application. The long answer is kind of, but it is so over the top complicated as to make it not worth the effort at all. Excel can provide data, but it's horrible at providing graphics. The best solution is to just get a graphing library and setup the chart in your own application.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

                1 Reply Last reply
                0
                • D Danzy83

                  I want to programmatically create Excel charts in my c# application. Is there a way I can get the chart into a Panel control in my application? I do not want the Excel grid or cells to be part, just the chart output that is inserted in the worksheet. Thanks.

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  When you copy an Excel chart to the ClipBoard, it gets stored in the ClipBoard using a dozen different formats, including PNG, GIF, Bitmap, and EnhancedMetafile; which means any .NET app can retrieve it as an Image or Bitmap and work with that. So start by using Office Interop (don't ask me for details, I don't know; Google and CodeProject do know) and have it copy the chart for you. Then write some code to paint the image where you need it. :)

                  Luc Pattyn [My Articles] Nil Volentibus Arduum

                  1 Reply Last reply
                  0
                  • D Danzy83

                    I want to programmatically create Excel charts in my c# application. Is there a way I can get the chart into a Panel control in my application? I do not want the Excel grid or cells to be part, just the chart output that is inserted in the worksheet. Thanks.

                    C Offline
                    C Offline
                    Cracked Down
                    wrote on last edited by
                    #9

                    I you intention is to display graphs/charts then you can achieve this by using the free library shipped with .Net 4.0. have look Happy Coding :-D

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups