Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb problem

Status
Not open for further replies.

malk

MIS
Dec 12, 2000
84
0
0
US
I am using VB 6 to show ny reports in the Crystal ActiveX control. My problem is, is that I launch my report on form load, and after I shut the activex screen the exe is still running until I close "form1". how do I make my application automaticaly end after CR is cancelled?
 
Just type "Unload Me" after you have activated your report. For example:

Private Sub Form_Load()
crptMyReport.Action = 1 ' activates your report
Unload Me ' unload the form
End Sub
 
The problem with that is, it unloads form that has the Activex control in there, so the report opens and closes to quickly to even view it.
 
You can try moving your ActiveX Control to your other Form then concatenate the Form with CR ActiveX when you define your ActiveX Control and run your report.

By the way, can you tell me your objectives why you are activating and unloading the report within the Form_Load event? Perhaps I can share you a better method.
 
I have a DOS based program that I am trying to incorporate CR into. I am trying to make this as seemless as possible.

What the program does is on a print command:
1-sends al data to a CSV file, and
2-launched an executable program that will launh a Crystal Report based on that data.
To make it seemless, I need the report to launch in viewer mode, and then pass exit the program when the ActiveX is exited.
What i di was made form1 run the ActiveX on form load, and run invisable. The problem as I explained earlier is that the program never unloads by closing the ActiveX. If I tell it to unload after launching the ActiveX it unloads the ActiveX also.
 
As I understood it, you are only using VB just to run your CR report. Right? If this is the case, the easiest and simpliest way is... compile your CR report within CR itself and run the compiled CR report.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top