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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR9 Viewer & Keypress

Status
Not open for further replies.

SqueakinSweep

Programmer
Jun 20, 2002
945
GB
I have a standard form with a CR9 viewer on it, docked to fill the form. All works well, report loads and displays, now all I want to do is to press the ENTER key, and for the report to print (I also want to trap other key events too!). However none of the viewers key press events seem to fire. Has anyone else noticed this, or does anyone know of a patch or a workaround?

Thanks


Sweep
...if it works dont mess with it
 
You could put a "Print" button on the form, then in the form properties set that button to be the default button. I haven't tried catching the key press on a report view, but I have a project working with one, if I get a chance I'll take a look.

-Rick

----------------------
 
Thanks Rick

I already have a toolbar which has buttons to perform a print, email and export to PDF option, which all work fine. I'll wait and see if I get any response from Business Objects support, and post back if I get any news from them.

The reason I want to do this is to maintain compatibility with another report viewer, which is based on the Printdocument class. I have a series of F-Key presses, and ENTER to Print. The only way I could get this to work with the PrintDocument class was to add a vertical scrollbar, and check the key press events of that.



Sweep
...if it works dont mess with it
 
As an update to my original post, Business Objects have identified this as a known problem.

The only known "fix", is to upgrade to CR.10


Sweep
...if it works dont mess with it
 
I need to see a sample form that runs crystal reports. Just wondering if you had a book or instructions helping you build your crystal reports viewer.

I have visual basic standard, and I own crystal reports 10.0
 
Gary

My Viewer form is little more than a base VB.NET form, with a Crystal Viewer control dropped upon it.

I then create a new instance of the viewer form, and simply pass in the Crystal Report (.rpt) file, which is already instantiated as an object, and the dataset which it is bound to.

If you check out the FAQ section, you will find an article relation to integrating with Crystal Reports from .NET


Sweep
...if it works dont mess with it
 
Hey Sweep,
Just a clarification of my earlier post, the purpose of the extra print button isn't for the user to use. It's to control the default action of the form. Make the print button, then stick it behind the CR Viewer, or shrink it to size 0x0, or set it's visible to false (not sure if that will work though). Then set the form's default button to the print button. That way, when the user hit's enter it will automatically run that btnPrint.click event.

-Rick

----------------------
 
Ahhh...the penny has dropped Rick.

Its ok though as we've ordered CR10, not for the bug fix, but as a general update as its much easier to use CR outside of the .NET Environment. Updating the dataset, and getting Crystal within .NET to recognise the changes was a real hit and miss affair, and usually involved logging off/on to the dataset. Nowadays with V9 onwards simply verifying the database brings the changes through.

I agree with your comments mostly on another thread about CR, but like you say, for printing, there is little to better it, and once you have some nice data classes built around it, its very easy to modify a report and rerun it, without having to wait to rebuild your .NET app.



Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top