Solved

how to exit from Crystal Report Using ESC key in vb6

Posted on 2011-09-02
9
1,000 Views
Last Modified: 2012-05-12
I am using following code to get report, Report is opening in new window,
so my question is
is it possible to use escape key to close Report.

if yes than how to do it.
and if no than any alternate option to do this.
 
CrystalReport1.ReportFileName = App.Path & "\Stock_Summary.rpt"
    CrystalReport1.Connect = con
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.RetrieveDataFiles
    CrystalReport1.Password = Chr(10) & "xxxxxxxx"
    CrystalReport1.WindowState = crptMaximized
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.Action = 1
    CrystalReport1.PageZoom 125

Open in new window

0
Comment
Question by:crystal_Tech
[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
  • 4
  • 3
  • 2
9 Comments
 
LVL 14

Expert Comment

by:Brook Braswell
ID: 36473979
Place a button on your form where the report resides and set the buttons property to of Cancel to True.
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 36474070
I mention in my question
>>>Report is opening in new window,
it means
report is not in the application..


0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 36474091
i am using code in a form,  only code.
code attached in question i asked.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 14

Assisted Solution

by:Brook Braswell
Brook Braswell earned 125 total points
ID: 36474119
then if the report is not in a vb6 form and outside the control of the application then I see no way to trap for a keypress on the report running in a different thread.  Also there are no keypress events associated with a report viewer in vb6.  Once a Crystal object has focus it appears to ignore anything else around it without actually using the mouse to click a close or cancel button.  I tested my suggestion above and even that did not work unless the button had the focus.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36474169
I agree.

mlmcc
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 36475807

report is ready i am using it,
how can i add this report as it is, in vb project.
is it very simple or little complicated

i never created or used  crystal report in vb6 project.

and one more thing
report designed in CR7
and i think VISTA and WINDOWS 7 is not supporting CR7, is it right..?
if yes than,
if i will add CReport in project will report run On VISTA and windows7
i m creating setup file using package and deployment wizard

0
 
LVL 14

Expert Comment

by:Brook Braswell
ID: 36475863
If you can find an older version of CR but newer than 7 then you would be fine.  mlmcc could confirm but I believe that CR XI has com objects that you can use in vb6 but after that CR has moved away from supporting COM.  You can use the report viewer for XI to see your reports in VB6 but will have to make sure you have the legal copy of CR to go along with it.

Cheers
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 125 total points
ID: 36476304
I have not been able to get CR to install on Vista.  Haven't tried Win7.
I had a project about  year ago that required CR7 because they didn't want to spend the $ to upgrade.  I got CR7 to install and run on XP.

CR XI R2 if you can find it will work with VB6.  The code you are using will not work because that method was dropped with CR8.  Here is a paper to help make the change from the OCX to the RDC
http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/d0266ff1-261f-2b10-0284-e45e1568431e

Is this an in-house application?
Is it a client application?

You can get the free trial version of CR XI here.  It is a full version.
http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx

mlmcc
0
 
LVL 1

Author Closing Comment

by:crystal_Tech
ID: 36532363
Thakns
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month6 days, 17 hours left to enroll

623 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