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 -- Creating s new report at runtime.

Crystal Reports -- Creating s new report at runtime.

Scheduled Pinned Locked Moved C / C++ / MFC
c++com
2 Posts 2 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
    Rahim Rattani
    wrote on last edited by
    #1

    I am working with crystal reports 10 in vc++ 6.0 and need to create a new report. I am using the following piece of code. #import "craxdrt.dll" no_namespace IApplicationPtr m_pApplication; IReportPtr m_pReport; .... m_pApplication.CreateInstance("CrystalRuntime.Application"); .... Everyting goes fine till here. But as soon as i call the NewReport() method in the IApplicationPtr it throws a com exception. m_pReport = m_pApplication->NewReport() throws a com exception. Dont know whats going wrong.

    M 1 Reply Last reply
    0
    • R Rahim Rattani

      I am working with crystal reports 10 in vc++ 6.0 and need to create a new report. I am using the following piece of code. #import "craxdrt.dll" no_namespace IApplicationPtr m_pApplication; IReportPtr m_pReport; .... m_pApplication.CreateInstance("CrystalRuntime.Application"); .... Everyting goes fine till here. But as soon as i call the NewReport() method in the IApplicationPtr it throws a com exception. m_pReport = m_pApplication->NewReport() throws a com exception. Dont know whats going wrong.

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      I'm assuming your CreateInstance has failed. What is the HResult returned from it. I usually create a Crystal instance using HRESULT hr = m_Application.CreateInstance(__uuidof(Application)); What exception is thrown? Have you added an exception handler to get more details of the exception? try { m_pReport = m_pApplication->NewReport(); } catch(_com_error& e) { TRACE("COM Error: %s %s %x\n", e.ErrorMessage(), (LPCTSTR)e.Description(), e.Error()); } Michael CP Blog [^]

      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