Solved

Crystal Reports 4.6 and VC++ 6

Posted on 2000-03-01
5
316 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 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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
C++ get user from AD  (VS6) 7 111
Cross compile release version of c++ program for linux 2 146
c++  placing data into a form and an editbox 5 48
print bytes of an integer 6 48
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

732 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