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. Crystal Reports

Crystal Reports

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 4 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.
  • R Offline
    R Offline
    Ruca
    wrote on last edited by
    #1

    Hi, A quick question with regards the above: Can one use Crystal Reports in Visual C++? And if so how does one go about doing that? Thanks Regards Rui

    S P 2 Replies Last reply
    0
    • R Ruca

      Hi, A quick question with regards the above: Can one use Crystal Reports in Visual C++? And if so how does one go about doing that? Thanks Regards Rui

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      You've a C++ SDK[^].


      How low can you go ?
      (MS rant)

      1 Reply Last reply
      0
      • R Ruca

        Hi, A quick question with regards the above: Can one use Crystal Reports in Visual C++? And if so how does one go about doing that? Thanks Regards Rui

        P Offline
        P Offline
        Patje
        wrote on last edited by
        #3

        Yes you can do that. Via COM it is possible to open reports, show them in a window (in a Crystal Reports Viewer ActiveX control), and perform all kinds of actions on it (print, mail, ...). It is even possible to show the embeddable designer, and let you users design their own reports; within your application (although you need a separate license for this). Normally the data for your report will come from a database (that's easy), but it's even possible to tell Crystal Reports that the data comes from within your application. However be careful, since CR 9.0 does not support the same functionality as CR 8.5. If you want to do this I suggest to go to CR 9.0 directly. When you only want to show the report in your application, you don't have to pay any runtime royalty to CR (you can ship a free CR View-Only Runtime). However, if you want to create or modify reports from within your application, or let the user create or modify reports, you need a special RCAPI (Report Creation (or was it Component) API) license. This license is per named user, and costs about the same as a full Crystal Reports. This license and the Design-Time RunTime is mandatory ! simply installing Crystal Reports won't do the job. Best way to get more information is to look at the crystal reports site, especially the developer zone (http://www.crystaldecisions.com/products/dev_zone[^]). Enjoy life, this is not a rehearsal !!!

        A 1 Reply Last reply
        0
        • P Patje

          Yes you can do that. Via COM it is possible to open reports, show them in a window (in a Crystal Reports Viewer ActiveX control), and perform all kinds of actions on it (print, mail, ...). It is even possible to show the embeddable designer, and let you users design their own reports; within your application (although you need a separate license for this). Normally the data for your report will come from a database (that's easy), but it's even possible to tell Crystal Reports that the data comes from within your application. However be careful, since CR 9.0 does not support the same functionality as CR 8.5. If you want to do this I suggest to go to CR 9.0 directly. When you only want to show the report in your application, you don't have to pay any runtime royalty to CR (you can ship a free CR View-Only Runtime). However, if you want to create or modify reports from within your application, or let the user create or modify reports, you need a special RCAPI (Report Creation (or was it Component) API) license. This license is per named user, and costs about the same as a full Crystal Reports. This license and the Design-Time RunTime is mandatory ! simply installing Crystal Reports won't do the job. Best way to get more information is to look at the crystal reports site, especially the developer zone (http://www.crystaldecisions.com/products/dev_zone[^]). Enjoy life, this is not a rehearsal !!!

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          Hi Patje, THank you very much for the information. May I ask you something else: The Crystal Reports that comes with Studio .Net, how does this fit in with what you are saying? I notice that one can create a crystal report item for a C++ application, would this be the report that is called by the Crystal Reports Viewer ActiveX control? Thanks Regards

          P 1 Reply Last reply
          0
          • A Anonymous

            Hi Patje, THank you very much for the information. May I ask you something else: The Crystal Reports that comes with Studio .Net, how does this fit in with what you are saying? I notice that one can create a crystal report item for a C++ application, would this be the report that is called by the Crystal Reports Viewer ActiveX control? Thanks Regards

            P Offline
            P Offline
            Patje
            wrote on last edited by
            #5

            I don't know anything about the CR that comes with VS.Net, but I assume that it's a kind 8.5.Net version, not the brand new CR 9.0. We are using the CR ActiveX control by using the "AtlAxWin" control (part of ATL 3.0) and passing it

            • "CrystalReport.EmbeddableCrystalReportsDesignerCtrl.8.5" for the embeddable designer
            • "CRViewer.CRViewer.8.0" for the ActiveX viewer

            Then use ATL::AtlAxGetControl to get the IUnknown interface of the ActiveX control hosted in the AtlAxWin control. ATL::AtlAxGetControl (NativeWin, &UnknownInterface); Then use IUnknownInterface->QueryInterface to get the interface to the CRVIEWERLib::ICrystalReportViewer4Ptr. hr = UnknownInterface->QueryInterface (__uuidof(CRVIEWERLib::ICrystalReportViewer4),(void **)&CrystalReportViewer); or for the designer: hr = UnknownInterface->QueryInterface (__uuidof(CRDESIGNERCTRLLib::ICRDesignerCtrl),(void **)&CrystalReportDesigner); Then simply use CrystalReportViewer->ReportSource = MyReport to set the report in the viewer (similar for the designer). Don't forget to import the necessary type libraries: #import "CRAXDDRT.tlb" // The Crystal Reports designer run-time #import "CRAXDRT.tlb" // The Crystal Reports non-designer run-time #import "crviewer.tlb" // The Crystal Reports viewer component #import "CRDesignerCtrl.tlb" // The Crystal Reports designer module Also take a look at the generated .tli and .tlh files (by the #import). They're also very interesting if you want to know some of the more technical details. Hope this helps (this was one of my first C++/COM projects, a real C++/COM guru might write this maybe a bit more efficient). Enjoy life, this is not a rehearsal !!!

            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