Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports/VC++ problems

Status
Not open for further replies.

Valius

Programmer
Oct 20, 2000
174
US
I'm hoping one of you guys have messed with the Crystal Reports Object and can give me some info on it. I'm creating a Crystal report object like so:

CCrystalCtrl *Rpt;
Rpt = new CCrystalCtrl;

Rpt->Create("Crystal", WS_VISIBLE|WS_CHILD, CRect(0, 0, 300, 300), FromHandle(this->m_hWnd), 30);

I'm thinking that the create function would work like any other Create functions. Well, when I set the ReportFileName and set it to show the report, it works fine and I get the basic report. But when I set the SelectionFormula then try and show the report, nothing comes up....no Crystal window, ZIP!

I get a funny First-change exception when I create the window, so maybe I'm creating it wrong:

First-change exception in prg.exe (blab blab bla) Microsoft C++ exception.

then right after that, I get:
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).

I've looked up this DISP_E_MEMBERNOTFOUND, so I know basically what it means. But for the life of me I can't figgure out if this is what is causing my problem or not. Maybe I just need to take another peek at my selection formula and make sure it is correct. Any info on this subject would be greatly appreciated. Thanks in advance!

Niky Williams
NTS Marketing
 
Found my problem.....don't ask

Niky Williams
NTS Marketing
 
Niky,

I know you say don't ask but I have to. I am having the same problem with the selectionformula. If I don't set it I get a window displaying a report. If I set it nothign...ZIP!

What did you do to resolve this?


Peter
 
Peter,
Crud, that was a LONG time ago. I'm using the Crystal API now to do everything, more control. I'll take a quick look into it and see if I can figgure out what I did to fix it...I've slept since then so I'm not sure if I'll have any luck, but I'll give it a go. Can you post some of your code here so I can see it and maybe refresh my memory as to what I need to do?

Niky
 
I got the same problem but I managed to solve my own problem, hope this will help.

I am using the Crystal API with Foxpro database, it work perfect in design time but in runtime, after I assign values to parameter, it turns out blank. Looking into the event.log file created by the engine I got some error like this :

"REportNamexxx.rpt:Server not yet opened" (wording might differ)

Its actually a 599 error code. Referring to the CR website, error 599 is caused by Foxpro dsn which does not carry the database location, here's an excerpt

'When you use this generic &quot;Visual FoxPro Database&quot; ODBC DSN, you must specify a path to the Visual FoxPro database. You can specify the database path by using the 'DatabaseName' member of the &quot;LogonInfo&quot; structure. The &quot;DatabaseName&quot; member uses the qualifier &quot;<crwdc>dbq= &quot;.'

For full explanation, refer to

Regards
 
Hi,
I want to know how to create crystal report dynamically in VC++6.0 and how to set DSN,Tablename,etc.I want to avoid doing all these stuff during design time of .rpt file in Crystal Report studio.
Pls help or send me code snippet.&quot;Create&quot; function is causing problem.What all do i need to install?.I have Seagate crystal report version 4.6(not aware of licence details...)
thanks in advance..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top