Solved

how to exit from Crystal Report Using ESC key in vb6

Posted on 2011-09-02
9
987 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

739 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