Link to home
Start Free TrialLog in
Avatar of cbjorkman
cbjorkman

asked on

Crystal Reports 4.6 and VC++ 6

Hi

I wondered if anyone has some sample code/info regarding how to use the ActiveX control for Crystal Reports.

My database is in MSAccess. I searched the web for some sample code, but  didn't find anything useful...

Ok, thanx in advance, all help appriciated !

Christer.
Avatar of cbjorkman
cbjorkman

ASKER

Adjusted points to 60
I have used Crystal Reports OCX with access, but do not have any with me.  In short, once you place the control in your application, you just load a report that you have built in CR.  
In building the CR report you connect directly to your Access DB.  I believe this option is offered to you in the report builder wizard.(ODBC)  It's been a while, but that's what I remember off the top of my head.  Do you have a specific problem?
It seems like I have done like you describe...
In my program I then do like this...

CCrystalCtrl m_Crystal;
m_Crystal.PrintReport();

As soon as I try to print a report I get an Assertion...
File:winocc.cpp
Line:345

refers to this line in winocc.cpp:

ASSERT(m_pCtrlSite != NULL);    // not an OLE control (not yet, at least)

Ok, I guess I have done some little stupid error somewhere, can't figure out where though...
Further help apprichiated.

Thanx.
ASKER CERTIFIED SOLUTION
Avatar of BigOne
BigOne

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yep, now it's working...

I created the member variable in classwizard and whoops, it's working.
The only frustrating thing is that when I yesterday inserted my ActiveX control in the document I declared the member variable in Classwizard just as I did now...and it just didn't work...
Guess that I wasn't completely awake yesterday since I made such an easy thing so hard...

Anyway, thanx alot for helping me sort this problem out (it really saved my day since I was becoming really pissed off by this problem).
Well earned points

Thanx.
Christer.