Solved

Crystal Reports 4.6 and VC++ 6

Posted on 2000-03-01
5
307 Views
Last Modified: 2010-04-02
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.
0
Comment
Question by:cbjorkman
  • 3
  • 2
5 Comments
 

Author Comment

by:cbjorkman
Comment Utility
Adjusted points to 60
0
 
LVL 1

Expert Comment

by:BigOne
Comment Utility
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?
0
 

Author Comment

by:cbjorkman
Comment Utility
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.
0
 
LVL 1

Accepted Solution

by:
BigOne earned 60 total points
Comment Utility
I don't have the CR help with me, but the assertion(and memory) leads me to believe that you are not yet done.  After declaring the variable you need to then call "create" or "initialize" or something along those lines.  Do you really want to create it on the stack?  If you let the IDE take care of the control (add it to a form, add amember variable) you don't have to worry about all of this.  From the looks of your control is going to go out of scope.  Is that what you want?  I am sure you are closer to success than you think.

Good Skills
0
 

Author Comment

by:cbjorkman
Comment Utility
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now