Solved

how to exit from Crystal Report Using ESC key in vb6

Posted on 2011-09-02
9
952 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

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 100

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now