Solved

how to exit from Crystal Report Using ESC key in vb6

Posted on 2011-09-02
9
950 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

744 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

10 Experts available now in Live!

Get 1:1 Help Now