Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to exit from Crystal Report Using ESC key in vb6

Posted on 2011-09-02
9
Medium Priority
?
1,037 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
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 500 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 500 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

916 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