?
Solved

Crystal Reports 4.6 and VC++ 6

Posted on 2000-03-01
5
Medium Priority
?
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:cbjorkman
ID: 2572440
Adjusted points to 60
0
 
LVL 1

Expert Comment

by:BigOne
ID: 2574064
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
ID: 2575599
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 240 total points
ID: 2576343
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
ID: 2576540
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

752 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