p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: Link VB to a report


Message #1 by "Sadiah bt Mohd. Rosli" <saddycun@t...> on Thu, 24 Oct 2002 12:42:54 +0800
Hello,

I have a question on linking crystal reports from a VB6 form. What I
want to do is just click on button on the VB form, and it will 'show' or
'display' the all ready created report. That's all.

I've all ready added the component (ActiveX). I just don't know how to
'link' that VB button to the report and display it.

I'm using SQL Server database.

I hope there will be a reply. Thank you.


Regards,
Saddy.

Message #2 by "Liby" <liby.punnoose@n...> on Thu, 24 Oct 2002 10:35:07 -0700
hi Sadiah,
u can use the code as below

With crystalreport								ActiveX component name
        .Connect = g_strDsn							DSN Name
        .Destination = crptToWindow						Destination is Window
        .ReportFileName = "reports\Buisness.rpt"			Report path and name
        .WindowShowRefreshBtn = True					To show refresh button
        .WindowTitle = "Business Summary Report"			title of report
        .PrintReport								to show the report
End With

hope this will help u.

Rgds,
liby


-----Original Message-----
From: Sadiah bt Mohd. Rosli [mailto:saddycun@t...]
Sent: Wednesday, October 23, 2002 9:43 PM
To: crystal_reports
Subject: [crystal_reports] Link VB to a report


Hello,

I have a question on linking crystal reports from a VB6 form. What I
want to do is just click on button on the VB form, and it will 'show' or
'display' the all ready created report. That's all.

I've all ready added the component (ActiveX). I just don't know how to
'link' that VB button to the report and display it.

I'm using SQL Server database.

I hope there will be a reply. Thank you.


Regards,
Saddy.



Message #3 by "Wong Tze Lun" <tzelun0502@l...> on Thu, 24 Oct 2002 21:40:43 +0700
 Hi Sadiah ,
   There are lot of way to link from vb to crystal if your are using crystal 6.0 and below you can use their crystal component ocx
to  call your report out once your click the button.
  eg crystal.action 1 ..this will launch your report but if your are using crsyatl 7 and higher then your should use the cr viewer
to load your report there are different in doing this whihc i can explain too much in ere ..if your need some sample code i can send
to you or try the crsytal decision homepage there offer a lot of sample and tutorial 

regards,
 tlwong
>


____________________________________________________________
Get 250 full-color business cards FREE right now!
http://businesscards.lycos.com 
Message #4 by "Sadiah bt Mohd. Rosli" <saddycun@t...> on Fri, 25 Oct 2002 13:12:07 +0800
Thanks Liby and tlwong,

I'm using Crystal Reports 8.5. I'm kind of messed up with which ActiveX
I'm supposed to be using. Mind giving me the 'exact' name of the
ActiveX? It's quite confusing cause there are a number of them here. 

And yes, I don't mind using the cr viewer. What format would it be in?

Thanks for your help.



-----Original Message-----
From: Wong Tze Lun [mailto:tzelun0502@l...] 
Sent: Thursday, October 24, 2002 10:41 PM
To: crystal_reports
Subject: [crystal_reports] Re: Link VB to a report

 Hi Sadiah ,
   There are lot of way to link from vb to crystal if your are using
crystal 6.0 and below you can use their crystal component ocx to  call
your report out once your click the button.
  eg crystal.action 1 ..this will launch your report but if your are
using crsyatl 7 and higher then your should use the cr viewer to load
your report there are different in doing this whihc i can explain too
much in ere ..if your need some sample code i can send to you or try the
crsytal decision homepage there offer a lot of sample and tutorial 

regards,
 tlwong
>


____________________________________________________________
Get 250 full-color business cards FREE right now!
http://businesscards.lycos.com 


Message #5 by "Wong Tze Lun" <tzelun0502@l...> on Sat, 26 Oct 2002 23:19:26 +0700
Hi sadiah, 
 the active x is call crystal designer and runtime dll and the viewer is in the component tool. The format is still the same is
either you want to use rpt format or data report in vb both also can be run in cr viewer. you can alwiz zdedvelop your report in
seagate crystal report and used the cr viewer to load it for you.

regards
tl wong


____________________________________________________________
Get 250 full-color business cards FREE right now!
http://businesscards.lycos.com 
Message #6 by "Sadiah bt Mohd. Rosli" <saddycun@t...> on Mon, 28 Oct 2002 20:19:56 +0800
Thanks for the info! I'm yet to try it out, :)



-----Original Message-----
From: Wong Tze Lun [mailto:tzelun0502@l...] 
Sent: Sunday, October 27, 2002 12:19 AM
To: crystal_reports
Subject: [crystal_reports] Re: Link VB to a report

Hi sadiah, 
 the active x is call crystal designer and runtime dll and the viewer is
in the component tool. The format is still the same is either you want
to use rpt format or data report in vb both also can be run in cr
viewer. you can alwiz zdedvelop your report in seagate crystal report
and used the cr viewer to load it for you.

regards
tl wong


____________________________________________________________
Get 250 full-color business cards FREE right now!
http://businesscards.lycos.com 



  Return to Index