Solved

Crystal Reports 4.6 and VC++ 6

Posted on 2000-03-01
5
315 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
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 60 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel/Word Add-in in what language? 5 128
typedef std::deque<BYTE> ByteVector is broken in vs2012 23 88
Outlook 13 44
Need some help with mailto 16 20
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

830 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