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 / C++ / MFC
  4. need help on generate report to excel

need help on generate report to excel

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
8 Posts 3 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.
  • F Offline
    F Offline
    firebolt77
    wrote on last edited by
    #1

    hi all.. I am working on a program using visual c++ that has a feature to generate reports in Excel format but I still confused how to do it. Can anybody help? thx

    J U 2 Replies Last reply
    0
    • F firebolt77

      hi all.. I am working on a program using visual c++ that has a feature to generate reports in Excel format but I still confused how to do it. Can anybody help? thx

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      Excel has an XML schema in which it can save/read spreadsheets. You can try saving a simple document as XML from Excel itself to see the way it looks, or you can obtain full documentation here: Office 2003: XML Reference Schemas[^] I suggest generating first an XML with just the needed data, and then using XSL transformations to convert it to any other format (including Excel's XML schema, but you might also convert it to an HTML page). That way you can separate the logic needed to obtain the data from the presentation format, which is better both in terms of ease of development and of maintenance. The transformation may be done in memory without actually saving an intermediate file. Hope that helps, -- jlr http://jlamas.blogspot.com/[^]

      F 1 Reply Last reply
      0
      • F firebolt77

        hi all.. I am working on a program using visual c++ that has a feature to generate reports in Excel format but I still confused how to do it. Can anybody help? thx

        U Offline
        U Offline
        urxlnc007
        wrote on last edited by
        #3

        i too worked for same thing in ur project, what i did is create file in write mode in with :cool:"filename.xls" by following right tabs and newlines bye.......... Satishvarma.E

        F 1 Reply Last reply
        0
        • J Jose Lamas Rios

          Excel has an XML schema in which it can save/read spreadsheets. You can try saving a simple document as XML from Excel itself to see the way it looks, or you can obtain full documentation here: Office 2003: XML Reference Schemas[^] I suggest generating first an XML with just the needed data, and then using XSL transformations to convert it to any other format (including Excel's XML schema, but you might also convert it to an HTML page). That way you can separate the logic needed to obtain the data from the presentation format, which is better both in terms of ease of development and of maintenance. The transformation may be done in memory without actually saving an intermediate file. Hope that helps, -- jlr http://jlamas.blogspot.com/[^]

          F Offline
          F Offline
          firebolt77
          wrote on last edited by
          #4

          but if I'm using this method...can the xls file be opened at Ms Excel XP or lower? Because as I know, only Ms Excel 2003 that support XML. Is there any object library that I can use?(I'm using visual c++ 6.0) thx.

          J 1 Reply Last reply
          0
          • F firebolt77

            but if I'm using this method...can the xls file be opened at Ms Excel XP or lower? Because as I know, only Ms Excel 2003 that support XML. Is there any object library that I can use?(I'm using visual c++ 6.0) thx.

            J Offline
            J Offline
            Jose Lamas Rios
            wrote on last edited by
            #5

            firebolt77 wrote: but if I'm using this method...can the xls file be opened at Ms Excel XP or lower? I have Office XP and Excel can save to XML. I don't know about previous versions, but try it yourself. Open an excel document, select File / Save As, and look at the available formats. firebolt77 wrote: Is there any object library that I can use? I don't know, there might be; I didn't search. -- jlr http://jlamas.blogspot.com/[^]

            F 2 Replies Last reply
            0
            • J Jose Lamas Rios

              firebolt77 wrote: but if I'm using this method...can the xls file be opened at Ms Excel XP or lower? I have Office XP and Excel can save to XML. I don't know about previous versions, but try it yourself. Open an excel document, select File / Save As, and look at the available formats. firebolt77 wrote: Is there any object library that I can use? I don't know, there might be; I didn't search. -- jlr http://jlamas.blogspot.com/[^]

              F Offline
              F Offline
              firebolt77
              wrote on last edited by
              #6

              thx..I've download the references schema..it very helpful. Can u give me some links that provide more examples about the references schema? thx..

              1 Reply Last reply
              0
              • U urxlnc007

                i too worked for same thing in ur project, what i did is create file in write mode in with :cool:"filename.xls" by following right tabs and newlines bye.......... Satishvarma.E

                F Offline
                F Offline
                firebolt77
                wrote on last edited by
                #7

                if I use this method, will the cell be resized automatically? Can I make a table(with lines) using this method? thx..

                1 Reply Last reply
                0
                • J Jose Lamas Rios

                  firebolt77 wrote: but if I'm using this method...can the xls file be opened at Ms Excel XP or lower? I have Office XP and Excel can save to XML. I don't know about previous versions, but try it yourself. Open an excel document, select File / Save As, and look at the available formats. firebolt77 wrote: Is there any object library that I can use? I don't know, there might be; I didn't search. -- jlr http://jlamas.blogspot.com/[^]

                  F Offline
                  F Offline
                  firebolt77
                  wrote on last edited by
                  #8

                  I've read the microsoft office schema, but it is very complex and I didn't understand. I even try to make an excel using xml by following the instruction from ms office schema, but it doesn't work. Can you give me some examples or maybe other links? thx.

                  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