Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR XI RDC and an ODBC connection to SQL Server

Status
Not open for further replies.

maggiesda

Programmer
Jul 28, 2000
23
US
I'm trying to use the RDC API to integrate CR XI with our C++ application. I need an ODBC connection to SQL Server. I'm thinking that crdb_odbc.dll is the DLL I need in my call to LogOnServer, but I keep getting an exception. Has anyone been here and done this already? (See the code below.)

Thanks in advance.

.....................................................................

VariantInit (&dummy);

dummy.vt = VT_EMPTY;

// Specify the path to the report you want to print

_bstr_t ReportPath("c:\\Program Files\\Business Objects\\Crystal Reports 11\\Samples\\En\\Reports\\General Business\\Inventory.rpt");

_variant_t vtEmpty(DISP_E_PARAMNOTFOUND, VT_ERROR);

// Instantiate the IApplication object
m_Application.CreateInstance("CrystalRuntime.Application.11");

// log on for CR XI
m_Application->LogOnServer("crdb_odbc.dll", "EMS_DEV", "EMS_DEV", "[our user ID]", "[our password]");

//Open the Report using the OpenReport method
m_Report = m_Application->OpenReport(ReportPath, dummy);

int iDest = m_Report->ExportOptions->DestinationType;

// How many tables (sprocs) are in this report?
int iTableCount = m_Report->Database->Tables->Count;

// How many sections are in this report?
int iSectionCount = m_Report->Sections->Count;
int rptObjsCount;

...........................................................

in stdafx.h
#import "C:\Program Files\Common Files\Business Objects\3.0\bin\craxdrt.dll" no_namespace
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top