cancel
Showing results for 
Search instead for 
Did you mean: 

Issue: Hosting Crystal Report Viewer in a VFP SCreen

Former Member
0 Kudos

I'm currently trying to host a Crystal Report viewer instance in the background screen of a VFP Application. I Host the Crystal Report Viewer in a contanier object and then add that to the screen. That appears to work fine. The issue I'm Running into is that when i start processing keystrokes on any other forms, the enter key is lost to me. If I do the same thing in the VFP IDE The enter key is also lost.

the Screen is a considered a VFP Form.

is the code i run to add the object to the form

_screen.AddObject("fred","crContainer")

In the Init of crCOntainer I have the following code

local oReport, oCrystal

oCrystal = CREATEOBJECT("CrystalRuntime.Application")

oReport = oCrystal.OpenReport(This.Reportname)

this.CRV.ReportSource = oReport

This.Crv.Anchor = 15

this.crv.ViewReport()

CRV is an istance of OLECOntrol that hosts an instance of CrystalReports12.ActiveXReportViewer.1

All other keys appear to be handled by my event handlers in vfp except the enter key. Any suggestions, clues or comments

I have searched, with Google and MSDN for a solution and nothing seems to pop to hand.

Edited by: Joe Gori on Jan 12, 2009 10:25 PM

View Entire Topic
0 Kudos

Hi Joe,

It would appear you are using the ActiveX viewer ( crviewer.dll ) in your app and it may be CR 2008? If so we no longer ship the RDC ( craxdrt.dll ) with this version, it was deprecated since version 9. The one we do ship is craxddrt.dll which is the Designer that is used within Visual Studio .NET IDE to create reports at development time only. It is not licensed to be used outside of .NET or for distribution.

If you are using it I would suggest you upgrade to .NET and use the CR Assemblies.

If not then please make note of the version of CR you are using?

Thank you

Don

Former Member
0 Kudos

I was trying to use Crystal Reports 2008,

The CrystalRuntime.Application appears to be from CR 10

It sounds like 12 is not for me, can I go backwards with crystal to 10 or could i wrap the viewer in an interop wrapper to allow it to work with my comm application, going to .net with VFP is not a choice i have.

I'm Surprised the CrystalRuntime.Application worked with the viewer from 12 as well as it did.

0 Kudos

Hi Joe,

That would explain it. For the most part the CRviewer hasn't changed either but it will cause errors when mixing versions.

One thing was just pointed out to me also with the deprecation of RDC in CR 2008 we also no longer support COM as the underlying code base in CR 2008.

Your only option is to stay with 10 or you can upgrade to CR XI R2, it still ships craxdrt.dll and is supported. You will still be limited to the set RDC API's from 9/10 but it will work for you.

The other option is to go to Java.

Thanks again

Don

Former Member
0 Kudos

Well I went Back to CR XI R2 and I still have the same problem described above any thoughts or next steps.

0 Kudos

Hi Joe,

Use Modules or some other dll' s listing tool to verify you are loading just 11.5.x.x dll's

Not sure if this will work but if so it will force your app to load the right version:

oCrystal = CREATEOBJECT("CrystalRuntime.Application.11")

You may want to un-install all versions except CR XI R2 ( 11.5 )

Thanks again

Don

Former Member
0 Kudos

I switched to CrystalRuntime.Application.11 and it still occurs, playing with it more, it's like the event handler of the viewer is consuming the keystrokes, and it's more keystrokes than just the enter key, it's also eating Delete, up and down they go to the viewer window, even though the viewer window does not have focus. anything the viewer doesn't wants goes to the other window.

I've disabled the viewer, all keys accept the enter key come back to me

Former Member
0 Kudos

Also Another tidbit if i add a second Copy of the viewer in the container it then allows focus to change and i get all key strokes. Its' almost as if in the one viewer case that the Viewer Activex Control Does not lose complete focus.

0 Kudos

Hi Joe,

This sounds really strange. I'm wondering if it's related to your mouse and/or keyboard driver? Can you test your app on another PC that uses a different set of drivers? There are a lot of third party drivers out there and this is the first time I've heard of this specific issue. There were simple lines were suggested for C++ app's to keep focus so the viewer or prompts would not appear behind some other form but never keys being kept in focus.

Did you run Modules to confirm you are using all CR Version 11.5.x.x including crviewer.dll? You can get Modules from our download page in the UTIL area.

Thanks again

Don

Former Member
0 Kudos

It seems I don't have access to the link from a pdf descrivbing modules can you post the link to it please

Former Member
0 Kudos

I'm also talking to Microsoft about this and they have been able to duplicate the issue, but tend to think the issue is in the viewer control itself.

It's as if the control is not honoring the lost focus event of the form. They downloaded CR XI R2 an evaluation copy of the control, to work with the code I sent them.

I have found a work around but it's ugly, if i toggle the visible property of the control in the lost focus event of the form, the control loses focus completely, I don't think this is an acceptable solution as the control flashes even if i lock the screen from updates.

0 Kudos

Hi Joe,

Here's the link to get to our download page:

Click on the Download menu option on the left and then the Crystal link in the center frame. Then fill in Crystal Reports and any version and I believe Utils should bring up Modules as a downlaod option, if not use the wild card search and page through, likely on the last page.

And because the RDC is old they don't want to spend any time fixing anything. If we do though you have to be able to duplicate the issue in Visual Basic, VFP is not an officailly supported dev language so I don't believe there is anything we can do about it.

Thanks again

Don

Former Member
0 Kudos

What version of VB should i Duplicate this in, 6.0, or .NetOBviously 6.0 is closer to vfp but I was also using the control with 12, and allthough that is truly unsupported, i'

d bet it's still a problem there also.

0 Kudos

Hi Joe,

Yes it would be VB6 because RDC is not supported in .NET.

Thanks again

Don