p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: DO U NEED CR VIEWER WITH ActiveX 8?


Message #1 by "sree" <sree_pulapaka@h...> on Sat, 22 Jun 2002 15:50:51
Hi All,

I have always used the rdc in vb5 and later on vb6 and I have always used 
them with selection formula and the following code:

 frmReportWindow.ScaleMode = 3
 frmReportWindow.Caption = "Address Lables"
 frmReportWindow.rptManager.WindowParentHandle = frmReportWindow.hWnd
frmReportWindow.rptManager.ReportFileName = szReportFolderSpecs 
& "\AddressLables.rpt"
frmReportWindow.rptManager.DataFiles(0) = szActiveDBSpecs
frmReportWindow.rptManager.SelectionFormula = FilterFormula
frmReportWindow.rptManager.Action = 1
frmReportWindow.rptManager.PageZoom (100)

However, now I am passing some stored procedure parameters to parameter 
fields and am using the acivex 8.0 designer as in the following code.  My 
qestion is DO YOU NEED TO USE THE VIEWER WHEN USING THE ACTIVEX DESIGNER 
COMPONENT because I cannot see the windowdestination property we used 
before?:

 Public rpt As CRAXDRT.Report
    
    
    
    
Private Sub Command1_Click()
Screen.MousePointer = vbHourglass
Dim rptapp As CRAXDRT.Application
Dim rpt As CRAXDRT.Report

Set rptapp = New CRAXDRT.Application

Set rpt = rptapp.OpenReport("c:\crystal\EventsPremiumPayReport.rpt")


    rpt.DiscardSavedData
    rpt.EnableParameterPrompting = False
    

   
    Dim crPars As CRAXDRT.ParameterFieldDefinitions
    Dim crPar As CRAXDRT.ParameterFieldDefinition
    
    Set crPars = rpt.ParameterFields
    
    crPars.Item(1).SetCurrentValue "2002"
    crPars.Item(2).SetCurrentValue 13

 Frmshow.Show
 
 With Frmshow

   .CRViewer1.ReportSource = rpt
   .CRViewer1.EnableGroupTree = False
   .CRViewer1.ViewReport
   End With
    Screen.MousePointer = vbDefault


All help would of course be greatly appreciated.

Thanks and Best Regards
Sree
Techneers


  Return to Index